(svn r23005) -Fix (r23004): Of course there's still the 16-sprite version for shore...
[openttd/fttd.git] / Makefile.in
blob054466745efb7ba10dd3c4549ebbf33d865a061b
1 # $Id$
3 # This file is part of OpenTTD.
4 # OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
5 # OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
6 # See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 # Check if we want to show what we are doing
9 ifdef VERBOSE
10 Q =
11 else
12 Q = @
13 endif
15 include Makefile.am
17 CONFIG_CACHE_PWD = !!CONFIG_CACHE_PWD!!
18 CONFIG_CACHE_SOURCE_LIST = !!CONFIG_CACHE_SOURCE_LIST!!
19 BIN_DIR = !!BIN_DIR!!
20 ICON_THEME_DIR = !!ICON_THEME_DIR!!
21 MAN_DIR = !!MAN_DIR!!
22 MENU_DIR = !!MENU_DIR!!
23 SRC_DIR = !!SRC_DIR!!
24 ROOT_DIR = !!ROOT_DIR!!
25 BUNDLE_DIR = "$(ROOT_DIR)/bundle"
26 BUNDLES_DIR = "$(ROOT_DIR)/bundles"
27 INSTALL_DIR = !!INSTALL_DIR!!
28 INSTALL_BINARY_DIR = "$(INSTALL_DIR)/"!!BINARY_DIR!!
29 INSTALL_MAN_DIR = "$(INSTALL_DIR)/$(MAN_DIR)"
30 INSTALL_MENU_DIR = "$(INSTALL_DIR)/$(MENU_DIR)"
31 INSTALL_ICON_DIR = "$(INSTALL_DIR)/"!!ICON_DIR!!
32 INSTALL_ICON_THEME_DIR = "$(INSTALL_DIR)/$(ICON_THEME_DIR)"
33 INSTALL_DATA_DIR = "$(INSTALL_DIR)/"!!DATA_DIR!!
34 INSTALL_DOC_DIR = "$(INSTALL_DIR)/"!!DOC_DIR!!
35 SOURCE_LIST = !!SOURCE_LIST!!
36 CONFIGURE_FILES = !!CONFIGURE_FILES!!
37 BINARY_NAME = !!BINARY_NAME!!
38 STRIP = !!STRIP!!
39 TTD = !!TTD!!
40 TTDS = $(SRC_DIRS:%=%/$(TTD))
41 OS = !!OS!!
42 OSXAPP = !!OSXAPP!!
43 LIPO = !!LIPO!!
44 REVISION = !!REVISION!!
45 AWK = !!AWK!!
46 SORT = !!SORT!!
47 DISTCC = !!DISTCC!!
49 RES := $(shell if [ ! -f $(CONFIG_CACHE_PWD) ] || [ "`pwd`" != "`cat $(CONFIG_CACHE_PWD)`" ]; then echo "`pwd`" > $(CONFIG_CACHE_PWD); fi )
50 RES := $(shell if [ ! -f $(CONFIG_CACHE_SOURCE_LIST) ] || [ -n "`cmp $(CONFIG_CACHE_SOURCE_LIST) $(SOURCE_LIST) 2>/dev/null`" ]; then cp $(SOURCE_LIST) $(CONFIG_CACHE_SOURCE_LIST); fi )
52 all: config.pwd config.cache
53 ifdef DISTCC
54 @if [ -z "`echo '$(MFLAGS)' | grep '\-j'`" ]; then echo; echo "WARNING: you enabled distcc support, but you don't seem to be using the -jN paramter"; echo; fi
55 endif
56 @for dir in $(DIRS); do \
57 $(MAKE) -C $$dir all || exit 1; \
58 done
59 ifdef LIPO
60 # Lipo is an OSX thing. If it is defined, it means we are building for universal,
61 # and so we have have to combine the binaries into one big binary
63 # Remove the last binary made by the last compiled target
64 $(Q)rm -f $(BIN_DIR)/$(TTD)
65 # Make all the binaries into one
66 $(Q)$(LIPO) -create -output $(BIN_DIR)/$(TTD) $(TTDS)
67 endif
69 help:
70 @echo "Available make commands:"
71 @echo ""
72 @echo "Compilation:"
73 @echo " all compile the executable and the lang files"
74 @echo " lang compile the lang files only"
75 @echo "Clean up:"
76 @echo " clean remove the files generated during compilation"
77 @echo " mrproper remove the files generated during configuration and compilation"
78 @echo "Run after compilation:"
79 @echo " run execute openttd after the compilation"
80 @echo " run-gdb execute openttd in debug mode after the compilation"
81 @echo " run-prof execute openttd in profiling mode after the compilation"
82 @echo "Installation:"
83 @echo " install install the compiled files and the data-files after the compilation"
84 @echo " bundle create the base for an installation bundle"
85 @echo " bundle_zip create the zip installation bundle"
86 @echo " bundle_gzip create the gzip installation bundle"
87 @echo " bundle_bzip2 create the bzip2 installation bundle"
88 @echo " bundle_lha create the lha installation bundle"
89 @echo " bundle_dmg create the dmg installation bundle"
91 config.pwd: $(CONFIG_CACHE_PWD)
92 $(MAKE) reconfigure
94 config.cache: $(CONFIG_CACHE_SOURCE_LIST) $(CONFIGURE_FILES)
95 $(MAKE) reconfigure
97 reconfigure:
98 ifeq ($(shell if test -f config.cache; then echo 1; fi), 1)
99 @echo "----------------"
100 @echo "The system detected that source.list or any configure file is altered."
101 @echo " Going to reconfigure with last known settings..."
102 @echo "----------------"
103 # Make sure we don't lock config.cache
104 @$(shell cat config.cache | sed 's@\\ @\\\\ @g') || exit 1
105 @echo "----------------"
106 @echo "Reconfig done. Please re-execute make."
107 @echo "----------------"
108 else
109 @echo "----------------"
110 @echo "Have not found a configuration, please run configure first."
111 @echo "----------------"
112 @exit 1
113 endif
115 clean:
116 @for dir in $(DIRS); do \
117 $(MAKE) -C $$dir clean; \
118 done
119 $(Q)rm -rf $(BUNDLE_TARGET)
121 lang:
122 @for dir in $(LANG_DIRS); do \
123 $(MAKE) -C $$dir all; \
124 done
126 mrproper:
127 @for dir in $(DIRS); do \
128 $(MAKE) -C $$dir mrproper; \
129 rm -f $$dir/Makefile; \
130 done
131 $(Q)rm -rf objs
132 $(Q)rm -f Makefile Makefile.am Makefile.bundle
133 $(Q)rm -f media/openttd.desktop media/openttd.desktop.install
134 $(Q)rm -f $(CONFIG_CACHE_SOURCE_LIST) config.cache config.pwd config.log $(CONFIG_CACHE_PWD)
135 # directories for bundle generation
136 $(Q)rm -rf $(BUNDLE_DIR)
137 $(Q)rm -rf $(BUNDLES_DIR)
138 # output of profiling
139 $(Q)rm -f $(BIN_DIR)/gmon.out
140 # output of generating 'API' documentation
141 $(Q)rm -f $(ROOT_DIR)/openttd.tag
142 $(Q)rm -rf $(ROOT_DIR)/docs/source
143 # output of generating AI API documentation
144 $(Q)rm -f $(SRC_DIR)/ai/api/openttd.tag
145 $(Q)rm -rf $(ROOT_DIR)/docs/aidocs
146 # directories created by OpenTTD on regression testing
147 $(Q)rm -rf $(BIN_DIR)/ai/regression/content_download $(BIN_DIR)/ai/regression/save $(BIN_DIR)/ai/regression/scenario
148 distclean: mrproper
150 maintainer-clean: distclean
151 $(Q)rm -f $(BIN_DIR)/data/openttd.grf
153 depend:
154 @for dir in $(SRC_DIRS); do \
155 $(MAKE) -C $$dir depend; \
156 done
158 run: all
159 $(Q)cd !!BIN_DIR!! && ./!!TTD!! $(OPENTTD_ARGS)
161 run-gdb: all
162 $(Q)cd !!BIN_DIR!! && gdb --ex run --args ./!!TTD!! $(OPENTTD_ARGS)
164 run-prof: all
165 $(Q)cd !!BIN_DIR!! && ./!!TTD!! $(OPENTTD_ARGS) && gprof !!TTD!! | less
167 regression: all
168 $(Q)cd !!BIN_DIR!! && sh ai/regression/run.sh
169 test: regression
171 %.o:
172 @for dir in $(SRC_DIRS); do \
173 $(MAKE) -C $$dir $(@:src/%=%); \
174 done
176 %.lng:
177 @for dir in $(LANG_DIRS); do \
178 $(MAKE) -C $$dir $@; \
179 done
181 .PHONY: test distclean mrproper clean
183 include Makefile.bundle