[hackers] [sbase] Print the available targets for sbase-box || sin
commit 87cde4bcb261ad086e732a2d55521cdb035e15eb
Author: sin <sin_AT_2f30.org>
Date: Thu Aug 15 16:46:46 2013 +0100
Print the available targets for sbase-box
diff --git a/Makefile b/Makefile
index 2e31f33..144865c 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -146,13 +146,16 @@ sbase-box: $(SRC) util.a
_AT_cp $(HDR) build
_AT_for f in $(SRC); do sed "s/^main(/`basename $$f .c`_&/" < $$f > build/$$f; done
_AT_echo '#include <libgen.h>' > build/$@.c
+ _AT_echo '#include <stdio.h>' >> build/$@.c
_AT_echo '#include <stdlib.h>' >> build/$@.c
_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_for f in $(SRC); do echo "else if(!strcmp(s, \"`basename $$f .c`\")) `basename $$f .c`_main(argc, argv);" >> build/$@.c; done
- _AT_printf 'else eprintf("%%s: unknown program\n", s); return EXIT_SUCCESS; }
' >> build/$_AT_.c
+ _AT_echo 'else {' >> build/$@.c
+ _AT_for f in $(SRC); do echo "printf(\"`basename $$f .c`\"); putchar(' ');" >> build/$@.c; done
+ _AT_echo "putchar(0xa); }; return EXIT_SUCCESS; }" >> build/$@.c
_AT_echo LD $@
_AT_$(LD) -o $@ build/*.c util.a $(CFLAGS) $(LDFLAGS)
_AT_rm -r build
Received on Sat Oct 05 2013 - 16:29:18 CEST
This archive was generated by hypermail 2.3.0
: Sat Oct 05 2013 - 16:36:21 CEST