pvq: use small LUT for integer sqrt((n+3)/2) sqrt((n+2)/2)
[daala.git] / tools / unix / Makefile
1 #Daala video codec
2 #Copyright (c) 2002-2012 Daala project contributors.  All rights reserved.
3 #
4 #Redistribution and use in source and binary forms, with or without
5 #modification, are permitted provided that the following conditions are met:
6 #
7 #- Redistributions of source code must retain the above copyright notice, this
8 #  list of conditions and the following disclaimer.
9 #
10 #- Redistributions in binary form must reproduce the above copyright notice,
11 #  this list of conditions and the following disclaimer in the documentation
12 #  and/or other materials provided with the distribution.
13 #
14 #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
15 #AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 #IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 #DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
18 #FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 #DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20 #SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21 #CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22 #OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 #OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25 MAKEDEPEND = $(CC) -MM
26 CINCLUDE = `pkg-config ogg libpng --cflags`
27 CFLAGS = -Wall -Wno-overlength-strings -Wno-long-long -Wshadow
28 CFLAGS += -std=c89 -pedantic -fopenmp
29 CFLAGS += -O3
30 CFLAGS += -g
31 CFLAGS += -DOD_ENABLE_ASSERTIONS
32
33 # You could instead set this to HAVE_GETTIMEOFDAY if you don't have ftime.
34 CFLAGS += -DHAVE_FTIME
35
36 CINCLUDE := -I../../include ${CINCLUDE}
37 LIBSRCDIR=../../src
38 LOCALSRCDIR=..
39 WORKDIR=build
40
41 #png2y4m
42 P2Y_LOCAL_CSOURCES = \
43 kiss99.c \
44 png2y4m.c
45
46 P2Y_LIB_CSOURCES =
47
48 P2Y_LDFLAGS = `pkg-config ogg libpng --libs`
49
50 P2Y_OBJS:=${P2Y_LOCAL_CSOURCES} ${P2Y_LIB_CSOURCES}
51 P2Y_OBJS:=${P2Y_OBJS:%.c=${WORKDIR}/%.o}
52 P2Y_CSOURCES:=${P2Y_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} ${P2Y_LIB_CSOURCES:%=${LIBSRCDIR}/%}
53 P2Y_TARGET:=png2y4m
54
55 #y4m2png
56 Y2P_LOCAL_CSOURCES = \
57 vidinput.c \
58 y4m_input.c \
59 y4m2png.c
60
61 Y2P_LIB_CSOURCES =
62
63 Y2P_LDFLAGS = `pkg-config ogg libpng --libs`
64
65 Y2P_OBJS:=${Y2P_LOCAL_CSOURCES} ${Y2P_LIB_CSOURCES}
66 Y2P_OBJS:=${Y2P_OBJS:%.c=${WORKDIR}/%.o}
67 Y2P_CSOURCES:=${Y2P_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} ${Y2P_LIB_CSOURCES:%=${LIBSRCDIR}/%}
68 Y2P_TARGET:=y4m2png
69
70 #dump_psnr
71 PSNR_LOCAL_CSOURCES = \
72 vidinput.c \
73 y4m_input.c \
74 dump_psnr.c
75
76 PSNR_LIB_CSOURCES =
77
78 PSNR_LDFLAGS = `pkg-config ogg libpng --libs` -lm
79
80 PSNR_OBJS:=${PSNR_LOCAL_CSOURCES} ${PSNR_LIB_CSOURCES}
81 PSNR_OBJS:=${PSNR_OBJS:%.c=${WORKDIR}/%.o}
82 PSNR_CSOURCES:=${PSNR_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} ${PSNR_LIB_CSOURCES:%=${LIBSRCDIR}/%}
83 PSNR_TARGET:=dump_psnr
84
85 #dump_psnrhvs
86 PSNRHVS_LOCAL_CSOURCES = \
87 vidinput.c \
88 y4m_input.c \
89 dct.c \
90 dump_psnrhvs.c \
91 tf.c \
92 internal.c
93
94 PSNRHVS_LIB_CSOURCES =
95
96 PSNRHVS_LDFLAGS = `pkg-config ogg libpng --libs` -lm
97
98 PSNRHVS_OBJS:=${PSNRHVS_LOCAL_CSOURCES} ${PSNRHVS_LIB_CSOURCES}
99 PSNRHVS_OBJS:=${PSNRHVS_OBJS:%.c=${WORKDIR}/%.o}
100 PSNRHVS_CSOURCES:=${PSNRHVS_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} ${PSNRHVS_LIB_CSOURCES:%=${LIBSRCDIR}/%}
101 PSNRHVS_TARGET:=dump_psnrhvs
102
103 #block_size_analysis
104 BSIZE_LOCAL_CSOURCES = \
105 block_size_analysis.c \
106 block_size_enc.c \
107 logging.c \
108 vidinput.c \
109 y4m_input.c \
110 dct.c \
111 internal.c \
112 entcode.c \
113 entenc.c \
114 filter.c \
115 switch_table.c \
116 tf.c
117
118 BSIZE_LIB_CSOURCES =
119
120 BSIZE_LDFLAGS = `pkg-config ogg libpng --libs` -lm
121
122 BSIZE_OBJS:=${BSIZE_LOCAL_CSOURCES} ${BSIZE_LIB_CSOURCES}
123 BSIZE_OBJS:=${BSIZE_OBJS:%.c=${WORKDIR}/%.o}
124 BSIZE_CSOURCES:=${BSIZE_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} ${BSIZE_LIB_CSOURCES:%=${LIBSRCDIR}/%}
125 BSIZE_TARGET:=block_size_analysis
126
127 #to_monochrome
128 MONO_LOCAL_CSOURCES = \
129 vidinput.c \
130 y4m_input.c \
131 to_monochrome.c
132
133 MONO_LIB_CSOURCES =
134
135 MONO_LDFLAGS = `pkg-config ogg libpng --libs`
136
137 MONO_OBJS:=${MONO_LOCAL_CSOURCES} ${MONO_LIB_CSOURCES}
138 MONO_OBJS:=${MONO_OBJS:%.c=${WORKDIR}/%.o}
139 MONO_CSOURCES:=${MONO_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} ${MONO_LIB_CSOURCES:%=${LIBSRCDIR}/%}
140 MONO_TARGET:=to_monochrome
141
142
143 #downsample
144 DS_LOCAL_CSOURCES = \
145 vidinput.c \
146 y4m_input.c \
147 downsample.c
148
149 DS_LIB_CSOURCES =
150
151 DS_LDFLAGS = `pkg-config ogg libpng --libs`
152
153 DS_OBJS:=${DS_LOCAL_CSOURCES} ${DS_LIB_CSOURCES}
154 DS_OBJS:=${DS_OBJS:%.c=${WORKDIR}/%.o}
155 DS_CSOURCES:=${DS_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} ${DS_LIB_CSOURCES:%=${LIBSRCDIR}/%}
156 DS_TARGET:=downsample
157
158
159 #upsample
160 US_LOCAL_CSOURCES = \
161 vidinput.c \
162 y4m_input.c \
163 upsample.c \
164 dering.c \
165 filter.c \
166 util.c
167
168 US_LIB_CSOURCES = \
169 dct.c \
170 internal.c \
171 generic_code.c \
172 switch_table.c \
173 logging.c \
174 info.c \
175 mc.c \
176 partition.c \
177 pvq.c \
178 state.c \
179 zigzag4.c \
180 zigzag8.c \
181 zigzag16.c \
182 zigzag32.c \
183 zigzag64.c
184
185 US_LDFLAGS = `pkg-config ogg libpng --libs` -lm
186
187 US_OBJS:=${US_LOCAL_CSOURCES} ${US_LIB_CSOURCES}
188 US_OBJS:=${US_OBJS:%.c=${WORKDIR}/%.o}
189 US_CSOURCES:=${US_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} ${US_LIB_CSOURCES:%=${LIBSRCDIR}/%}
190 US_TARGET:=upsample
191
192 #trans
193 T_LOCAL_CSOURCES = \
194 trans.c \
195 internal.c \
196 vidinput.c \
197 y4m_input.c \
198 od_filter.c \
199 trans_tools.c \
200 int_search.c \
201 trans_data.c \
202 kiss99.c \
203 svd.c \
204 cholesky.c \
205 tf.c
206
207 T_LIB_CSOURCES = \
208 filter.c \
209 dct.c
210
211 T_LDFLAGS = `pkg-config ogg libpng --libs` -lm
212
213 T_OBJS:=${T_LOCAL_CSOURCES} ${T_LIB_CSOURCES}
214 T_OBJS:=${T_OBJS:%.c=${WORKDIR}/%.o}
215 T_CSOURCES:=${T_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} ${T_LIB_CSOURCES:%=${LIBSRCDIR}/%}
216 T_TARGET:=trans
217
218 #trans_gain
219 TG_LOCAL_CSOURCES = \
220 trans_gain.c \
221 internal.c \
222 vidinput.c \
223 y4m_input.c \
224 od_filter.c \
225 trans_tools.c \
226 tf.c
227
228 TG_LIB_CSOURCES = \
229 filter.c \
230 dct.c
231
232 TG_LDFLAGS = `pkg-config ogg libpng --libs` -lm
233
234 TG_OBJS:=${TG_LOCAL_CSOURCES} ${TG_LIB_CSOURCES}
235 TG_OBJS:=${TG_OBJS:%.c=${WORKDIR}/%.o}
236 TG_CSOURCES:=${TG_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} ${TG_LIB_CSOURCES:%=${LIBSRCDIR}/%}
237 TG_TARGET:=trans_gain
238
239 #compute_basis
240 CBASIS_LOCAL_CSOURCES = \
241 compute_basis.c
242
243 CBASIS_LIB_CSOURCES = \
244 dct.c \
245 filter.c \
246 internal.c
247
248 CBASIS_LDFLAGS = `pkg-config ogg libpng --libs` -lm
249
250 CBASIS_OBJS:=${CBASIS_LOCAL_CSOURCES} ${CBASIS_LIB_CSOURCES}
251 CBASIS_OBJS:=${CBASIS_OBJS:%.c=${WORKDIR}/%.o}
252 CBASIS_CSOURCES:=${CBASIS_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} ${CBASIS_LIB_CSOURCES:%=${LIBSRCDIR}/%}
253 CBASIS_TARGET:=compute_basis
254
255 #compute_haar_basis
256 CHBASIS_LOCAL_CSOURCES = \
257 compute_haar_basis.c
258
259 CHBASIS_LIB_CSOURCES = \
260 dct.c \
261 filter.c \
262 internal.c
263
264 CHBASIS_LDFLAGS = `pkg-config ogg libpng --libs` -lm
265
266 CHBASIS_OBJS:=${CHBASIS_LOCAL_CSOURCES} ${CHBASIS_LIB_CSOURCES}
267 CHBASIS_OBJS:=${CHBASIS_OBJS:%.c=${WORKDIR}/%.o}
268 CHBASIS_CSOURCES:=${CHBASIS_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} ${CHBASIS_LIB_CSOURCES:%=${LIBSRCDIR}/%}
269 CHBASIS_TARGET:=compute_haar_basis
270
271 #cos_search
272 COS_SEARCH_LOCAL_CSOURCES = \
273 cos_search.c
274
275 COS_SEARCH_LDFLAGS = -lm
276
277 COS_SEARCH_OBJS:=${COS_SEARCH_LOCAL_CSOURCES}
278 COS_SEARCH_OBJS:=${COS_SEARCH_OBJS:%.c=${WORKDIR}/%.o}
279 COS_SEARCH_CSOURCES:=${COS_SEARCH_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%}
280 COS_SEARCH_TARGET:=cos_search
281
282 #trans2d
283 T2D_LOCAL_CSOURCES = \
284 trans2d.c \
285 internal.c \
286 vidinput.c \
287 y4m_input.c \
288 od_filter.c \
289 trans_tools.c \
290 int_search.c \
291 trans_data.c \
292 kiss99.c \
293 svd.c \
294 cholesky.c \
295 tf.c
296
297 T2D_LIB_CSOURCES = \
298 filter.c \
299 dct.c
300
301 T2D_LDFLAGS = `pkg-config ogg libpng --libs` -lm
302
303 T2D_OBJS:=${T2D_LOCAL_CSOURCES} ${T2D_LIB_CSOURCES}
304 T2D_OBJS:=${T2D_OBJS:%.c=${WORKDIR}/%.o}
305 T2D_CSOURCES:=${T2D_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} ${T2D_LIB_CSOURCES:%=${LIBSRCDIR}/%}
306 T2D_TARGET:=trans2d
307
308 #gen_cdf
309 GEN_CDF_LOCAL_CSOURCES = \
310 gen_cdf.c
311
312 GEN_CDF_LIB_CSOURCES =
313
314 GEN_CDF_LDFLAGS = -lm
315
316 GEN_CDF_OBJS:=${GEN_CDF_LOCAL_CSOURCES} ${GEN_CDF_LIB_CSOURCES}
317 GEN_CDF_OBJS:=${GEN_CDF_OBJS:%.c=${WORKDIR}/%.o}
318 GEN_CDF_CSOURCES:=${GEN_CDF_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} \
319  ${GEN_CDF_LIB_CSOURCES:%=${LIBSRCDIR}/%}
320 GEN_CDF_TARGET:=gen_cdf
321
322 #gen_sqrt_tbl
323 GEN_SQRT_TBL_LOCAL_CSOURCES = \
324 gen_sqrt_tbl.c
325
326 GEN_SQRT_TBL_LIB_CSOURCES =
327
328 GEN_SQRT_TBL_LDFLAGS = -lm
329
330 GEN_SQRT_TBL_OBJS:=${GEN_SQRT_TBL_LOCAL_CSOURCES} ${GEN_SQRT_TBL_LIB_CSOURCES}
331 GEN_SQRT_TBL_OBJS:=${GEN_SQRT_TBL_OBJS:%.c=${WORKDIR}/%.o}
332 GEN_SQRT_TBL_CSOURCES:=${GEN_SQRT_TBL_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} \
333  ${GEN_SQRT_TBL_LIB_CSOURCES:%=${LIBSRCDIR}/%}
334 GEN_SQRT_TBL_TARGET:=gen_sqrt_tbl
335
336 #gen_laplace_tables
337 GEN_LAPLACE_TABLES_LOCAL_CSOURCES = \
338 gen_laplace_tables.c
339
340 GEN_LAPLACE_TABLES_LIB_CSOURCES =
341
342 GEN_LAPLACE_TABLES_LDFLAGS = -lm
343
344 GEN_LAPLACE_TABLES_OBJS:=${GEN_LAPLACE_TABLES_LOCAL_CSOURCES} ${GEN_LAPLACE_TABLES_LIB_CSOURCES}
345 GEN_LAPLACE_TABLES_OBJS:=${GEN_LAPLACE_TABLES_OBJS:%.c=${WORKDIR}/%.o}
346 GEN_LAPLACE_TABLES_CSOURCES:= \
347  ${GEN_LAPLACE_TABLES_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} \
348  ${GEN_LAPLACE_TABLES_LIB_CSOURCES:%=${LIBSRCDIR}/%}
349 GEN_LAPLACE_TABLES_TARGET:=gen_laplace_tables
350
351 #bjontegaard
352 BD_LOCAL_CSOURCES = \
353 bjontegaard.c \
354 cholesky.c \
355 svd.c \
356 qr.c
357
358 BD_LIB_CSOURCES =
359
360 BD_LDFLAGS = -lm
361
362 BD_OBJS:=${BD_LOCAL_CSOURCES} ${BD_LIB_CSOURCES}
363 BD_OBJS:=${BD_OBJS:%.c=${WORKDIR}/%.o}
364 BD_CSOURCES:=${BD_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} \
365  ${BD_LIB_CSOURCES:%=${LIBSRCDIR}/%}
366 BD_TARGET:=bjontegaard
367
368 #yuvjpeg
369 YJ_LOCAL_CSOURCES = \
370 yuvjpeg.c
371
372 YJ_LIB_CSOURCES =
373
374 YJ_LDFLAGS = -ljpeg
375
376 YJ_OBJS:=${YJ_LOCAL_CSOURCES} ${YJ_LIB_CSOURCES}
377 YJ_OBJS:=${YJ_OBJS:%.c=${WORKDIR}/%.o}
378 YJ_CSOURCES:=${YJ_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} \
379  ${YJ_LIB_CSOURCES:%=${LIBSRCDIR}/%}
380 YJ_TARGET:=yuvjpeg
381
382 #jpegyuv
383 JY_LOCAL_CSOURCES = \
384 jpegyuv.c
385
386 JY_LIB_CSOURCES =
387
388 JY_LDFLAGS = -ljpeg
389
390 JY_OBJS:=${JY_LOCAL_CSOURCES} ${JY_LIB_CSOURCES}
391 JY_OBJS:=${JY_OBJS:%.c=${WORKDIR}/%.o}
392 JY_CSOURCES:=${JY_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} \
393  ${JY_LIB_CSOURCES:%=${LIBSRCDIR}/%}
394 JY_TARGET:=jpegyuv
395
396 #draw_zigzags
397 DZZ_LOCAL_CSOURCES = \
398 draw_zigzags.c
399
400 DZZ_LIB_CSOURCES = \
401 zigzag4.c \
402 zigzag8.c \
403 zigzag16.c \
404 zigzag32.c \
405 zigzag64.c
406
407 DZZ_LDFLAGS =
408
409 DZZ_OBJS:=${DZZ_LOCAL_CSOURCES} ${DZZ_LIB_CSOURCES}
410 DZZ_OBJS:=${DZZ_OBJS:%.c=${WORKDIR}/%.o}
411 DZZ_CSOURCES:=${DZZ_LOCAL_CSOURCES:%=${LOCALSRCDIR}/%} \
412  ${DZZ_LIB_CSOURCES:%=${LIBSRCDIR}/%}
413 DZZ_TARGET:=draw_zigzags
414
415 ALL_OBJS:=${P2Y_OBJS} ${Y2P_OBJS} ${PSNR_OBJS} ${PSNRHVS_OBJS} \
416  ${GEN_CDF_OBJS} ${GEN_LAPLACE_TABLES_OBJS} ${T_OBJS} \
417  ${TG_OBJS} ${CBASIS_OBJS} ${CHBASIS_OBJS} ${COS_SEARCH_OBJS} ${T2D_OBJS} \
418  ${BSIZE_OBJS} ${BD_OBJS} ${YJ_OBJS} ${JY_OBJS} ${DZZ_OBJS} ${MONO_OBJS} \
419  ${DS_OBJS} ${US_OBJS}
420
421 ALL_ASMS:=${ALL_OBJS:%.o=%.s}
422
423 ALL_DEPS:=${ALL_OBJS:%.o=%.d}
424
425 ALL_TARGETS:=${P2Y_TARGET} ${Y2P_TARGET} ${PSNR_TARGET} ${PSNRHVS_TARGET} \
426  ${GEN_CDF_TARGET} ${GEN_LAPLACE_TABLES_TARGET} ${T_TARGET} \
427  ${TG_TARGET} ${CBASIS_TARGET} ${CHBASIS_TARGET} ${COS_SEARCH_TARGET} \
428  ${T2D_TARGET} ${BSIZE_TARGET} ${BD_TARGET} ${YJ_TARGET} ${JY_TARGET} \
429  ${DZZ_TARGET} ${MONO_TARGET} ${DS_TARGET} ${US_TARGET}
430
431 all: ${ALL_TARGETS}
432
433 asm: ${ALL_ASM}
434
435 check: all
436
437 clean:
438         ${RM} ${ALL_ASM} ${ALL_OBJS} ${ALL_DEPS}
439         ${RM} ${ALL_TARGETS}
440         -rmdir ${WORKDIR}
441
442 ${BSIZE_TARGET}: ${BSIZE_OBJS}
443         ${CC} ${CFLAGS} ${BSIZE_OBJS} ${BSIZE_LDFLAGS} -o $@
444
445 ${P2Y_TARGET}: ${P2Y_OBJS}
446         ${CC} ${CFLAGS} ${P2Y_OBJS} ${P2Y_LDFLAGS} -o $@
447
448 ${Y2P_TARGET}: ${Y2P_OBJS}
449         ${CC} ${CFLAGS} ${Y2P_OBJS} ${Y2P_LDFLAGS} -o $@
450
451 ${PSNR_TARGET}: ${PSNR_OBJS}
452         ${CC} ${CFLAGS} ${PSNR_OBJS} ${PSNR_LDFLAGS} -o $@
453
454 ${PSNRHVS_TARGET}: ${PSNRHVS_OBJS}
455         ${CC} ${CFLAGS} ${PSNRHVS_OBJS} ${PSNRHVS_LDFLAGS} -o $@
456
457 ${T_TARGET}: ${T_OBJS}
458         ${CC} ${CFLAGS} ${T_OBJS} ${T_LDFLAGS} -o $@
459
460 ${TG_TARGET}: ${TG_OBJS}
461         ${CC} ${CFLAGS} ${TG_OBJS} ${TG_LDFLAGS} -o $@
462
463 ${CBASIS_TARGET}: ${CBASIS_OBJS}
464         ${CC} ${CFLAGS} ${CBASIS_OBJS} ${CBASIS_LDFLAGS} -o $@
465
466 ${CHBASIS_TARGET}: ${CHBASIS_OBJS}
467         ${CC} ${CFLAGS} ${CHBASIS_OBJS} ${CHBASIS_LDFLAGS} -o $@
468
469 ${COS_SEARCH_TARGET}: ${COS_SEARCH_OBJS}
470         ${CC} ${CFLAGS} ${COS_SEARCH_OBJS} ${COS_SEARCH_LDFLAGS} -o $@
471
472 ${T2D_TARGET}: ${T2D_OBJS}
473         ${CC} ${CFLAGS} ${T2D_OBJS} ${T2D_LDFLAGS} -o $@
474
475 ${GEN_CDF_TARGET}: ${GEN_CDF_OBJS}
476         ${CC} ${CFLAGS} ${GEN_CDF_OBJS} ${GEN_CDF_LDFLAGS} -o $@
477
478 ${GEN_LAPLACE_TABLES_TARGET}: ${GEN_LAPLACE_TABLES_OBJS}
479         ${CC} ${CFLAGS} ${GEN_LAPLACE_TABLES_OBJS} ${GEN_LAPLACE_TABLES_LDFLAGS} -o $@
480
481 ${BD_TARGET}: ${BD_OBJS}
482         ${CC} ${CFLAGS} ${BD_OBJS} ${BD_LDFLAGS} -o $@
483
484 ${YJ_TARGET}: ${YJ_OBJS}
485         ${CC} ${CFLAGS} ${YJ_OBJS} ${YJ_LDFLAGS} -o $@
486
487 ${JY_TARGET}: ${JY_OBJS}
488         ${CC} ${CFLAGS} ${JY_OBJS} ${JY_LDFLAGS} -o $@
489
490 ${DZZ_TARGET}: ${DZZ_OBJS}
491         ${CC} ${CFLAGS} ${DZZ_OBJS} ${DZZ_LDFLAGS} -o $@
492
493 ${MONO_TARGET}: ${MONO_OBJS}
494         ${CC} ${CFLAGS} ${MONO_OBJS} ${MONO_LDFLAGS} -o $@
495
496 ${DS_TARGET}: ${DS_OBJS}
497         ${CC} ${CFLAGS} ${DS_OBJS} ${DS_LDFLAGS} -o $@
498
499 ${US_TARGET}: ${US_OBJS}
500         ${CC} ${CFLAGS} ${US_OBJS} ${US_LDFLAGS} -o $@
501
502 ${ALL_OBJS} ${ALL_ASMS} ${ALL_DEPS} ${ALL_TARGETS}: Makefile
503
504 .PHONY: all asm clean check
505
506 ${WORKDIR}/%.d: ${LIBSRCDIR}/%.c
507         mkdir -p ${dir $@}
508         ${MAKEDEPEND} ${CINCLUDE} ${CFLAGS} $< -MT ${@:%.d=%.o} > $@
509         ${MAKEDEPEND} ${CINCLUDE} ${CFLAGS} $< -MT ${@:%.d=%.s} >> $@
510         ${MAKEDEPEND} ${CINCLUDE} ${CFLAGS} $< -MT $@ >> $@
511 ${WORKDIR}/%.s: ${LIBSRCDIR}/%.c
512         mkdir -p ${dir $@}
513         ${CC} ${CINCLUDE} ${CFLAGS} -S -o $@ $<
514 ${WORKDIR}/%.o: ${LIBSRCDIR}/%.c
515         mkdir -p ${dir $@}
516         ${CC} ${CINCLUDE} ${CFLAGS} -c -o $@ $<
517
518 ${WORKDIR}/%.d: ${LOCALSRCDIR}/%.c
519         mkdir -p ${dir $@}
520         ${MAKEDEPEND} ${CINCLUDE} ${CFLAGS} $< -MT ${@:%.d=%.o} > $@
521         ${MAKEDEPEND} ${CINCLUDE} ${CFLAGS} $< -MT ${@:%.d=%.s} >> $@
522         ${MAKEDEPEND} ${CINCLUDE} ${CFLAGS} $< -MT $@ >> $@
523 ${WORKDIR}/%.s: ${LOCALSRCDIR}/%.c
524         mkdir -p ${dir $@}
525         ${CC} ${CINCLUDE} ${CFLAGS} -S -o $@ $<
526 ${WORKDIR}/%.o: ${LOCALSRCDIR}/%.c
527         mkdir -p ${dir $@}
528         ${CC} ${CINCLUDE} ${CFLAGS} -c -o $@ $<
529
530 # Include header file dependencies
531 include ${ALL_DEPS}