From 73c67a814dfe0a305f2173f5e49f2c27169133b6 Mon Sep 17 00:00:00 2001 From: dongresource Date: Mon, 31 Aug 2020 18:10:01 +0200 Subject: [PATCH] Fix checking of header timestamps. This is implemented in such a way that a change in one of our headers won't cause recompilation of large C dependancies. It's a bit hacky, but it works. --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3d99232..93a8e06 100644 --- a/Makefile +++ b/Makefile @@ -89,6 +89,8 @@ CXXOBJ=$(CXXSRC:.cpp=.o) OBJ=$(COBJ) $(CXXOBJ) +HDR=$(CHDR) $(CXXHDR) + all: $(SERVER) windows: $(SERVER) @@ -103,12 +105,15 @@ windows : SERVER=$(WIN_SERVER) .SUFFIX: .o .c .cpp .h .hpp -.c.o: $(CHDR) +.c.o: $(CC) -c $(CFLAGS) -o $@ $< -.cpp.o: $(CXXHDR) +.cpp.o: $(CXX) -c $(CXXFLAGS) -o $@ $< +# header timestamps are a prerequisite for OF object files +$(CXXOBJ): $(CXXHDR) + $(SERVER): $(OBJ) $(CHDR) $(CXXHDR) mkdir -p bin $(CXX) $(OBJ) $(LDFLAGS) -o $(SERVER)