Add a '-l' option, which lists the argv[0]'s we will respond to. This will

simplify the src/release Makefile quite a bit.
This commit is contained in:
Poul-Henning Kamp 1995-02-25 07:25:31 +00:00
parent 286e9a77d2
commit fb7f926e3d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6696
2 changed files with 16 additions and 3 deletions

View File

@ -31,7 +31,7 @@
.Nd generates build environment for a crunched binary
.Sh SYNOPSIS
.Nm \&crunchgen
.Op Fl fq
.Op Fl fql
.Op Fl m Ar makefile-name
.Op Fl c Ar c-file-name
.Op Fl e Ar exec-file-name
@ -86,6 +86,8 @@ Set crunched binary executable file name to
The default name is ``<conf-name>''.
.It Fl f
Flush cache. Forces the recalculation of cached parameters.
.It Fl l
List names. Lists the names this binary will respond to.
.It Fl m Ar makefile-name
Set output Makefile name to
.Ar makefile-name .

View File

@ -86,6 +86,8 @@ char *pname = "crunchgen";
int verbose, readcache; /* options */
int reading_cache;
int list_mode;
/* general library routines */
void status(char *str);
@ -114,7 +116,7 @@ int main(int argc, char **argv)
if(argc > 0) pname = argv[0];
while((optc = getopt(argc, argv, "m:c:e:fq")) != -1) {
while((optc = getopt(argc, argv, "lm:c:e:fq")) != -1) {
switch(optc) {
case 'f': readcache = 0; break;
case 'q': verbose = 0; break;
@ -122,6 +124,7 @@ int main(int argc, char **argv)
case 'm': strcpy(outmkname, optarg); break;
case 'c': strcpy(outcfname, optarg); break;
case 'e': strcpy(execfname, optarg); break;
case 'l': list_mode++; verbose = 0; break;
case '?':
default: usage();
@ -157,6 +160,9 @@ int main(int argc, char **argv)
}
parse_conf_file();
if (list_mode)
exit(goterror);
gen_outputs();
exit(goterror);
@ -323,6 +329,8 @@ void add_prog(char *progname)
p2->ident = p2->srcdir = p2->objdir = NULL;
p2->links = p2->objs = NULL;
p2->goterror = 0;
if (list_mode)
printf("%s\n",progname);
}
@ -338,8 +346,11 @@ void add_link(int argc, char **argv)
goterror = 1;
return;
}
for(i=2;i<argc;i++)
for(i=2;i<argc;i++) {
if (list_mode)
printf("%s\n",argv[i]);
add_string(&p->links, argv[i]);
}
}