summaryrefslogtreecommitdiff
path: root/apps/codecs/dumb/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/dumb/Makefile')
-rw-r--r--apps/codecs/dumb/Makefile306
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
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
83install: 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
90uninstall: 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.
96CONFIG_COMMAND := make/config.sh
97DUMBASK_EXE := make/dumbask
98
99# This will always configure.
100config: $(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.
107ifeq "$(wildcard make/config.txt)" ""
108config-if-necessary: config
109else
110config-if-necessary:
111endif
112
113$(DUMBASK_EXE): make/dumbask.c
114 $(CC) $< -o $@
115
116
117ifdef PLATFORM
118
119
120# Build.
121
122
123CORE_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
155ALLEGRO_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
165CORE_EXAMPLES := examples/dumbout.c
166ALLEGRO_EXAMPLES := examples/dumbplay.c
167
168CORE_HEADERS := include/dumb.h
169ALLEGRO_HEADERS := include/aldumb.h
170
171
172LIBDIR := lib/$(PLATFORM)
173OBJDIR_BASE := obj/$(PLATFORM)
174
175
176WFLAGS := -Wall -W -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -DDUMB_DECLARE_DEPRECATED
177WFLAGS_ALLEGRO := -Wno-missing-declarations
178OFLAGS := -O2 -ffast-math -fomit-frame-pointer
179DBGFLAGS := -DDEBUGMODE=1 -g3
180
181CFLAGS_RELEASE := -Iinclude $(WFLAGS) $(OFLAGS) $(PROFILE_OPTS)
182CFLAGS_DEBUG := -Iinclude $(WFLAGS) $(DBGFLAGS)
183
184LDFLAGS := -s
185
186
187CORE_EXAMPLES_OBJ := $(addprefix examples/, $(notdir $(patsubst %.c, %.o, $(CORE_EXAMPLES))))
188ALLEGRO_EXAMPLES_OBJ := $(addprefix examples/, $(notdir $(patsubst %.c, %.o, $(ALLEGRO_EXAMPLES))))
189
190CORE_EXAMPLES_EXE := $(addprefix examples/, $(notdir $(patsubst %.c, %$(EXE_SUFFIX), $(CORE_EXAMPLES))))
191ALLEGRO_EXAMPLES_EXE := $(addprefix examples/, $(notdir $(patsubst %.c, %$(EXE_SUFFIX), $(ALLEGRO_EXAMPLES))))
192
193
194CORE_LIB_FILE_RELEASE := $(LIBDIR)/libdumb.a
195ALLEGRO_LIB_FILE_RELEASE := $(LIBDIR)/libaldmb.a
196
197CORE_LIB_FILE_DEBUG := $(LIBDIR)/libdumbd.a
198ALLEGRO_LIB_FILE_DEBUG := $(LIBDIR)/libaldmd.a
199
200
201core: $(CORE_LIB_FILE_RELEASE) $(CORE_LIB_FILE_DEBUG)
202allegro: $(ALLEGRO_LIB_FILE_RELEASE) $(ALLEGRO_LIB_FILE_DEBUG)
203
204core-examples: $(CORE_EXAMPLES_EXE)
205allegro-examples: $(ALLEGRO_EXAMPLES_EXE)
206
207core-headers:
208
209allegro-headers:
210
211install-core: core
212 $(call COPY,$(CORE_LIB_FILE_RELEASE),$(LIB_INSTALL_PATH))
213 $(call COPY,$(CORE_LIB_FILE_DEBUG),$(LIB_INSTALL_PATH))
214
215install-allegro: allegro
216 $(call COPY,$(ALLEGRO_LIB_FILE_RELEASE),$(LIB_INSTALL_PATH))
217 $(call COPY,$(ALLEGRO_LIB_FILE_DEBUG),$(LIB_INSTALL_PATH))
218
219ifeq "$(COMSPEC)" ""
220install-core-examples: core-examples
221 $(call COPY,$(CORE_EXAMPLES_EXE),$(BIN_INSTALL_PATH))
222
223install-allegro-examples: allegro-examples
224 $(call COPY,$(ALLEGRO_EXAMPLES_EXE),$(BIN_INSTALL_PATH))
225else
226# Don't install the examples on a Windows system.
227install-core-examples:
228install-allegro-examples:
229endif
230
231install-core-headers:
232 $(call COPY,$(CORE_HEADERS),$(INCLUDE_INSTALL_PATH))
233
234install-allegro-headers:
235 $(call COPY,$(ALLEGRO_HEADERS),$(INCLUDE_INSTALL_PATH))
236
237
238uninstall-core:
239 $(call DELETE,$(LIB_INSTALL_PATH)/$(notdir $(CORE_LIB_FILE_RELEASE)))
240 $(call DELETE,$(LIB_INSTALL_PATH)/$(notdir $(CORE_LIB_FILE_DEBUG)))
241
242uninstall-allegro:
243 $(call DELETE,$(LIB_INSTALL_PATH)/$(notdir $(ALLEGRO_LIB_FILE_RELEASE)))
244 $(call DELETE,$(LIB_INSTALL_PATH)/$(notdir $(ALLEGRO_LIB_FILE_DEBUG)))
245
246ifeq "$COMSPEC" ""
247uninstall-core-examples:
248 $(call DELETE,$(patsubst %,$(BIN_INSTALL_PATH)/%,$(notdir $(CORE_EXAMPLES_EXE))))
249
250uninstall-allegro-examples:
251 $(call DELETE,$(patsubst %,$(BIN_INSTALL_PATH)/%,$(notdir $(ALLEGRO_EXAMPLES_EXE))))
252else
253# The examples wouldn't have been installed on a Windows system.
254uninstall-core-examples:
255uninstall-allegro-examples:
256endif
257
258uninstall-core-headers:
259 $(call DELETE,$(patsubst %,$(INCLUDE_INSTALL_PATH)/%,$(notdir $(CORE_HEADERS))))
260
261uninstall-allegro-headers:
262 $(call DELETE,$(patsubst %,$(INCLUDE_INSTALL_PATH)/%,$(notdir $(ALLEGRO_HEADERS))))
263
264
265OBJDIR := $(OBJDIR_BASE)/release
266CFLAGS := $(CFLAGS_RELEASE)
267CORE_LIB_FILE := $(LIBDIR)/libdumb.a
268ALLEGRO_LIB_FILE := $(LIBDIR)/libaldmb.a
269include make/Makefile.inc
270
271OBJDIR := $(OBJDIR_BASE)/debug
272CFLAGS := $(CFLAGS_DEBUG)
273CORE_LIB_FILE := $(LIBDIR)/libdumbd.a
274ALLEGRO_LIB_FILE := $(LIBDIR)/libaldmd.a
275include 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
294clean:
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
299veryclean: 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
306endif # ifdef PLATFORM