sbase

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

commit 9048b542c773d24630c03fd7cc58777ad1c51df4
parent b7c2bbc6dbbe16136a7cf00be3329a77b0b65e4a
Author: Evan Gates <evan.gates@gmail.com>
Date:   Fri Feb 20 13:55:45 -0800

align redirections in Makefile for readability

Diffstat:
Makefile | 26+++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/Makefile b/Makefile @@ -200,19 +200,19 @@ sbase-box: $(LIB) $(SRC) mkdir -p build cp $(HDR) build for f in $(SRC); do sed "s/^main(/$${f%.c}_&/" < $$f > build/$$f; done - echo '#include <libgen.h>' > build/$@.c - echo '#include <stdio.h>' >> build/$@.c - echo '#include <stdlib.h>' >> build/$@.c - echo '#include <string.h>' >> build/$@.c - echo '#include "util.h"' >> build/$@.c - for f in $(SRC); do echo "int $${f%.c}_main(int, char **);" >> build/$@.c; done - 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 - echo "else if (!strcmp(s, \"[\")) return test_main(argc, argv);" >> build/$@.c - for f in $(SRC); do echo "else if(!strcmp(s, \"$${f%.c}\")) return $${f%.c}_main(argc, argv);" >> build/$@.c; done - echo 'else {' >> build/$@.c - echo "fputs(\"[ \", stdout);" >> build/$@.c - for f in $(SRC); do echo "fputs(\"$${f%.c} \", stdout);" >> build/$@.c; done - echo "putchar(0xa); }; return 0; }" >> build/$@.c + echo '#include <libgen.h>' > build/$@.c + echo '#include <stdio.h>' >> build/$@.c + echo '#include <stdlib.h>' >> build/$@.c + echo '#include <string.h>' >> build/$@.c + echo '#include "util.h"' >> build/$@.c + for f in $(SRC); do echo "int $${f%.c}_main(int, char **);"; done >> build/$@.c + echo 'int main(int argc, char *argv[]) { char *s = basename(argv[0]);' >> build/$@.c + echo 'if(!strcmp(s,"sbase-box")) { argc--; argv++; s = basename(argv[0]); } if(0) ;' >> build/$@.c + echo "else if (!strcmp(s, \"[\")) return test_main(argc, argv);" >> build/$@.c + for f in $(SRC); do echo "else if(!strcmp(s, \"$${f%.c}\")) return $${f%.c}_main(argc, argv);"; done >> build/$@.c + echo 'else { fputs("[ ", stdout);' >> build/$@.c + for f in $(SRC); do echo "fputs(\"$${f%.c} \", stdout);"; done >> build/$@.c + echo 'putchar(0xa); }; return 0; }' >> build/$@.c $(LD) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ build/*.c $(LIB) rm -r build