From f07251625db80833714a856d5e374fbdbcbc4bd1 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 21 Feb 2012 12:07:08 +0000 Subject: Revised GNUmakefile for header file dependencies (again; this time it should work ;) git-svn-id: http://mc-server.googlecode.com/svn/trunk@300 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- GNUmakefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index b7aa7ea9b..5353f19a0 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,8 +1,7 @@ ################################################### # # Makefile for MCServer -# Creator ZFalt -# Created: [Thu Feb 24 19:53:17 2011] +# Creator: tedik # ################################################### # @@ -64,7 +63,7 @@ SOURCES := $(filter-out %minigzip.c %lua.c %tolua.c %toluabind.c %LeakFinder.cpp OBJECTS := $(patsubst %.c,$(BUILDDIR)%.o,$(SOURCES)) OBJECTS := $(patsubst %.cpp,$(BUILDDIR)%.o,$(OBJECTS)) --include $(OBJECTS:.o=.d) +-include $(patsubst %.o,%.d,$(OBJECTS)) MCServer : $(OBJECTS) $(CC) $(LNK_OPTIONS) $(OBJECTS) -o MCServer @@ -84,7 +83,7 @@ $(BUILDDIR)%.o: %.c $(CC) $(CCE_OPTIONS) -c $(INCLUDE) $< -o $@ @$(CC) $(CC_OPTIONS) -MM $(INCLUDE) $< > $(patsubst %.o,%.d,$@) @mv -f $(patsubst %.o,%.d,$@) $(patsubst %.o,%.d,$@).tmp - @sed -e 's|.*:|$*.o:|' < $(patsubst %.o,%.d,$@).tmp > $(patsubst %.o,%.d,$@) + @sed -e "s|.*:|$(BUILDDIR)$*.o:|" < $(patsubst %.o,%.d,$@).tmp > $(patsubst %.o,%.d,$@) @sed -e 's/.*://' -e 's/\\$$//' < $(patsubst %.o,%.d,$@).tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $(patsubst %.o,%.d,$@) @rm -f $(patsubst %.o,%.d,$@).tmp @@ -93,6 +92,6 @@ $(BUILDDIR)%.o: %.cpp $(CC) $(CC_OPTIONS) -c $(INCLUDE) $< -o $@ @$(CC) $(CC_OPTIONS) -MM $(INCLUDE) $< > $(patsubst %.o,%.d,$@) @mv -f $(patsubst %.o,%.d,$@) $(patsubst %.o,%.d,$@).tmp - @sed -e 's|.*:|$*.o:|' < $(patsubst %.o,%.d,$@).tmp > $(patsubst %.o,%.d,$@) + @sed -e "s|.*:|$(BUILDDIR)$*.o:|" < $(patsubst %.o,%.d,$@).tmp > $(patsubst %.o,%.d,$@) @sed -e 's/.*://' -e 's/\\$$//' < $(patsubst %.o,%.d,$@).tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $(patsubst %.o,%.d,$@) @rm -f $(patsubst %.o,%.d,$@).tmp -- cgit v1.2.3