Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/config/mkmakefile.cc
Show First 20 Lines • Show All 378 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
read_file(char *fname) | read_file(char *fname) | ||||
{ | { | ||||
char ifname[MAXPATHLEN]; | char ifname[MAXPATHLEN]; | ||||
FILE *fp; | FILE *fp; | ||||
struct file_list *tp; | struct file_list *tp; | ||||
struct device *dp; | struct device *dp; | ||||
struct opt *op; | struct opt *op; | ||||
struct includepath *ipath; | |||||
configword wd; | configword wd; | ||||
char *rfile, *compilewith, *depends, *clean, *warning; | char *rfile, *compilewith, *depends, *clean, *fnamebuf, *warning; | ||||
const char *objprefix; | const char *objprefix; | ||||
int compile, match, nreqs, std, filetype, negate, | int compile, match, nreqs, std, filetype, negate, | ||||
imp_rule, no_ctfconvert, no_obj, before_depend, nowerror; | imp_rule, no_ctfconvert, no_obj, before_depend, nowerror; | ||||
fp = fopen(fname, "r"); | fp = fopen(fname, "r"); | ||||
if (fp == NULL) { | |||||
SLIST_FOREACH(ipath, &includepath, path_next) { | |||||
asprintf(&fnamebuf, "%s/%s", ipath->path, fname); | |||||
if (fnamebuf != NULL) { | |||||
fp = fopen(fnamebuf, "r"); | |||||
if (fp != NULL) | |||||
break; | |||||
free(fnamebuf); | |||||
} | |||||
} | |||||
} | |||||
if (fp == NULL) | if (fp == NULL) | ||||
err(1, "%s", fname); | err(1, "%s", fname); | ||||
next: | next: | ||||
/* | /* | ||||
* include "filename" | * include "filename" | ||||
* filename [ standard | optional ] | * filename [ standard | optional ] | ||||
* [ dev* [ | dev* ... ] | [ no-obj ] | * [ dev* [ | dev* ... ] | [ no-obj ] | ||||
* [ compile-with "compile rule" [no-implicit-rule] ] | * [ compile-with "compile rule" [no-implicit-rule] ] | ||||
▲ Show 20 Lines • Show All 435 Lines • Show Last 20 Lines |