Mercurial > hg > dmlib
annotate Makefile.gen @ 34:7908061da010
Fix building of JSS mixer parts.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 29 Sep 2012 20:31:10 +0300 |
parents | d1a6833a5d67 |
children | 033c660c25f5 |
rev | line source |
---|---|
0 | 1 ### |
2 ### Get settings from config.mak | |
3 ### | |
4 include config.mak | |
5 | |
6 ifeq ($(EXTRA_CFLAGS),) | |
7 EXTRA_CFLAGS=-march=core2 | |
8 endif | |
9 | |
2
9a8355b47e1c
Various improvements in the build system to add granularity
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
10 ifneq ($(DMLIB),) |
9a8355b47e1c
Various improvements in the build system to add granularity
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
11 DM_CFLAGS += -I$(DMLIB) |
9a8355b47e1c
Various improvements in the build system to add granularity
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
12 endif |
0 | 13 |
14 ### | |
15 ### Form additional compilation defines based on settings | |
16 ### | |
17 | |
18 # If C routines are not explicitly disabled, we enable them | |
19 ifeq ($(DM_USE_C),) | |
20 DM_USE_C=yes | |
21 endif | |
22 | |
23 ifeq ($(DM_USE_C),yes) | |
24 DM_CFLAGS+=-DDM_USE_C | |
25 endif | |
26 | |
27 # Enable SIMD routines, if requested | |
28 ifeq ($(DM_USE_SIMD),yes) | |
29 DM_CFLAGS+=-DDM_USE_SIMD | |
30 endif | |
31 | |
32 | |
33 ### | |
34 ### Filesystem | |
35 ### | |
36 ifeq ($(DMRES_PACKFS),yes) | |
37 DM_CFLAGS += -DDMRES_PACKFS | |
38 DMLIB_OBJS += dmpack.o dmpackutil.o | |
39 DM_LDFLAGS += -lz | |
2
9a8355b47e1c
Various improvements in the build system to add granularity
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
40 ifeq ($(DM_BUILD_TOOLS),yes) |
0 | 41 BINARIES += packed |
42 endif | |
2
9a8355b47e1c
Various improvements in the build system to add granularity
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
43 endif |
0 | 44 |
45 ifeq ($(DMRES_STDIO),yes) | |
46 DM_CFLAGS += -DDMRES_STDIO | |
47 endif | |
48 | |
49 | |
50 ### | |
51 ### Graphics support | |
52 ### | |
53 | |
54 ifeq ($(DM_GFX_MISC),yes) | |
55 DM_CFLAGS += -DDM_GFX_MISC | |
56 DMLIB_OBJS += dmgfx.o | |
57 endif | |
58 | |
59 ifeq ($(DM_GFX_LINES),yes) | |
60 DM_CFLAGS += -DDM_GFX_LINES | |
61 DMLIB_OBJS += dmline.o | |
62 endif | |
63 | |
64 ifeq ($(DM_GFX_BLITS),yes) | |
65 DM_CFLAGS += -DDM_GFX_BLITS | |
66 DMLIB_OBJS += dmblit.o | |
67 endif | |
68 | |
69 ifeq ($(DM_GFX_TTF_TEXT),yes) | |
70 DM_CFLAGS += -DDM_GFX_TTF_TEXT | |
71 DMLIB_OBJS += dmtext.o | |
72 | |
2
9a8355b47e1c
Various improvements in the build system to add granularity
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
73 ifeq ($(DM_BUILD_TESTS),yes) |
0 | 74 ifeq ($(DM_GFX_BLITS),yes) |
75 BINARIES += blittest vview vptest efu | |
76 endif | |
77 endif | |
2
9a8355b47e1c
Various improvements in the build system to add granularity
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
78 endif |
0 | 79 |
80 ifeq ($(DM_GFX_8BIT),yes) | |
81 DM_CFLAGS += -DDM_GFX_8BIT | |
82 endif | |
83 | |
84 ifeq ($(DM_GFX_15BIT),yes) | |
85 DM_CFLAGS += -DDM_GFX_15BIT | |
86 endif | |
87 | |
88 ifeq ($(DM_GFX_16BIT),yes) | |
89 DM_CFLAGS += -DDM_GFX_15BIT | |
90 endif | |
91 | |
92 ifeq ($(DM_GFX_32BIT),yes) | |
93 DM_CFLAGS += -DDM_GFX_15BIT | |
94 endif | |
95 | |
96 | |
97 ### | |
98 ### miniJSS | |
99 ### | |
100 ifeq ($(JSS),yes) | |
101 | |
102 ifeq ($(JSS_LIGHT),yes) | |
103 DM_CFLAGS+=-DJSS_LIGHT -Os | |
104 else | |
105 ifeq ($(JSS_USE_ASSERTS),yes) | |
106 DM_CFLAGS+=-DJSS_USE_ASSERTS | |
107 endif | |
108 ifeq ($(JSS_DEBUG),yes) | |
109 DM_CFLAGS+=-DJSS_DEBUG | |
110 endif | |
111 endif | |
112 | |
113 ifeq ($(JSS_SUP_THREADS),yes) | |
114 DM_CFLAGS+=-DJSS_SUP_THREADS | |
115 endif | |
116 | |
117 | |
118 SUP_MODLOAD=no | |
119 ifeq ($(JSS_SUP_XM),yes) | |
120 SUP_MODLOAD=yes | |
121 DMLIB_OBJS+= jloadxm.o | |
122 DM_CFLAGS+=-DJSS_SUP_XM | |
123 endif | |
124 | |
125 ifeq ($(JSS_SUP_JSSMOD),yes) | |
126 SUP_MODLOAD=yes | |
127 DMLIB_OBJS+= jloadjss.o | |
128 DM_CFLAGS+=-DJSS_SUP_JSSMOD $(JSSMOD_FLAGS) | |
129 endif | |
130 | |
131 ifeq ($(DM_USE_C),yes) | |
2
9a8355b47e1c
Various improvements in the build system to add granularity
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
132 TARGETS += $(DMLIB)jmix_c.c |
0 | 133 DMLIB_OBJS+=jmix_c.o |
134 endif | |
135 | |
136 #ifeq ($(DM_USE_SIMD),yes) | |
137 #DMLIB_OBJS+=jmix_simd.o | |
138 #endif | |
139 | |
140 | |
141 ### Dependancies | |
2
9a8355b47e1c
Various improvements in the build system to add granularity
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
142 ifeq ($(DM_BUILD_TOOLS),yes) |
9a8355b47e1c
Various improvements in the build system to add granularity
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
143 ifeq ($(DMRES_STDIO),yes) |
0 | 144 ifeq ($(SUP_MODLOAD),yes) |
145 BINARIES+= viewmod mod2wav testpl | |
146 endif | |
147 | |
148 ifeq ($(JSS_SUP_JSSMOD),yes) | |
149 ifeq ($(JSS_SUP_XM),yes) | |
150 BINARIES+= xm2jss | |
151 endif | |
152 endif | |
2
9a8355b47e1c
Various improvements in the build system to add granularity
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
153 endif |
9a8355b47e1c
Various improvements in the build system to add granularity
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
154 endif |
9a8355b47e1c
Various improvements in the build system to add granularity
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
155 |
0 | 156 |
28
920fb22cffcf
Fix build process for jmix_c.c dependancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
7
diff
changeset
|
157 DMLIB_OBJS += jss.o jssmix.o jssmod.o jssplr.o |
920fb22cffcf
Fix build process for jmix_c.c dependancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
7
diff
changeset
|
158 |
0 | 159 endif |
160 | |
161 ### | |
162 ### Rest of the rules | |
163 ### | |
164 CFLAGS += -g -W -Wall -DHAVE_STRING_H -O3 $(EXTRA_CFLAGS) | |
165 CXXFLAGS=$(CFLAGS) | |
166 | |
167 DM_CFLAGS += $(SDL_CFLAGS) | |
168 DM_LDFLAGS += $(LDFLAGS) $(SDL_LDFLAGS) | |
169 | |
170 | |
171 DMLIB_A=$(OBJPATH)dmlib.a | |
172 DMLIB_OBJS += dmfile.o dmlib.o dmlerp.o dmstring.o \ | |
32
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
173 dmargs.o dmvecmat.o dmperlin.o dmimage.o dmres.o \ |
d1a6833a5d67
Added a simple demo engine core.
Matti Hamalainen <ccr@tnsp.org>
parents:
28
diff
changeset
|
174 dmsimple.o |
0 | 175 |
2
9a8355b47e1c
Various improvements in the build system to add granularity
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
176 ifeq ($(DM_BUILD_TESTS),yes) |
0 | 177 BINARIES += vecmattest fptest |
2
9a8355b47e1c
Various improvements in the build system to add granularity
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
178 endif |
0 | 179 |
1
6e169d87d963
Improve buildsystem to support more flexible builds.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
180 TARGETS += $(DMLIB_A) $(addprefix $(BINPATH),$(addsuffix $(EXEEXT),$(BINARIES))) |
0 | 181 |
182 all: $(TARGETS) | |
183 | |
184 ### | |
185 ### Generic rules | |
186 ### | |
187 | |
1
6e169d87d963
Improve buildsystem to support more flexible builds.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
188 $(OBJPATH)%.o: $(DMLIB)%.c $(DMLIB)%.h |
0 | 189 @echo " CC $<" |
190 @$(CC) $(CFLAGS) -c -o $@ $< $(DM_CFLAGS) | |
191 | |
1
6e169d87d963
Improve buildsystem to support more flexible builds.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
192 $(OBJPATH)%.o: $(DMLIB)%.c |
0 | 193 @echo " CC $<" |
194 @$(CC) $(CFLAGS) -c -o $@ $< $(DM_CFLAGS) | |
195 | |
3 | 196 $(OBJPATH)%.o: %.c %.h |
197 @echo " CC $<" | |
198 @$(CC) $(CFLAGS) -c -o $@ $< $(DM_CFLAGS) | |
199 | |
200 $(OBJPATH)%.o: %.c | |
201 @echo " CC $<" | |
202 @$(CC) $(CFLAGS) -c -o $@ $< $(DM_CFLAGS) | |
203 | |
0 | 204 |
205 ### | |
206 ### dmlib rules | |
207 ### | |
208 | |
34
7908061da010
Fix building of JSS mixer parts.
Matti Hamalainen <ccr@tnsp.org>
parents:
32
diff
changeset
|
209 $(DMLIB)jmix_c.c: $(DMLIB)jmix_c.in.c $(DMLIB)jmix_c.h $(DMLIB)jmix_post.h |
7908061da010
Fix building of JSS mixer parts.
Matti Hamalainen <ccr@tnsp.org>
parents:
32
diff
changeset
|
210 (echo "#include \"jssmix.h\"" && cpp $<) | sed "s/^# .*//g" > $@ |
7908061da010
Fix building of JSS mixer parts.
Matti Hamalainen <ccr@tnsp.org>
parents:
32
diff
changeset
|
211 |
1
6e169d87d963
Improve buildsystem to support more flexible builds.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
212 $(OBJPATH)dmimage.o: $(DMLIB)dmimage.c $(DMLIB)stb_image.c |
0 | 213 @echo " CC $+" |
214 @$(CC) $(CFLAGS) -c -o $@ $< $(DM_CFLAGS) | |
215 | |
1
6e169d87d963
Improve buildsystem to support more flexible builds.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
216 $(OBJPATH)dmblit.o: $(DMLIB)dmblit.c $(DMLIB)dmscaledblit.h $(DMLIB)dmblitfunc.h |
0 | 217 @echo " CC $+" |
218 @$(CC) $(CFLAGS) -c -o $@ $< $(DM_CFLAGS) | |
219 | |
1
6e169d87d963
Improve buildsystem to support more flexible builds.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
220 $(OBJPATH)dmline.o: $(DMLIB)dmline.c $(DMLIB)dmdrawline.h $(DMLIB)dmlinefunc.h |
0 | 221 @echo " CC $+" |
222 @$(CC) $(CFLAGS) -c -o $@ $< $(DM_CFLAGS) | |
223 | |
1
6e169d87d963
Improve buildsystem to support more flexible builds.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
224 $(OBJPATH)dmargs.o: $(DMLIB)dmargs.c $(DMLIB)dmargs.h $(DMLIB)dmargs_int.c |
0 | 225 @echo " CC $+" |
226 @$(CC) $(CFLAGS) -c -o $@ $< $(DM_CFLAGS) | |
227 | |
228 | |
2
9a8355b47e1c
Various improvements in the build system to add granularity
Matti Hamalainen <ccr@tnsp.org>
parents:
1
diff
changeset
|
229 $(DMLIB_A): $(addprefix $(OBJPATH),$(DMLIB_OBJS)) $(DMLIB)Makefile.gen config.mak |
0 | 230 @echo " AR $@ $(addprefix $(OBJPATH),$(DMLIB_OBJS))" |
231 @$(AR) cru $@ $+ $(addprefix $(OBJPATH),$(DMLIB_OBJS)) | |
232 @$(RANLIB) $@ | |
233 | |
28
920fb22cffcf
Fix build process for jmix_c.c dependancy.
Matti Hamalainen <ccr@tnsp.org>
parents:
7
diff
changeset
|
234 |
0 | 235 |
236 ### | |
237 ### Tests and binaries | |
238 ### | |
3 | 239 $(BINPATH)%$(EXEEXT): $(OBJPATH)%.o $(DMLIB_A) |
240 @echo " LINK $+" | |
241 @$(CC) -o $@ $+ $(DM_LDFLAGS) | |
242 | |
0 | 243 $(BINPATH)vview$(EXEEXT): $(OBJPATH)vview.o $(DMLIB_A) |
244 @echo " LINK $+" | |
245 @$(CC) -o $@ $+ $(DM_LDFLAGS) -lSDL_ttf | |
246 | |
247 $(BINPATH)blittest$(EXEEXT): $(OBJPATH)blittest.o $(DMLIB_A) | |
248 @echo " LINK $+" | |
249 @$(CC) -o $@ $+ $(DM_LDFLAGS) -lSDL_ttf | |
250 | |
251 $(BINPATH)efu$(EXEEXT): $(OBJPATH)efu.o $(DMLIB_A) | |
252 @echo " LINK $+" | |
7
d427763f113a
Fix "efu" test, use dmImage instead of SDL_image.
Matti Hamalainen <ccr@tnsp.org>
parents:
3
diff
changeset
|
253 @$(CC) -o $@ $+ $(DM_LDFLAGS) -lSDL_ttf |
0 | 254 |
255 $(BINPATH)vptest$(EXEEXT): $(OBJPATH)vptest.o $(DMLIB_A) | |
256 @echo " LINK $+" | |
257 @$(CC) -o $@ $+ $(DM_LDFLAGS) -lSDL_ttf | |
258 | |
259 $(BINPATH)%test$(EXEEXT): $(OBJPATH)%test.o $(DMLIB_A) | |
260 @echo " LINK $+" | |
261 @$(CC) -o $@ $+ $(DM_LDFLAGS) | |
262 | |
263 $(BINPATH)packed$(EXEEXT): $(OBJPATH)packed.o $(DMLIB_A) | |
264 @echo " LINK $+" | |
265 @$(CC) -o $@ $+ $(DM_LDFLAGS) | |
266 | |
267 $(BINPATH)mod2wav$(EXEEXT): $(OBJPATH)mod2wav.o $(DMLIB_A) | |
268 @echo " LINK $+" | |
269 @$(CC) -o $@ $+ $(DM_LDFLAGS) | |
270 | |
271 $(BINPATH)xm2jss$(EXEEXT): $(OBJPATH)xm2jss.o $(DMLIB_A) | |
272 @echo " LINK $+" | |
273 @$(CC) -o $@ $+ $(DM_LDFLAGS) | |
274 | |
275 $(BINPATH)viewmod$(EXEEXT): $(OBJPATH)viewmod.o $(DMLIB_A) | |
276 @echo " LINK $+" | |
277 @$(CC) -o $@ $+ $(DM_LDFLAGS) | |
278 | |
279 $(BINPATH)testpl$(EXEEXT): $(OBJPATH)testpl.o $(DMLIB_A) | |
280 @echo " LINK $+" | |
281 @$(CC) -o $@ $+ $(DM_LDFLAGS) | |
282 | |
283 | |
284 ### | |
285 ### Special targets | |
286 ### | |
287 clean: | |
288 $(RM) $(TARGETS) $(OBJPATH)*.o | |
289 |