Makefile
changeset 2792 b04a77d57628
parent 2779 0058526344b9
child 2800 4ab0cd77edf1
equal deleted inserted replaced
2791:ec219f29901b 2792:b04a77d57628
   976 
   976 
   977 
   977 
   978 ### Internal build rules
   978 ### Internal build rules
   979 
   979 
   980 # This makes sure the .deps dir is always around.
   980 # This makes sure the .deps dir is always around.
   981 DEPS_MAGIC := $(shell mkdir -p .deps .deps/music .deps/sound .deps/video .deps/os .deps/os/macosx .deps/ai/default .deps/ai/trolly)
   981 DEPS_MAGIC := $(shell mkdir -p $(sort $(dir $(DEPS))))
       
   982 
       
   983 depend:
       
   984 	@true # The include handles this automagically
   982 
   985 
   983 # Introduce the dependencies
   986 # Introduce the dependencies
   984 ifneq ($(MAKECMDGOALS), clean)
   987 ifeq ($(findstring $(MAKECMDGOALS), clean info),)
   985 -include $(DEPS)
   988 -include $(DEPS)
   986 endif
   989 endif
   987 
   990 
   988 %.o: .deps/%.d
   991 # Silence stale header dependency errors
       
   992 %.h:
       
   993 	@true
   989 
   994 
   990 .deps/%.d: %.c $(MAKE_CONFIG) table/strings.h endian_target.h
   995 .deps/%.d: %.c $(MAKE_CONFIG) table/strings.h endian_target.h
   991 	@echo '===> Determining dependencies of $<'
   996 	@echo '===> DEP $<'
   992 	$(Q)$(CC) $(CFLAGS) $(CDEFS) -MM $< > $@
   997 	$(Q)$(CC) $(CFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:.deps/%.d=%.o):#' > $@
   993 
   998 
   994 .deps/%.d: %.cpp $(MAKE_CONFIG) table/strings.h endian_target.h
   999 .deps/%.d: %.cpp $(MAKE_CONFIG) table/strings.h endian_target.h
   995 	@echo '===> Determining dependencies of $<'
  1000 	@echo '===> DEP $<'
   996 	$(Q)$(CXX) $(CFLAGS) $(CDEFS) -MM $< > $@
  1001 	$(Q)$(CXX) $(CXXFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:.deps/%.d=%.o):#' > $@
   997 
  1002 
   998 .deps/%.d: %.m $(MAKE_CONFIG) table/strings.h endian_target.h
  1003 .deps/%.d: %.m $(MAKE_CONFIG) table/strings.h endian_target.h
   999 	@echo '===> Determining dependencies of $<'
  1004 	@echo '===> DEP $<'
  1000 	$(Q)$(CC) $(CFLAGS) $(CDEFS) -MM $< > $@
  1005 	$(Q)$(CC) $(OBJCFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:.deps/%.d=%.o):#' > $@
  1001 
  1006 
  1002 
  1007 
  1003 %.o: %.c $(MAKE_CONFIG)
  1008 %.o: %.c $(MAKE_CONFIG)
  1004 	@echo '===> Compiling $<'
  1009 	@echo '===> Compiling $<'
  1005 	$(Q)$(CC) $(CFLAGS) $(CDEFS) -c -o $@ $<
  1010 	$(Q)$(CC) $(CFLAGS) $(CDEFS) -c -o $@ $<