summaryrefslogtreecommitdiff
path: root/apps/codecs/dumb/Makefile
diff options
context:
space:
mode:
authorMichiel Van Der Kolk <not.valid@email.address>2005-03-17 20:50:03 +0000
committerMichiel Van Der Kolk <not.valid@email.address>2005-03-17 20:50:03 +0000
commit27be5bc72855a0fbbdae230bc144624c9eb85f5e (patch)
treeb553f1321df924c4b744ffcab48dce5f4f081f7d /apps/codecs/dumb/Makefile
parent7e7662bb716917ca431204f0113d400c1014f2e8 (diff)
downloadrockbox-27be5bc72855a0fbbdae230bc144624c9eb85f5e.tar.gz
rockbox-27be5bc72855a0fbbdae230bc144624c9eb85f5e.zip
Initial check in dumb 0.9.2 - has a few usages of floating point that should
be rewritten to fixed point. seems to compile cleanly for iriver. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6197 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/dumb/Makefile')
-rw-r--r--apps/codecs/dumb/Makefile311
1 files changed, 311 insertions, 0 deletions
diff --git a/apps/codecs/dumb/Makefile b/apps/codecs/dumb/Makefile
new file mode 100644
index 0000000000..3ced51338d
--- /dev/null
+++ b/apps/codecs/dumb/Makefile
@@ -0,0 +1,311 @@
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
27PHONY_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
34COMMA := ,
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
47ifeq "$(COMSPEC)" ""
48ifdef ComSpec
49COMSPEC := $(ComSpec)
50endif
51endif
52
53
54-include make/config.txt
55
56
57ifeq "$(OSTYPE)" "beos"
58
59INCLUDE_INSTALL_PATH := /boot/develop/headers
60LIB_INSTALL_PATH := /boot/develop/lib/x86
61BIN_INSTALL_PATH := /boot/home/config/bin
62# DEFAULT_PREFIX is not set, so config.sh will not prompt for PREFIX.
63LINK_MATH :=
64
65else
66
67ifdef PREFIX
68DEFAULT_PREFIX := $(PREFIX)
69else
70DEFAULT_PREFIX := /usr/local
71endif
72export DEFAULT_PREFIX
73INCLUDE_INSTALL_PATH := $(PREFIX)/include
74LIB_INSTALL_PATH := $(PREFIX)/lib
75BIN_INSTALL_PATH := $(PREFIX)/bin
76
77endif
78
79
80all: config-if-necessary
81 @$(MAKE) --no-print-directory $(ALL_TARGETS)
82 $(call ECHO,DUMB has been built. Run $(APOST)make install$(APOST) to install it.)
83
84install: config-if-necessary
85 @$(MAKE) --no-print-directory $(ALL_TARGETS:%=install-%)
86 $(call ECHO,DUMB has been installed.)
87 $(call ECHO,See readme.txt for details on the example programs.)
88 $(call ECHO,When you$(APOST)re ready to start using DUMB$(COMMA) see docs/howto.txt.)
89 $(call ECHO,Enjoy!)
90
91uninstall: config-if-necessary
92 @$(MAKE) --no-print-directory $(ALL_TARGETS:%=uninstall-%)
93 $(call ECHO,DUMB has been uninstalled.)
94
95
96ifdef COMSPEC
97# Assume DOS or Windows.
98SHELL := $(COMSPEC)
99CONFIG_COMMAND := make\config.bat
100DUMBASK_EXE := make/dumbask.exe
101else
102# Assume a Unix-compatible system.
103CONFIG_COMMAND := make/config.sh
104DUMBASK_EXE := make/dumbask
105endif
106
107# This will always configure.
108config: $(DUMBASK_EXE)
109 $(CONFIG_COMMAND)
110
111# This will only configure if the configuration file is absent. We don't use
112# config.txt as the target name, because Make then runs the config initially,
113# and again when it sees the 'config' target, so an initial 'make config'
114# causes the configuration to be done twice.
115ifeq "$(wildcard make/config.txt)" ""
116config-if-necessary: config
117else
118config-if-necessary:
119endif
120
121$(DUMBASK_EXE): make/dumbask.c
122 $(CC) $< -o $@
123
124
125ifdef PLATFORM
126
127
128# Build.
129
130
131CORE_MODULES := \
132 core/atexit.c \
133 core/duhlen.c \
134 core/dumbfile.c \
135 core/loadduh.c \
136 core/makeduh.c \
137 core/rawsig.c \
138 core/readduh.c \
139 core/register.c \
140 core/rendduh.c \
141 core/rendsig.c \
142 core/unload.c \
143 helpers/clickrem.c \
144 helpers/memfile.c \
145 helpers/resample.c \
146 helpers/sampbuf.c \
147 helpers/silence.c \
148 it/itload.c \
149 it/itread.c \
150 it/itrender.c \
151 it/itunload.c \
152 it/loads3m.c \
153 it/reads3m.c \
154 it/loadxm.c \
155 it/readxm.c \
156 it/loadmod.c \
157 it/readmod.c \
158 it/xmeffect.c \
159 it/itorder.c \
160 it/itmisc.c
161# helpers/stdfile.c
162
163ALLEGRO_MODULES := \
164 allegro/alplay.c \
165 allegro/datduh.c \
166 allegro/datit.c \
167 allegro/datxm.c \
168 allegro/dats3m.c \
169 allegro/datmod.c \
170 allegro/datunld.c \
171 allegro/packfile.c
172
173CORE_EXAMPLES := examples/dumbout.c
174ALLEGRO_EXAMPLES := examples/dumbplay.c
175
176CORE_HEADERS := include/dumb.h
177ALLEGRO_HEADERS := include/aldumb.h
178
179
180LIBDIR := lib/$(PLATFORM)
181OBJDIR_BASE := obj/$(PLATFORM)
182
183
184WFLAGS := -Wall -W -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -DDUMB_DECLARE_DEPRECATED
185WFLAGS_ALLEGRO := -Wno-missing-declarations
186OFLAGS := -O2 -ffast-math -fomit-frame-pointer
187DBGFLAGS := -DDEBUGMODE=1 -g3
188
189CFLAGS_RELEASE := -Iinclude $(WFLAGS) $(OFLAGS)
190CFLAGS_DEBUG := -Iinclude $(WFLAGS) $(DBGFLAGS)
191
192LDFLAGS := -s
193
194
195CORE_EXAMPLES_OBJ := $(addprefix examples/, $(notdir $(patsubst %.c, %.o, $(CORE_EXAMPLES))))
196ALLEGRO_EXAMPLES_OBJ := $(addprefix examples/, $(notdir $(patsubst %.c, %.o, $(ALLEGRO_EXAMPLES))))
197
198CORE_EXAMPLES_EXE := $(addprefix examples/, $(notdir $(patsubst %.c, %$(EXE_SUFFIX), $(CORE_EXAMPLES))))
199ALLEGRO_EXAMPLES_EXE := $(addprefix examples/, $(notdir $(patsubst %.c, %$(EXE_SUFFIX), $(ALLEGRO_EXAMPLES))))
200
201
202CORE_LIB_FILE_RELEASE := $(LIBDIR)/libdumb.a
203ALLEGRO_LIB_FILE_RELEASE := $(LIBDIR)/libaldmb.a
204
205CORE_LIB_FILE_DEBUG := $(LIBDIR)/libdumbd.a
206ALLEGRO_LIB_FILE_DEBUG := $(LIBDIR)/libaldmd.a
207
208
209core: $(CORE_LIB_FILE_RELEASE) $(CORE_LIB_FILE_DEBUG)
210allegro: $(ALLEGRO_LIB_FILE_RELEASE) $(ALLEGRO_LIB_FILE_DEBUG)
211
212core-examples: $(CORE_EXAMPLES_EXE)
213allegro-examples: $(ALLEGRO_EXAMPLES_EXE)
214
215core-headers:
216
217allegro-headers:
218
219install-core: core
220 $(call COPY,$(CORE_LIB_FILE_RELEASE),$(LIB_INSTALL_PATH))
221 $(call COPY,$(CORE_LIB_FILE_DEBUG),$(LIB_INSTALL_PATH))
222
223install-allegro: allegro
224 $(call COPY,$(ALLEGRO_LIB_FILE_RELEASE),$(LIB_INSTALL_PATH))
225 $(call COPY,$(ALLEGRO_LIB_FILE_DEBUG),$(LIB_INSTALL_PATH))
226
227ifeq "$(COMSPEC)" ""
228install-core-examples: core-examples
229 $(call COPY,$(CORE_EXAMPLES_EXE),$(BIN_INSTALL_PATH))
230
231install-allegro-examples: allegro-examples
232 $(call COPY,$(ALLEGRO_EXAMPLES_EXE),$(BIN_INSTALL_PATH))
233else
234# Don't install the examples on a Windows system.
235install-core-examples:
236install-allegro-examples:
237endif
238
239install-core-headers:
240 $(call COPY,$(CORE_HEADERS),$(INCLUDE_INSTALL_PATH))
241
242install-allegro-headers:
243 $(call COPY,$(ALLEGRO_HEADERS),$(INCLUDE_INSTALL_PATH))
244
245
246uninstall-core:
247 $(call DELETE,$(LIB_INSTALL_PATH)/$(notdir $(CORE_LIB_FILE_RELEASE)))
248 $(call DELETE,$(LIB_INSTALL_PATH)/$(notdir $(CORE_LIB_FILE_DEBUG)))
249
250uninstall-allegro:
251 $(call DELETE,$(LIB_INSTALL_PATH)/$(notdir $(ALLEGRO_LIB_FILE_RELEASE)))
252 $(call DELETE,$(LIB_INSTALL_PATH)/$(notdir $(ALLEGRO_LIB_FILE_DEBUG)))
253
254ifeq "$COMSPEC" ""
255uninstall-core-examples:
256 $(call DELETE,$(patsubst %,$(BIN_INSTALL_PATH)/%,$(notdir $(CORE_EXAMPLES_EXE))))
257
258uninstall-allegro-examples:
259 $(call DELETE,$(patsubst %,$(BIN_INSTALL_PATH)/%,$(notdir $(ALLEGRO_EXAMPLES_EXE))))
260else
261# The examples wouldn't have been installed on a Windows system.
262uninstall-core-examples:
263uninstall-allegro-examples:
264endif
265
266uninstall-core-headers:
267 $(call DELETE,$(patsubst %,$(INCLUDE_INSTALL_PATH)/%,$(notdir $(CORE_HEADERS))))
268
269uninstall-allegro-headers:
270 $(call DELETE,$(patsubst %,$(INCLUDE_INSTALL_PATH)/%,$(notdir $(ALLEGRO_HEADERS))))
271
272
273OBJDIR := $(OBJDIR_BASE)/release
274CFLAGS := $(CFLAGS_RELEASE)
275CORE_LIB_FILE := $(LIBDIR)/libdumb.a
276ALLEGRO_LIB_FILE := $(LIBDIR)/libaldmb.a
277include make/Makefile.inc
278
279OBJDIR := $(OBJDIR_BASE)/debug
280CFLAGS := $(CFLAGS_DEBUG)
281CORE_LIB_FILE := $(LIBDIR)/libdumbd.a
282ALLEGRO_LIB_FILE := $(LIBDIR)/libaldmd.a
283include make/Makefile.inc
284
285
286$(CORE_EXAMPLES_EXE): examples/%$(EXE_SUFFIX): examples/%.o $(CORE_LIB_FILE_RELEASE)
287 $(CC) $^ -o $@ $(LDFLAGS) $(LINK_MATH)
288
289$(ALLEGRO_EXAMPLES_EXE): examples/%$(EXE_SUFFIX): examples/%.o $(ALLEGRO_LIB_FILE_RELEASE) $(CORE_LIB_FILE_RELEASE)
290 $(CC) $^ -o $@ $(LDFLAGS) $(LINK_ALLEGRO)
291
292$(CORE_EXAMPLES_OBJ): examples/%.o: examples/%.c include/dumb.h
293 $(CC) -c $< -o $@ $(CFLAGS_RELEASE)
294
295$(ALLEGRO_EXAMPLES_OBJ): examples/%.o: examples/%.c include/dumb.h include/aldumb.h
296 $(CC) -c $< -o $@ $(CFLAGS_RELEASE) -Wno-missing-declarations
297
298
299clean:
300 $(call DELETE,$(call FIX,$(OBJDIR_BASE)/release/*.o))
301 $(call DELETE,$(call FIX,$(OBJDIR_BASE)/debug/*.o))
302 $(call DELETE,$(call FIX,examples/*.o))
303
304veryclean: clean
305 $(call DELETE,$(call FIX,$(CORE_LIB_FILE)))
306 $(call DELETE,$(call FIX,$(ALLEGRO_LIB_FILE)))
307 $(call DELETE,$(call FIX,$(CORE_EXAMPLES_EXE)))
308 $(call DELETE,$(call FIX,$(ALLEGRO_EXAMPLES_EXE)))
309
310
311endif # ifdef PLATFORM