[hackers] [sbase] Make build process more verbose || sin

From: <git_AT_suckless.org>
Date: Mon, 17 Nov 2014 11:37:05 +0100

commit 9a9d6bb0dcd8a9e81e52e192ee60971356b4447a
Author: sin <sin_AT_2f30.org>
Date: Mon Nov 17 10:15:44 2014 +0000

    Make build process more verbose

diff --git a/Makefile b/Makefile
index 575f31b..4b43811 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -134,62 +134,51 @@ bin: $(BIN)
 $(OBJ): $(HDR) config.mk
 
 .o:
- _AT_echo LD $@
- _AT_$(LD) -o $@ $< util.a $(LDFLAGS)
+ $(LD) -o $_AT_ $< util.a $(LDFLAGS)
 
 .c.o:
- _AT_echo CC $<
- _AT_$(CC) -c -o $@ $< $(CFLAGS)
+ $(CC) $(CFLAGS) -o $_AT_ -c $<
 
 util.a: $(LIB)
- _AT_echo AR $@
- _AT_$(AR) -r -c $@ $?
- _AT_ranlib $@
+ $(AR) -r -c $_AT_ $?
+ ranlib $_AT_
 
 install: all
- _AT_echo installing executables to $(DESTDIR)$(PREFIX)/bin
- _AT_mkdir -p $(DESTDIR)$(PREFIX)/bin
- _AT_cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
- _AT_cd $(DESTDIR)$(PREFIX)/bin && chmod 755 $(BIN)
- _AT_echo installing manual pages to $(DESTDIR)$(MANPREFIX)/man1
- _AT_mkdir -p $(DESTDIR)$(MANPREFIX)/man1
- _AT_for m in $(MAN); do sed "s/VERSION/$(VERSION)/g" < "$$m" > $(DESTDIR)$(MANPREFIX)/man1/"$$m"; done
- _AT_cd $(DESTDIR)$(MANPREFIX)/man1 && chmod 644 $(MAN)
+ mkdir -p $(DESTDIR)$(PREFIX)/bin
+ cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
+ cd $(DESTDIR)$(PREFIX)/bin && chmod 755 $(BIN)
+ mkdir -p $(DESTDIR)$(MANPREFIX)/man1
+ for m in $(MAN); do sed "s/VERSION/$(VERSION)/g" < "$$m" > $(DESTDIR)$(MANPREFIX)/man1/"$$m"; done
+ cd $(DESTDIR)$(MANPREFIX)/man1 && chmod 644 $(MAN)
 
 uninstall:
- _AT_echo removing executables from $(DESTDIR)$(PREFIX)/bin
- _AT_cd $(DESTDIR)$(PREFIX)/bin && rm -f $(BIN)
- _AT_echo removing manual pages from $(DESTDIR)$(MANPREFIX)/man1
- _AT_cd $(DESTDIR)$(MANPREFIX)/man1 && rm -f $(MAN)
+ cd $(DESTDIR)$(PREFIX)/bin && rm -f $(BIN)
+ cd $(DESTDIR)$(MANPREFIX)/man1 && rm -f $(MAN)
 
 dist: clean
- _AT_echo creating dist tarball
- _AT_mkdir -p sbase-$(VERSION)
- _AT_cp -r LICENSE Makefile README TODO config.mk $(SRC) $(MAN) util $(HDR) sbase-$(VERSION)
- _AT_tar -cf sbase-$(VERSION).tar sbase-$(VERSION)
- _AT_gzip sbase-$(VERSION).tar
- _AT_rm -rf sbase-$(VERSION)
+ mkdir -p sbase-$(VERSION)
+ cp -r LICENSE Makefile README TODO config.mk $(SRC) $(MAN) util $(HDR) sbase-$(VERSION)
+ tar -cf sbase-$(VERSION).tar sbase-$(VERSION)
+ gzip sbase-$(VERSION).tar
+ rm -rf sbase-$(VERSION)
 
 sbase-box: $(SRC) util.a
- _AT_echo creating box binary
- _AT_mkdir -p build
- _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(!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`\")) return `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
- _AT_echo "putchar(0xa); }; return 0; }" >> build/$@.c
- _AT_echo LD $@
- _AT_$(LD) -o $@ build/*.c util.a $(CFLAGS) $(LDFLAGS)
- _AT_rm -r build
+ mkdir -p build
+ cp $(HDR) build
+ for f in $(SRC); do sed "s/^main(/`basename $$f .c`_&/" < $$f > build/$$f; done
+ echo '#include <libgen.h>' > build/$_AT_.c
+ echo '#include <stdio.h>' >> build/$_AT_.c
+ echo '#include <stdlib.h>' >> build/$_AT_.c
+ echo '#include <string.h>' >> build/$_AT_.c
+ 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
+ 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
+ for f in $(SRC); do echo "printf(\"`basename $$f .c`\"); putchar(' ');" >> build/$_AT_.c; done
+ echo "putchar(0xa); }; return 0; }" >> build/$_AT_.c
+ $(LD) -o $_AT_ build/*.c util.a $(CFLAGS) $(LDFLAGS)
+ rm -r build
 
 clean:
- _AT_echo cleaning
         _AT_rm -f $(BIN) $(OBJ) $(LIB) util.a sbase-box sbase-$(VERSION).tar.gz
diff --git a/config.mk b/config.mk
index c605648..71f4195 100644
--- a/config.mk
+++ b/config.mk
_AT_@ -9,11 +9,5 @@ MANPREFIX = $(PREFIX)/share/man
 #CC = musl-gcc
 LD = $(CC)
 CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE
-CFLAGS = -g -std=c99 -Wall -pedantic $(CPPFLAGS)
-LDFLAGS = -g
-
-#CC = tcc
-#LD = $(CC)
-#CPPFLAGS = -D_POSIX_C_SOURCE=200112L
-#CFLAGS = -Os -Wall $(CPPFLAGS) -D_GNU_SOURCE
-#LDFLAGS =
+CFLAGS = -std=c99 -Wall -pedantic $(CPPFLAGS)
+LDFLAGS = -s
Received on Mon Nov 17 2014 - 11:37:05 CET

This archive was generated by hypermail 2.3.0 : Mon Nov 17 2014 - 11:48:11 CET