sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit cabbf6141e68879eb4bac39df132d0d3de43afec
parent 576a5ce55ed18bb8617b9d9dac11f8b6cdc0db1d
Author: sin <sin@2f30.org>
Date:   Tue,  8 Oct 2013 23:32:29 +0100

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

Diffstat:
MMakefile | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile @@ -156,7 +156,7 @@ sbase-box: $(SRC) util.a @echo '#include <string.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 - @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,"sbase-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