From 324186166c778e5587717b2428793d4d29a386b6 Mon Sep 17 00:00:00 2001 From: Jared Hance Date: Thu, 13 Nov 2014 18:33:46 -0500 Subject: [PATCH] Majorly unscrew the build system --- .d/.gitignore | 1 + .d/f/.gitignore | 0 .d/j/a/.gitignore | 0 .d/j/b/.gitignore | 0 .d/j/c/.gitignore | 0 .d/j/d/.gitignore | 0 .d/j/e/.gitignore | 0 .d/j/f/.gitignore | 0 .d/n/.gitignore | 0 .d/outside/jhttp/.gitignore | 0 .d/v/.gitignore | 0 .gitignore | 2 ++ Makefile | 37 ++++++++++++++++++++++++++++++++++--- 13 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 .d/.gitignore create mode 100644 .d/f/.gitignore create mode 100644 .d/j/a/.gitignore create mode 100644 .d/j/b/.gitignore create mode 100644 .d/j/c/.gitignore create mode 100644 .d/j/d/.gitignore create mode 100644 .d/j/e/.gitignore create mode 100644 .d/j/f/.gitignore create mode 100644 .d/n/.gitignore create mode 100644 .d/outside/jhttp/.gitignore create mode 100644 .d/v/.gitignore diff --git a/.d/.gitignore b/.d/.gitignore new file mode 100644 index 000000000..21af5d669 --- /dev/null +++ b/.d/.gitignore @@ -0,0 +1 @@ +**.d diff --git a/.d/f/.gitignore b/.d/f/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/.d/j/a/.gitignore b/.d/j/a/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/.d/j/b/.gitignore b/.d/j/b/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/.d/j/c/.gitignore b/.d/j/c/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/.d/j/d/.gitignore b/.d/j/d/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/.d/j/e/.gitignore b/.d/j/e/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/.d/j/f/.gitignore b/.d/j/f/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/.d/n/.gitignore b/.d/n/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/.d/outside/jhttp/.gitignore b/.d/outside/jhttp/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/.d/v/.gitignore b/.d/v/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/.gitignore b/.gitignore index 5d4818d1d..70e61a4f0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ /outside/re2/obj /inst /vere.pkg +/.MAKEFILE-VERSION +/make.conf diff --git a/Makefile b/Makefile index 6e0770f39..c137c5f50 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,11 @@ # linux # osx +default: all +-include make.conf + +CORE=.MAKEFILE-VERSION + UNAME=$(shell uname) ifeq ($(UNAME),Darwin) OS=osx @@ -75,8 +80,16 @@ CFLAGS= $(COSFLAGS) -O3 -msse3 -ffast-math \ CWFLAGS=-Wall -.c.o: - $(CC) -c $(CWFLAGS) $(CFLAGS) -o $@ $< +ifdef NO_SILENT_RULES +%.o: %.c $(CORE) + $(CC) -c $(CWFLAGS) $(CFLAGS) -o $@ $< + @$(CC) -MM -MP $(CWFLAGS) $(CFLAGS) -MT $@ $< -MF .d/$*.d +else +%.o: %.c $(CORE) + @echo " CC $@" + @$(CC) -c $(CWFLAGS) $(CFLAGS) -o $@ $< + @$(CC) -MM -MP $(CWFLAGS) $(CFLAGS) -MT $@ $< -MF .d/$*.d +endif N_OFILES=\ n/a.o \ @@ -288,6 +301,10 @@ MEME_OFILES=\ $(BASE_OFILES) \ $(MEME_FILE) +VERE_DFILES=$(VERE_OFILES:%.o=.d/%.d) + +-include $(VERE_DFILES) + # This is a silly hack necessitated by the fact that libuv uses configure # # * Making 'all' obviously requires outside/libuv, @@ -315,6 +332,13 @@ LIBANACHRONISM=outside/anachronism/build/libanachronism.a all: vere +.MAKEFILE-VERSION: Makefile make.conf + @echo "Makefile update." + @touch .MAKEFILE-VERSION + +make.conf: + @echo "# Set custom configuration here, please!" > "make.conf" + vere: $(BIN)/vere meme: $(BIN)/meme @@ -338,9 +362,16 @@ $(CRE2_OFILES): outside/cre2/src/src/cre2.cpp outside/cre2/src/src/cre2.h $(LIBR $(V_OFILES): i/v/vere.h +ifdef NO_SILENT_RULES $(BIN)/vere: $(LIBCRE) $(VERE_OFILES) $(LIBUV) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) mkdir -p $(BIN) $(CLD) $(CLDOSFLAGS) -o $(BIN)/vere $(VERE_OFILES) $(LIBUV) $(LIBCRE) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBS) +else +$(BIN)/vere: $(LIBCRE) $(VERE_OFILES) $(LIBUV) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) + @echo " CCLD $(BIN)/vere" + @mkdir -p $(BIN) + @$(CLD) $(CLDOSFLAGS) -o $(BIN)/vere $(VERE_OFILES) $(LIBUV) $(LIBCRE) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBS) +endif $(BIN)/meme: $(LIBCRE) $(MEME_OFILES) $(LIBUV) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) mkdir -p $(BIN) @@ -372,7 +403,7 @@ debinstall: cp -R urb/zod $(DESTDIR)/usr/share/urb clean: - $(RM) $(VERE_OFILES) $(BIN)/vere vere.pkg + $(RM) $(VERE_OFILES) $(BIN)/vere vere.pkg $(VERE_DFILES) distclean: clean $(LIBUV_MAKEFILE) $(MAKE) -C outside/libuv_0.11 distclean