Allow ubase-box to be called as ubase-box tool args...

This commit is contained in:
sin 2013-10-08 23:32:29 +01:00
parent 7078dba42d
commit 040ec4039c
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ ubase-box: $(SRC) util.a
@echo '#include <string.h>' >> build/$@.c @echo '#include <string.h>' >> build/$@.c
@echo '#include "util.h"' >> build/$@.c @echo '#include "util.h"' >> build/$@.c
@for f in $(SRC); do echo "int `basename $$f .c`_main(int, char **);" >> build/$@.c; done @for f in $(SRC); do echo "int `basename $$f .c`_main(int, char **);" >> build/$@.c; done
@echo 'int main(int argc, char *argv[]) { char *s = basename(argv[0]); if(0) ;' >> build/$@.c @echo 'int main(int argc, char *argv[]) { char *s = basename(argv[0]); if(!strcmp(s,"ubase-box")) { argc--; argv++; s = basename(argv[0]); } if(0) ;' >> build/$@.c
@for f in $(SRC); do echo "else if(!strcmp(s, \"`basename $$f .c`\")) `basename $$f .c`_main(argc, argv);" >> build/$@.c; done @for f in $(SRC); do echo "else if(!strcmp(s, \"`basename $$f .c`\")) `basename $$f .c`_main(argc, argv);" >> build/$@.c; done
@echo 'else {' >> build/$@.c @echo 'else {' >> build/$@.c
@for f in $(SRC); do echo "printf(\"`basename $$f .c`\"); putchar(' ');" >> build/$@.c; done @for f in $(SRC); do echo "printf(\"`basename $$f .c`\"); putchar(' ');" >> build/$@.c; done