summaryrefslogtreecommitdiff
path: root/distrib/crunch/crunchgen/crunchgen.c
diff options
context:
space:
mode:
authoretheisen <etheisen@cvs.openbsd.org>1996-09-25 04:41:21 +0000
committeretheisen <etheisen@cvs.openbsd.org>1996-09-25 04:41:21 +0000
commit5eb81aa4ba6e0f7eed3290c5a011e0e984ee3233 (patch)
tree671330d2cb45396be7dba04424a5e369108f8051 /distrib/crunch/crunchgen/crunchgen.c
parenta40c7fb2de11dc1847ba1e2e10fadfeeca359b13 (diff)
Make crunchgen work with Makefile.bsd-wrapper as well.
Diffstat (limited to 'distrib/crunch/crunchgen/crunchgen.c')
-rw-r--r--distrib/crunch/crunchgen/crunchgen.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/distrib/crunch/crunchgen/crunchgen.c b/distrib/crunch/crunchgen/crunchgen.c
index 277a805ef34..9f8e76ee916 100644
--- a/distrib/crunch/crunchgen/crunchgen.c
+++ b/distrib/crunch/crunchgen/crunchgen.c
@@ -476,6 +476,12 @@ void fillin_program(prog_t *p)
char path[MAXPATHLEN];
char *srcparent;
strlst_t *s;
+ int i;
+ char *mf_name[] = {
+ "Makefile",
+ "Makefile.bsd-wrapper",
+ NULL
+ };
sprintf(line, "filling in parms for %s", p->name);
status(line);
@@ -502,9 +508,22 @@ void fillin_program(prog_t *p)
}
}
- if(p->srcdir) sprintf(path, "%s/Makefile", p->srcdir);
- if(!p->objs && p->srcdir && is_nonempty_file(path))
- fillin_program_objs(p, path);
+ /* XXX - This should be runtime configurable */
+ // We have a sourcedir and no explict objs, try
+ // to get objs from makefile.
+ if (p->srcdir && !p->objs) {
+ for (i = 0; mf_name[i] != NULL; i++) {
+ sprintf(path, "%s/%s", p->srcdir, mf_name[i]);
+ printf("*** Trying to find %s\n", path);
+ if (is_nonempty_file(path)) {
+ fillin_program_objs(p, path);
+ break;
+ }
+ }
+ }
+
+
+
if(!p->objpaths && p->objdir && p->objs)
for(s = p->objs; s != NULL; s = s->next) {