[hackers] [sbase] Allow sbase-box to be called as sbase-box tool args... || sin
commit cabbf6141e68879eb4bac39df132d0d3de43afec
Author: sin <sin_AT_2f30.org>
Date: Tue Oct 8 23:32:29 2013 +0100
Allow sbase-box to be called as sbase-box tool args...
diff --git a/Makefile b/Makefile
index ce7d95a..1cd6fbb 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -156,7 +156,7 @@ sbase-box: $(SRC) util.a
_AT_echo '#include <string.h>' >> build/$@.c
_AT_echo '#include "util.h"' >> build/$@.c
_AT_for f in $(SRC); do echo "int `basename $$f .c`_main(int, char **);" >> build/$@.c; done
- _AT_echo 'int main(int argc, char *argv[]) { char *s = basename(argv[0]); if(0) ;' >> build/$@.c
+ _AT_echo 'int main(int argc, char *argv[]) { char *s = basename(argv[0]); if(!strcmp(s,"sbase-box")) { argc--; argv++; s = basename(argv[0]); } if(0) ;' >> build/$@.c
_AT_for f in $(SRC); do echo "else if(!strcmp(s, \"`basename $$f .c`\")) `basename $$f .c`_main(argc, argv);" >> build/$@.c; done
_AT_echo 'else {' >> build/$@.c
_AT_for f in $(SRC); do echo "printf(\"`basename $$f .c`\"); putchar(' ');" >> build/$@.c; done
Received on Wed Oct 09 2013 - 00:34:58 CEST
This archive was generated by hypermail 2.3.0
: Wed Oct 09 2013 - 00:36:18 CEST