diff options
Diffstat (limited to 'apps/codecs/dumb/Makefile')
-rw-r--r-- | apps/codecs/dumb/Makefile | 306 |
1 files changed, 0 insertions, 306 deletions
diff --git a/apps/codecs/dumb/Makefile b/apps/codecs/dumb/Makefile deleted file mode 100644 index d2a045285e..0000000000 --- a/apps/codecs/dumb/Makefile +++ /dev/null | |||
@@ -1,306 +0,0 @@ | |||
1 | # Main Makefile for DUMB. | ||
2 | |||
3 | # In theory, this Makefile can be used without modifications on DOS, Windows, | ||
4 | # Linux, BeOS and Mac OS X. Caveats are as follows: | ||
5 | |||
6 | # - For DOS and Windows users, COMSPEC (or ComSpec) must be set to point to | ||
7 | # command.com or cmd.exe. If they point to a Unix-style shell, this | ||
8 | # Makefile will die horribly. | ||
9 | |||
10 | # - Users of other platforms must NOT set COMSPEC or ComSpec. They must be | ||
11 | # undefined. | ||
12 | |||
13 | # Commands are as follows: | ||
14 | |||
15 | # make - Build the library (does make config for you first time). | ||
16 | # make install - Install the library and examples into the system. | ||
17 | # make uninstall - Remove the above. | ||
18 | # make config - Do or redo the configuration. | ||
19 | # make clean - Delete all object files; examples and libraries remain. | ||
20 | # make veryclean - Delete examples and libraries too. | ||
21 | |||
22 | # TODO: consider whether to delete config.txt and/or dumbask(.exe) | ||
23 | |||
24 | |||
25 | .PHONY: all install uninstall clean veryclean config config-if-necessary | ||
26 | |||
27 | PHONY_TARGETS := core allegro core-examples allegro-examples core-headers allegro-headers | ||
28 | |||
29 | .PHONY: $(PHONY_TARGETS) | ||
30 | .PHONY: $(PHONY_TARGETS:%=install-%) | ||
31 | .PHONY: $(PHONY_TARGETS:%=uninstall-%) | ||
32 | |||
33 | |||
34 | COMMA := , | ||
35 | |||
36 | #CC := gcc | ||
37 | #AR := ar | ||
38 | |||
39 | |||
40 | # Configuration. | ||
41 | # The configuration is done by an MS-DOS batch file if COMSPEC is set. | ||
42 | # Otherwise it is done by a Unix shell script. A file called 'config.txt', | ||
43 | # containing variables that control the build process, is created, and | ||
44 | # included by this Makefile. | ||
45 | |||
46 | |||
47 | ifeq "$(COMSPEC)" "" | ||
48 | ifdef ComSpec | ||
49 | COMSPEC := $(ComSpec) | ||
50 | endif | ||
51 | endif | ||
52 | |||
53 | |||
54 | -include make/config.txt | ||
55 | |||
56 | |||
57 | ifeq "$(OSTYPE)" "beos" | ||
58 | |||
59 | INCLUDE_INSTALL_PATH := /boot/develop/headers | ||
60 | LIB_INSTALL_PATH := /boot/develop/lib/x86 | ||
61 | BIN_INSTALL_PATH := /boot/home/config/bin | ||
62 | # DEFAULT_PREFIX is not set, so config.sh will not prompt for PREFIX. | ||
63 | LINK_MATH := | ||
64 | |||
65 | else | ||
66 | |||
67 | ifdef PREFIX | ||
68 | DEFAULT_PREFIX := $(PREFIX) | ||
69 | else | ||
70 | DEFAULT_PREFIX := /usr/local | ||
71 | endif | ||
72 | export DEFAULT_PREFIX | ||
73 | INCLUDE_INSTALL_PATH := $(PREFIX)/include | ||
74 | LIB_INSTALL_PATH := $(PREFIX)/lib | ||
75 | BIN_INSTALL_PATH := $(PREFIX)/bin | ||
76 | |||
77 | endif | ||
78 | |||
79 | |||
80 | all: config-if-necessary | ||
81 | @$(MAKE) --no-print-directory $(ALL_TARGETS) | ||
82 | |||
83 | install: config-if-necessary | ||
84 | @$(MAKE) --no-print-directory $(ALL_TARGETS:%=install-%) | ||
85 | $(call ECHO,DUMB has been installed.) | ||
86 | $(call ECHO,See readme.txt for details on the example programs.) | ||
87 | $(call ECHO,When you$(APOST)re ready to start using DUMB$(COMMA) see docs/howto.txt.) | ||
88 | $(call ECHO,Enjoy!) | ||
89 | |||
90 | uninstall: config-if-necessary | ||
91 | @$(MAKE) --no-print-directory $(ALL_TARGETS:%=uninstall-%) | ||
92 | $(call ECHO,DUMB has been uninstalled.) | ||
93 | |||
94 | |||
95 | # Assume a Unix-compatible system. | ||
96 | CONFIG_COMMAND := make/config.sh | ||
97 | DUMBASK_EXE := make/dumbask | ||
98 | |||
99 | # This will always configure. | ||
100 | config: $(DUMBASK_EXE) | ||
101 | $(CONFIG_COMMAND) | ||
102 | |||
103 | # This will only configure if the configuration file is absent. We don't use | ||
104 | # config.txt as the target name, because Make then runs the config initially, | ||
105 | # and again when it sees the 'config' target, so an initial 'make config' | ||
106 | # causes the configuration to be done twice. | ||
107 | ifeq "$(wildcard make/config.txt)" "" | ||
108 | config-if-necessary: config | ||
109 | else | ||
110 | config-if-necessary: | ||
111 | endif | ||
112 | |||
113 | $(DUMBASK_EXE): make/dumbask.c | ||
114 | $(CC) $< -o $@ | ||
115 | |||
116 | |||
117 | ifdef PLATFORM | ||
118 | |||
119 | |||
120 | # Build. | ||
121 | |||
122 | |||
123 | CORE_MODULES := \ | ||
124 | core/atexit.c \ | ||
125 | core/duhlen.c \ | ||
126 | core/dumbfile.c \ | ||
127 | core/loadduh.c \ | ||
128 | core/makeduh.c \ | ||
129 | core/rawsig.c \ | ||
130 | core/readduh.c \ | ||
131 | core/register.c \ | ||
132 | core/rendduh.c \ | ||
133 | core/rendsig.c \ | ||
134 | core/unload.c \ | ||
135 | helpers/clickrem.c \ | ||
136 | helpers/memfile.c \ | ||
137 | helpers/resample.c \ | ||
138 | helpers/sampbuf.c \ | ||
139 | helpers/silence.c \ | ||
140 | it/itload.c \ | ||
141 | it/itread.c \ | ||
142 | it/itrender.c \ | ||
143 | it/itunload.c \ | ||
144 | it/loads3m.c \ | ||
145 | it/reads3m.c \ | ||
146 | it/loadxm.c \ | ||
147 | it/readxm.c \ | ||
148 | it/loadmod.c \ | ||
149 | it/readmod.c \ | ||
150 | it/xmeffect.c \ | ||
151 | it/itorder.c \ | ||
152 | it/itmisc.c | ||
153 | # helpers/stdfile.c | ||
154 | |||
155 | ALLEGRO_MODULES := \ | ||
156 | allegro/alplay.c \ | ||
157 | allegro/datduh.c \ | ||
158 | allegro/datit.c \ | ||
159 | allegro/datxm.c \ | ||
160 | allegro/dats3m.c \ | ||
161 | allegro/datmod.c \ | ||
162 | allegro/datunld.c \ | ||
163 | allegro/packfile.c | ||
164 | |||
165 | CORE_EXAMPLES := examples/dumbout.c | ||
166 | ALLEGRO_EXAMPLES := examples/dumbplay.c | ||
167 | |||
168 | CORE_HEADERS := include/dumb.h | ||
169 | ALLEGRO_HEADERS := include/aldumb.h | ||
170 | |||
171 | |||
172 | LIBDIR := lib/$(PLATFORM) | ||
173 | OBJDIR_BASE := obj/$(PLATFORM) | ||
174 | |||
175 | |||
176 | WFLAGS := -Wall -W -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -DDUMB_DECLARE_DEPRECATED | ||
177 | WFLAGS_ALLEGRO := -Wno-missing-declarations | ||
178 | OFLAGS := -O2 -ffast-math -fomit-frame-pointer | ||
179 | DBGFLAGS := -DDEBUGMODE=1 -g3 | ||
180 | |||
181 | CFLAGS_RELEASE := -Iinclude $(WFLAGS) $(OFLAGS) $(PROFILE_OPTS) | ||
182 | CFLAGS_DEBUG := -Iinclude $(WFLAGS) $(DBGFLAGS) | ||
183 | |||
184 | LDFLAGS := -s | ||
185 | |||
186 | |||
187 | CORE_EXAMPLES_OBJ := $(addprefix examples/, $(notdir $(patsubst %.c, %.o, $(CORE_EXAMPLES)))) | ||
188 | ALLEGRO_EXAMPLES_OBJ := $(addprefix examples/, $(notdir $(patsubst %.c, %.o, $(ALLEGRO_EXAMPLES)))) | ||
189 | |||
190 | CORE_EXAMPLES_EXE := $(addprefix examples/, $(notdir $(patsubst %.c, %$(EXE_SUFFIX), $(CORE_EXAMPLES)))) | ||
191 | ALLEGRO_EXAMPLES_EXE := $(addprefix examples/, $(notdir $(patsubst %.c, %$(EXE_SUFFIX), $(ALLEGRO_EXAMPLES)))) | ||
192 | |||
193 | |||
194 | CORE_LIB_FILE_RELEASE := $(LIBDIR)/libdumb.a | ||
195 | ALLEGRO_LIB_FILE_RELEASE := $(LIBDIR)/libaldmb.a | ||
196 | |||
197 | CORE_LIB_FILE_DEBUG := $(LIBDIR)/libdumbd.a | ||
198 | ALLEGRO_LIB_FILE_DEBUG := $(LIBDIR)/libaldmd.a | ||
199 | |||
200 | |||
201 | core: $(CORE_LIB_FILE_RELEASE) $(CORE_LIB_FILE_DEBUG) | ||
202 | allegro: $(ALLEGRO_LIB_FILE_RELEASE) $(ALLEGRO_LIB_FILE_DEBUG) | ||
203 | |||
204 | core-examples: $(CORE_EXAMPLES_EXE) | ||
205 | allegro-examples: $(ALLEGRO_EXAMPLES_EXE) | ||
206 | |||
207 | core-headers: | ||
208 | |||
209 | allegro-headers: | ||
210 | |||
211 | install-core: core | ||
212 | $(call COPY,$(CORE_LIB_FILE_RELEASE),$(LIB_INSTALL_PATH)) | ||
213 | $(call COPY,$(CORE_LIB_FILE_DEBUG),$(LIB_INSTALL_PATH)) | ||
214 | |||
215 | install-allegro: allegro | ||
216 | $(call COPY,$(ALLEGRO_LIB_FILE_RELEASE),$(LIB_INSTALL_PATH)) | ||
217 | $(call COPY,$(ALLEGRO_LIB_FILE_DEBUG),$(LIB_INSTALL_PATH)) | ||
218 | |||
219 | ifeq "$(COMSPEC)" "" | ||
220 | install-core-examples: core-examples | ||
221 | $(call COPY,$(CORE_EXAMPLES_EXE),$(BIN_INSTALL_PATH)) | ||
222 | |||
223 | install-allegro-examples: allegro-examples | ||
224 | $(call COPY,$(ALLEGRO_EXAMPLES_EXE),$(BIN_INSTALL_PATH)) | ||
225 | else | ||
226 | # Don't install the examples on a Windows system. | ||
227 | install-core-examples: | ||
228 | install-allegro-examples: | ||
229 | endif | ||
230 | |||
231 | install-core-headers: | ||
232 | $(call COPY,$(CORE_HEADERS),$(INCLUDE_INSTALL_PATH)) | ||
233 | |||
234 | install-allegro-headers: | ||
235 | $(call COPY,$(ALLEGRO_HEADERS),$(INCLUDE_INSTALL_PATH)) | ||
236 | |||
237 | |||
238 | uninstall-core: | ||
239 | $(call DELETE,$(LIB_INSTALL_PATH)/$(notdir $(CORE_LIB_FILE_RELEASE))) | ||
240 | $(call DELETE,$(LIB_INSTALL_PATH)/$(notdir $(CORE_LIB_FILE_DEBUG))) | ||
241 | |||
242 | uninstall-allegro: | ||
243 | $(call DELETE,$(LIB_INSTALL_PATH)/$(notdir $(ALLEGRO_LIB_FILE_RELEASE))) | ||
244 | $(call DELETE,$(LIB_INSTALL_PATH)/$(notdir $(ALLEGRO_LIB_FILE_DEBUG))) | ||
245 | |||
246 | ifeq "$COMSPEC" "" | ||
247 | uninstall-core-examples: | ||
248 | $(call DELETE,$(patsubst %,$(BIN_INSTALL_PATH)/%,$(notdir $(CORE_EXAMPLES_EXE)))) | ||
249 | |||
250 | uninstall-allegro-examples: | ||
251 | $(call DELETE,$(patsubst %,$(BIN_INSTALL_PATH)/%,$(notdir $(ALLEGRO_EXAMPLES_EXE)))) | ||
252 | else | ||
253 | # The examples wouldn't have been installed on a Windows system. | ||
254 | uninstall-core-examples: | ||
255 | uninstall-allegro-examples: | ||
256 | endif | ||
257 | |||
258 | uninstall-core-headers: | ||
259 | $(call DELETE,$(patsubst %,$(INCLUDE_INSTALL_PATH)/%,$(notdir $(CORE_HEADERS)))) | ||
260 | |||
261 | uninstall-allegro-headers: | ||
262 | $(call DELETE,$(patsubst %,$(INCLUDE_INSTALL_PATH)/%,$(notdir $(ALLEGRO_HEADERS)))) | ||
263 | |||
264 | |||
265 | OBJDIR := $(OBJDIR_BASE)/release | ||
266 | CFLAGS := $(CFLAGS_RELEASE) | ||
267 | CORE_LIB_FILE := $(LIBDIR)/libdumb.a | ||
268 | ALLEGRO_LIB_FILE := $(LIBDIR)/libaldmb.a | ||
269 | include make/Makefile.inc | ||
270 | |||
271 | OBJDIR := $(OBJDIR_BASE)/debug | ||
272 | CFLAGS := $(CFLAGS_DEBUG) | ||
273 | CORE_LIB_FILE := $(LIBDIR)/libdumbd.a | ||
274 | ALLEGRO_LIB_FILE := $(LIBDIR)/libaldmd.a | ||
275 | include make/Makefile.inc | ||
276 | |||
277 | |||
278 | $(CORE_EXAMPLES_EXE): examples/%$(EXE_SUFFIX): examples/%.o $(CORE_LIB_FILE_RELEASE) | ||
279 | @echo "(dumb) compiling $^" | ||
280 | @$(CC) $^ -o $@ $(LDFLAGS) $(LINK_MATH) | ||
281 | |||
282 | $(ALLEGRO_EXAMPLES_EXE): examples/%$(EXE_SUFFIX): examples/%.o $(ALLEGRO_LIB_FILE_RELEASE) $(CORE_LIB_FILE_RELEASE) | ||
283 | @echo "(dumb) compiling $^" | ||
284 | @$(CC) $^ -o $@ $(LDFLAGS) $(LINK_ALLEGRO) | ||
285 | |||
286 | $(CORE_EXAMPLES_OBJ): examples/%.o: examples/%.c include/dumb.h | ||
287 | @echo "(dumb) compiling $^" | ||
288 | @$(CC) -c $< -o $@ $(CFLAGS_RELEASE) | ||
289 | |||
290 | $(ALLEGRO_EXAMPLES_OBJ): examples/%.o: examples/%.c include/dumb.h include/aldumb.h | ||
291 | @echo "(dumb) compiling $^" | ||
292 | @$(CC) -c $< -o $@ $(CFLAGS_RELEASE) -Wno-missing-declarations | ||
293 | |||
294 | clean: | ||
295 | $(call DELETE,$(call FIX,$(OBJDIR_BASE)/release/*.o)) | ||
296 | $(call DELETE,$(call FIX,$(OBJDIR_BASE)/debug/*.o)) | ||
297 | $(call DELETE,$(call FIX,examples/*.o)) | ||
298 | |||
299 | veryclean: clean | ||
300 | $(call DELETE,$(call FIX,$(CORE_LIB_FILE))) | ||
301 | $(call DELETE,$(call FIX,$(ALLEGRO_LIB_FILE))) | ||
302 | $(call DELETE,$(call FIX,$(CORE_EXAMPLES_EXE))) | ||
303 | $(call DELETE,$(call FIX,$(ALLEGRO_EXAMPLES_EXE))) | ||
304 | |||
305 | |||
306 | endif # ifdef PLATFORM | ||