[hackers] [sbase] add [ alias for test || Evan Gates
commit 179b32fe51ad53397d9d331c87f77d6e4009bef5
Author: Evan Gates <evan.gates_AT_gmail.com>
Date: Fri Feb 20 12:08:13 2015 -0800
add [ alias for test
diff --git a/Makefile b/Makefile
index 124bfa4..4665605 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -180,7 +180,7 @@ $(LIBUTIL): $(LIBUTILOBJ)
install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
- cd $(DESTDIR)$(PREFIX)/bin && chmod 755 $(BIN)
+ cd $(DESTDIR)$(PREFIX)/bin && ln -f test [ && chmod 755 $(BIN)
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
for m in $(MAN); do sed "s/^\.Os sbase/.Os sbase $(VERSION)/g" < "$$m" > $(DESTDIR)$(MANPREFIX)/man1/"$$m"; done
cd $(DESTDIR)$(MANPREFIX)/man1 && chmod 644 $(MAN)
_AT_@ -207,8 +207,10 @@ sbase-box: $(LIB) $(SRC)
echo '#include "util.h"' >> build/$_AT_.c
for f in $(SRC); do echo "int `basename $$f .c`_main(int, char **);" >> build/$_AT_.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/$_AT_.c
+ echo "else if (!strcmp(s, \"[\")) return test_main(argc, argv);" >> build/$_AT_.c
for f in $(SRC); do echo "else if(!strcmp(s, \"`basename $$f .c`\")) return `basename $$f .c`_main(argc, argv);" >> build/$_AT_.c; done
echo 'else {' >> build/$_AT_.c
+ echo "printf(\"[\"); putchar(' ');" >> build/$_AT_.c
for f in $(SRC); do echo "printf(\"`basename $$f .c`\"); putchar(' ');" >> build/$_AT_.c; done
echo "putchar(0xa); }; return 0; }" >> build/$_AT_.c
$(LD) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $_AT_ build/*.c $(LIB)
Received on Sat Feb 21 2015 - 10:33:30 CET
This archive was generated by hypermail 2.3.0
: Sat Feb 21 2015 - 10:36:31 CET