Makefile
changeset 1170 1cd3103acd66
parent 1169 30e8657f61d0
child 1211 6f2f723e5c36
equal deleted inserted replaced
1169:30e8657f61d0 1170:1cd3103acd66
   665 
   665 
   666 ifdef WITH_DIRECTMUSIC
   666 ifdef WITH_DIRECTMUSIC
   667 CXX_SOURCES += w32dm2.cpp
   667 CXX_SOURCES += w32dm2.cpp
   668 endif
   668 endif
   669 
   669 
   670 DEPS1 = $(foreach obj,$(OBJS),.deps/$(obj))
   670 DEPS = $(OBJS:%.o=.deps/%.d)
   671 DEPS = $(DEPS1:%.o=%.P)
       
   672 
   671 
   673 LANG_TXT = $(filter-out %.unfinished.txt,$(wildcard lang/*.txt))
   672 LANG_TXT = $(filter-out %.unfinished.txt,$(wildcard lang/*.txt))
   674 LANGS = $(LANG_TXT:%.txt=%.lng)
   673 LANGS = $(LANG_TXT:%.txt=%.lng)
   675 
   674 
   676 
   675 
   910 # This compiles the object file as well as silently updating its dependencies
   909 # This compiles the object file as well as silently updating its dependencies
   911 # list at the same time. It is not an issue that they aren't around during the
   910 # list at the same time. It is not an issue that they aren't around during the
   912 # first compilation round as we just build everything at that time anyway,
   911 # first compilation round as we just build everything at that time anyway,
   913 # therefore we do not need to watch deps.
   912 # therefore we do not need to watch deps.
   914 
   913 
   915 
       
   916 %.o: %.c $(MAKE_CONFIG) endian.h table/strings.h
   914 %.o: %.c $(MAKE_CONFIG) endian.h table/strings.h
   917 	@echo '===> Compiling $<'
   915 	@echo '===> Compiling $<'
   918 	@$(CC) $(CFLAGS) $(CDEFS) -Wp,-MD,.deps/$(*F).pp -c $< -o $@
   916 	@$(CC) $(CFLAGS) $(CDEFS) -MD -c $< -o $@
   919 	@-cp .deps/$(*F).pp .deps/$(*F).P; \
   917 	@mv $(<:%.c=%.d) $(<:%.c=.deps/%.d)
   920 		tr ' ' '\012' < .deps/$(*F).pp \
   918 
   921 		| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
       
   922 		>> .deps/$(*F).P; \
       
   923 	rm .deps/$(*F).pp
       
   924 
       
   925 # For DirectMusic build and BeOS specific parts
       
   926 %.o: %.cpp  $(MAKE_CONFIG) endian.h table/strings.h
   919 %.o: %.cpp  $(MAKE_CONFIG) endian.h table/strings.h
   927 	@echo '===> Compiling $<'
   920 	@echo '===> Compiling $<'
   928 	@$(CXX) $(CFLAGS) $(CDEFS) -c $< -o $@
   921 	@$(CXX) $(CFLAGS) $(CDEFS) -MD -c $< -o $@
       
   922 	@mv $(<:%.c=%.d) $(<:%.c=.deps/%.d)
       
   923 
       
   924 # Silence stale header dependencies
       
   925 %.h:
       
   926 	@true
   929 
   927 
   930 
   928 
   931 info:
   929 info:
   932 	@echo 'CFLAGS  = $(CFLAGS)'
   930 	@echo 'CFLAGS  = $(CFLAGS)'
   933 	@echo 'LDFLAGS = $(LDFLAGS)'
   931 	@echo 'LDFLAGS = $(LDFLAGS)'