Makefile
changeset 1721 e2887b445ac0
parent 1720 8f64ceed5778
child 1722 f0ca3514f746
equal deleted inserted replaced
1720:8f64ceed5778 1721:e2887b445ac0
   776 OSX:=OSX
   776 OSX:=OSX
   777 OSX_MIDI_PLAYER_FILE:=os/macosx/OpenTTDMidi.class
   777 OSX_MIDI_PLAYER_FILE:=os/macosx/OpenTTDMidi.class
   778 endif
   778 endif
   779 
   779 
   780 
   780 
   781 all: endian.h $(UPDATECONFIG) $(LANGS) $(TTD) $(OSX) $(endwarnings)
   781 all: endian_target.h endian_host.h $(UPDATECONFIG) $(LANGS) $(TTD) $(OSX) $(endwarnings)
   782 
   782 
   783 endian.h: $(ENDIAN_CHECK)
   783 endian_host.h: $(ENDIAN_CHECK)
   784 	@echo '===> Testing endianness'
   784 	@echo '===> Testing endianness for host'
       
   785 	$(Q)./$(ENDIAN_CHECK) > $@
       
   786 
       
   787 endian_target.h: $(ENDIAN_CHECK)
       
   788 	@echo '===> Testing endianness for target'
   785 	$(Q)./$(ENDIAN_CHECK) $(ENDIAN_FORCE) > $@
   789 	$(Q)./$(ENDIAN_CHECK) $(ENDIAN_FORCE) > $@
   786 
   790 
   787 $(ENDIAN_CHECK): endian_check.c
   791 $(ENDIAN_CHECK): endian_check.c
   788 	$(call cmd,compile_link)
   792 	$(call cmd,compile_link)
   789 
   793 
   812 
   816 
   813 $(64_bit_warnings):
   817 $(64_bit_warnings):
   814 	$(warning 64 bit CPUs will get some 64 bit specific bugs!)
   818 	$(warning 64 bit CPUs will get some 64 bit specific bugs!)
   815 	$(warning If you see any bugs, include in your bug report that you use a 64 bit CPU)
   819 	$(warning If you see any bugs, include in your bug report that you use a 64 bit CPU)
   816 
   820 
   817 $(STRGEN): strgen/strgen.c endian.h
   821 $(STRGEN): strgen/strgen.c endian_host.h
   818 	$(call cmd,compile_link)
   822 	$(call cmd,compile_link)
   819 
   823 
   820 table/strings.h: lang/english.txt $(STRGEN)
   824 table/strings.h: lang/english.txt $(STRGEN)
   821 	@echo '===> Generating $@'
   825 	@echo '===> Generating $@'
   822 	$(Q)$(STRGEN)
   826 	$(Q)$(STRGEN)
   917 FORCE:
   921 FORCE:
   918 
   922 
   919 
   923 
   920 clean:
   924 clean:
   921 	@echo '===> Cleaning up'
   925 	@echo '===> Cleaning up'
   922 	$(Q)rm -rf .deps *~ $(TTD) $(STRGEN) core table/strings.h $(LANGS) $(OBJS) $(OSX_MIDI_PLAYER_FILE) endian.h $(ENDIAN_CHECK)
   926 # endian.h is out-dated and no longer in use, so it can be removed soon
       
   927 	$(Q)rm -rf .deps *~ $(TTD) $(STRGEN) core table/strings.h $(LANGS) $(OBJS) $(OSX_MIDI_PLAYER_FILE) endian.h endian_host.h endian_target.h $(ENDIAN_CHECK)
   923 
   928 
   924 mrproper: clean
   929 mrproper: clean
   925 	$(Q)rm -rf $(MAKE_CONFIG)
   930 	$(Q)rm -rf $(MAKE_CONFIG)
   926 
   931 
   927 ifndef OSX
   932 ifndef OSX
   997 # This compiles the object file as well as silently updating its dependencies
  1002 # This compiles the object file as well as silently updating its dependencies
   998 # list at the same time. It is not an issue that they aren't around during the
  1003 # list at the same time. It is not an issue that they aren't around during the
   999 # first compilation round as we just build everything at that time anyway,
  1004 # first compilation round as we just build everything at that time anyway,
  1000 # therefore we do not need to watch deps.
  1005 # therefore we do not need to watch deps.
  1001 
  1006 
  1002 %.o: %.c $(MAKE_CONFIG) endian.h table/strings.h
  1007 %.o: %.c $(MAKE_CONFIG) endian_target.h table/strings.h
  1003 	$(call cmd,c_compile)
  1008 	$(call cmd,c_compile)
  1004 	@mv $(<:%.c=%.d) $(<:%.c=.deps/%.d)
  1009 	@mv $(<:%.c=%.d) $(<:%.c=.deps/%.d)
  1005 
  1010 
  1006 %.o: %.cpp  $(MAKE_CONFIG) endian.h table/strings.h
  1011 %.o: %.cpp  $(MAKE_CONFIG) endian_target.h table/strings.h
  1007 	$(call cmd,cxx_compile)
  1012 	$(call cmd,cxx_compile)
  1008 	@mv $(<:%.cpp=%.d) $(<:%.cpp=.deps/%.d)
  1013 	@mv $(<:%.cpp=%.d) $(<:%.cpp=.deps/%.d)
  1009 
  1014 
  1010 # Silence stale header dependencies
  1015 # Silence stale header dependencies
  1011 %.h:
  1016 %.h: