New makefile solution: A single invocation of 'make' to build the entire tree. Fully...
[kugel-rb.git] / tools / Makefile
blob569a727139a7a70e19660c7651182235aa09b369
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
7 # $Id$
9 CFLAGS := -O -g -W -Wall -Wshadow -pedantic
10 LDFLAGS := -g
12 .PHONY: rbspeexenc uclpack
14 CLEANALL := scramble descramble iriver sh2d bmp2rb rdf2binary convbdf \
15 generate_rocklatin mkboot ipod_fw codepages uclpack mi4 gigabeat database \
16 lngdump telechips gigabeats creative hmac-sha1 mktccboot mknkboot rbspeexenc mkzenboot
18 all: scramble descramble sh2d rdf2binary mkboot mktccboot mknkboot mkzenboot \
19 convbdf codepages uclpack rbspeexenc voicefont
21 scramble: scramble.o iriver.o mi4.o gigabeat.o gigabeats.o telechips.o iaudio_bl_flash.o creative.o hmac-sha1.o
22 descramble: descramble.o iriver.o gigabeat.o
23 scramble.o: scramble.c iriver.h mi4.h gigabeat.h telechips.h iaudio_bl_flash.h creative.h
25 descramble.o: descramble.c iriver.h gigabeat.h
26 creative.o: creative.c creative.h
27 hmac-sha1.o: hmac-sha1.c hmac-sha1.h
28 iriver.o: iriver.c iriver.h
29 gigabeat.o: gigabeat.c gigabeat.h
30 gigabeats.o: gigabeats.c gigabeats.h
31 mi4.o: mi4.c mi4.h
32 telechips.o: telechips.c telechips.h
33 iaudio_bl_flash.o: iaudio_bl_flash.c iaudio_bl_flash.h
34 iaudio_bl_flash.c iaudio_bl_flash.h: iaudio_bl_flash.bmp bmp2rb
35 $(SILENT)./bmp2rb -f 7 -h . $< >iaudio_bl_flash.c
37 sh2d: sh2d.c
39 bmp2rb: bmp2rb.c
40 $(SILENT)$(CC) -DAPPLICATION_NAME=\"$@\" $(CFLAGS) $+ -o $@
42 rdf2binary: rdf2binary.c
43 $(SILENT)$(CC) $(CFLAGS) $+ -o $@
45 mkboot: mkboot.c
46 $(SILENT)$(CC) $(CFLAGS) $+ -o $@
48 mktccboot: mktccboot.c telechips.o
49 $(SILENT)$(CC) $(CFLAGS) $+ -o $@
51 mknkboot: mknkboot.c
52 $(SILENT)$(CC) $(CFLAGS) $+ -o $@
54 mkzenboot.o: mkzenboot.c
55 $(SILENT)$(CC) $(CFLAGS) -DSTANDALONE -c -o $@ $+
57 mkzenboot: mkzenboot.o hmac-sha1.o
58 $(SILENT)$(CC) $(LDFLAGS) -lz $+ -o $@
60 mkzenboot.exe: mkzenboot.o hmac-sha1.o
61 $(SILENT)$(CC) $(LDFLAGS) -lz $+ C:\MingW\lib\libz.a -o $@
63 lngdump: lngdump.c
64 $(SILENT)$(CC) $(CFLAGS) $+ -o $@
66 ipod_fw: ipod_fw.c
67 $(SILENT)$(CC) $(CFLAGS) $+ -o $@
69 database: database.c ../apps/tagcache.c ../apps/metadata.c \
70 ../firmware/id3.c ../firmware/common/unicode.c \
71 ../firmware/common/crc32.c ../uisimulator/common/io.c \
72 ../firmware/mp3data.c ../firmware/logf.c ../firmware/replaygain.c \
73 ../firmware/common/structec.c
74 $(SILENT)$(CC) $(CFLAGS) -I../firmware/export -iquote ../firmware/include \
75 -D__PCTOOL__ -DHAVE_TAGCACHE -DROCKBOX_HAS_LOGF -DSIMULATOR \
76 -DCONFIG_CODEC=1 -ldl -I../apps $+ -o $@
78 checkwps: checkwps.c ../apps/gui/wps_parser.c ../apps/gui/wps_debug.c ../firmware/common/ctype.c ../apps/misc.c ../apps/recorder/bmp.c
79 $(SILENT)$(CC) $(CFLAGS) -I ../apps/gui -I../firmware/export \
80 -D__PCTOOL__ -DDEBUG -DROCKBOX_HAS_LOGF -DIPOD_COLOR -D ROCKBOX_DIR_LEN -D WPS_DIR=\".\" \
81 -I../apps -I../firmware/target/arm/ipod -I../firmware/include $+ -o $@
83 convbdf: convbdf.c
84 $(SILENT)$(CC) $(CFLAGS) $+ -o $@
86 codepages: codepages.c codepage_tables.c
87 $(SILENT)$(CC) $(CFLAGS) $+ -o $@
89 player_unifont: player_unifont.c ../firmware/drivers/lcd-charset-player.c
90 $(SILENT)$(CC) -DARCHOS_PLAYER -D__PCTOOL__ -I../firmware/export $+ -o $@
92 uclpack:
93 $(SILENT)$(MAKE) -C ucl
95 rbspeexenc:
96 $(SILENT)$(MAKE) -C rbspeex
98 wavtrim: wavtrim.c
99 $(SILENT)$(CC) $(CFLAGS) $+ -o $@
101 voicefont: voicefont.c
102 $(SILENT)$(CC) $(CFLAGS) $+ -o $@
104 usb_benchmark: usb_benchmark.c
105 $(SILENT)$(CC) $(CFLAGS) -lusb $+ -o $@
107 clean:
108 @echo "Cleaning tools"
109 $(SILENT)rm -f $(CLEANALL) $(shell for f in $(CLEANALL) ; do echo $$f.exe $$f.o $$f.obj ; done) *.ajf *~
110 $(SILENT)$(MAKE) -C ucl clean
111 $(SILENT)$(MAKE) -C rbspeex clean