From 040ec4039c81c07e15f77186ca2e22a70d467f54 Mon Sep 17 00:00:00 2001 From: sin Date: Tue, 8 Oct 2013 23:32:29 +0100 Subject: [PATCH] Allow ubase-box to be called as ubase-box tool args... --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8f65fbd..3a670c6 100644 --- a/Makefile +++ b/Makefile @@ -111,7 +111,7 @@ ubase-box: $(SRC) util.a @echo '#include ' >> build/$@.c @echo '#include "util.h"' >> build/$@.c @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 @echo 'else {' >> build/$@.c @for f in $(SRC); do echo "printf(\"`basename $$f .c`\"); putchar(' ');" >> build/$@.c; done