Makefile
changeset 4562 b22bb637406f
parent 4374 ac31b17785dd
child 4638 8abe4f10b94b
equal deleted inserted replaced
4561:0779e5c11331 4562:b22bb637406f
    26 # clean: remove intermediate build files
    26 # clean: remove intermediate build files
    27 # mrproper: remove intermediate files and makefile configuration
    27 # mrproper: remove intermediate files and makefile configuration
    28 # upgradeconf: add new options to old Makefile.config
    28 # upgradeconf: add new options to old Makefile.config
    29 # osx: OS X application
    29 # osx: OS X application
    30 # release: used by OSX to make a dmg file ready to release
    30 # release: used by OSX to make a dmg file ready to release
    31 # unittest: compile and link ./yapf/unittest/unittest - test for some yapf related classes, and run it
       
    32 
    31 
    33 # Options:
    32 # Options:
    34 #
    33 #
    35 # Summary of OS choice defines
    34 # Summary of OS choice defines
    36 # WIN32: building on Windows
    35 # WIN32: building on Windows
   251 # Set output executable names
   250 # Set output executable names
   252 TTD=openttd$(EXE)
   251 TTD=openttd$(EXE)
   253 ENDIAN_CHECK=endian_check$(EXE)
   252 ENDIAN_CHECK=endian_check$(EXE)
   254 STRGEN=strgen/strgen$(EXE)
   253 STRGEN=strgen/strgen$(EXE)
   255 OSXAPP="OpenTTD.app"
   254 OSXAPP="OpenTTD.app"
   256 UNITTEST=unit_test$(EXE)
       
   257 
   255 
   258 ifdef RELEASE
   256 ifdef RELEASE
   259 REV:=$(RELEASE)
   257 REV:=$(RELEASE)
   260 else
   258 else
   261 ifeq ($(shell if test -d .svn; then echo 1; fi), 1)
   259 ifeq ($(shell if test -d .svn; then echo 1; fi), 1)
   889 
   887 
   890 lang/%.lng: lang/%.txt $(STRGEN) lang/english.txt
   888 lang/%.lng: lang/%.txt $(STRGEN) lang/english.txt
   891 	@echo '===> Compiling language $(*F)'
   889 	@echo '===> Compiling language $(*F)'
   892 	$(Q)$(STRGEN) $(STRGEN_FLAGS) -s lang -d lang $< $(LANG_ERRORS) || rm -f $@
   890 	$(Q)$(STRGEN) $(STRGEN_FLAGS) -s lang -d lang $< $(LANG_ERRORS) || rm -f $@
   893 
   891 
   894 # stupid KUDr doesn't know how to setup unittest dependencies (so rm,cp,rm)
       
   895 # please don't blame him and repair it:
       
   896 unittest: endian_host.h $(UPDATECONFIG) $(UNITTEST) rununittest
       
   897 $(UNITTEST): yapf/unittest/unittest.cpp
       
   898 	@echo '===> Compiling and Linking $@'
       
   899 	$(Q)rm -f $(UNITTEST)
       
   900 	$(Q)$(CXX_HOST) $(CFLAGS_HOST) $(CDEFS) $< $(LIBS) $(LRT) -o $@
       
   901 
       
   902 .PHONY: unittest
       
   903 
       
   904 rununittest:
       
   905 	@echo '===> Starting unittest'
       
   906 	$(Q)./$(UNITTEST)
       
   907 .PHONY: rununittest
       
   908 
       
   909 ifdef MORPHOS
   892 ifdef MORPHOS
   910 
   893 
   911 release: all
   894 release: all
   912 	$(Q)rm -fr "/t/openttd-$(RELEASE)-morphos.lha"
   895 	$(Q)rm -fr "/t/openttd-$(RELEASE)-morphos.lha"
   913 	$(Q)mkdir -p "/t/"
   896 	$(Q)mkdir -p "/t/"
   958 
   941 
   959 
   942 
   960 clean:
   943 clean:
   961 	@echo '===> Cleaning up'
   944 	@echo '===> Cleaning up'
   962 # endian.h is out-dated and no longer in use, so it can be removed soon
   945 # endian.h is out-dated and no longer in use, so it can be removed soon
   963 	$(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) .OSX $(UNITTEST)
   946 	$(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) .OSX
   964 
   947 
   965 mrproper: clean
   948 mrproper: clean
   966 	$(Q)rm -rf $(MAKE_CONFIG)
   949 	$(Q)rm -rf $(MAKE_CONFIG)
   967 
   950 
   968 ifndef OSX
   951 ifndef OSX
  1041 
  1024 
  1042 depend:
  1025 depend:
  1043 	@true # The include handles this automagically
  1026 	@true # The include handles this automagically
  1044 
  1027 
  1045 # Introduce the dependencies
  1028 # Introduce the dependencies
  1046 ifeq ($(findstring $(MAKECMDGOALS), clean info mrproper upgradeconf unittest $(MAKE_CONFIG)),)
  1029 ifeq ($(findstring $(MAKECMDGOALS), clean info mrproper upgradeconf $(MAKE_CONFIG)),)
  1047 -include $(DEPS)
  1030 -include $(DEPS)
  1048 endif
  1031 endif
  1049 
  1032 
  1050 # Silence stale header dependency errors
  1033 # Silence stale header dependency errors
  1051 %.h:
  1034 %.h: