blob: e74e26701b6c3cc2d227d15303c301f1b4814ce8 [file] [log] [blame]
Frank Gevaerts5d22e3c2008-08-29 21:08:38 +00001# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9ROOT=../../..
10
Maurus Cuelenaere561df382008-09-04 14:49:53 +000011ifneq ($or($(findstring MINGW,$(shell uname)),$(findstring Windows_NT,$(OS))),)
Dominik Wenger254fa652008-09-03 19:24:50 +000012 OS = w32
13 CC = mingw32-gcc
Maurus Cuelenaere16c9b162008-09-04 15:19:59 +000014 COPY = copy /Y
15 COPY_TO = ..\\gui\\bin
Maurus Cuelenaere561df382008-09-04 14:49:53 +000016 RM = del
17 EXT = .dll
18 LDFLAGS = -DBUILD_DLL
Frank Gevaerts5d22e3c2008-08-29 21:08:38 +000019endif
20
21ifeq ($(findstring Linux,$(shell uname)),Linux)
Dominik Wenger254fa652008-09-03 19:24:50 +000022 OS = linux
23 CC = gcc
Maurus Cuelenaere16c9b162008-09-04 15:19:59 +000024 COPY = cp -f
25 COPY_TO = ../gui/bin
Dominik Wenger254fa652008-09-03 19:24:50 +000026 RM = rm -f
Maurus Cuelenaere561df382008-09-04 14:49:53 +000027 EXT = .so
28 LDFLAGS = -fPIC
Frank Gevaerts5d22e3c2008-08-29 21:08:38 +000029endif
30
Maurus Cuelenaere561df382008-09-04 14:49:53 +000031TARGETS=IRIVER_H10 \
32 IRIVER_H10_5GB \
33 IPOD_COLOR \
34 IPOD_NANO \
35 IPOD_VIDEO \
Dominik Wenger66b211a2008-09-05 18:57:47 +000036 IPOD_3G \
37 IPOD_4G \
38 IPOD_MINI \
39 IPOD_MINI2G \
40 IPOD_1G2G \
Maurus Cuelenaere561df382008-09-04 14:49:53 +000041 GIGABEAT_F \
42 GIGABEAT_S \
43 SANSA_E200 \
Dominik Wenger66b211a2008-09-05 18:57:47 +000044 SANSA_C200 \
45 IRIVER_H100 \
46 IRIVER_H120 \
47 IRIVER_H300 \
48 IAUDIO_X5 \
49 IAUDIO_M5 \
50 IAUDIO_M3 \
51
Dominik Wenger254fa652008-09-03 19:24:50 +000052SOURCES= \
Maurus Cuelenaere561df382008-09-04 14:49:53 +000053 src/api.c \
54 src/dummies.c \
55 src/lcd.c \
56 src/proxy.c \
57 $(ROOT)/apps/gui/scrollbar.c \
Jonathan Gordonc6b19612009-07-27 07:34:50 +000058 $(ROOT)/apps/gui/music_screen.c \
59 $(ROOT)/apps/gui/wps_engine/wps_display.c \
60 $(ROOT)/apps/gui/wps_engine/wps_tokens.c \
61 $(ROOT)/apps/gui/wps_engine/wps_parser.c \
62 $(ROOT)/apps/gui/wps_parser/wps_debug.c \
Maurus Cuelenaere561df382008-09-04 14:49:53 +000063 $(ROOT)/apps/recorder/peakmeter.c \
64 $(ROOT)/apps/recorder/icons.c \
65 $(ROOT)/apps/misc.c \
66 $(ROOT)/apps/status.c \
67 $(ROOT)/firmware/common/ctype.c \
68 $(ROOT)/firmware/common/timefuncs.c \
69 $(ROOT)/firmware/common/unicode.c \
70 $(ROOT)/firmware/font.c \
71 $(ROOT)/firmware/font_cache.c \
72 $(ROOT)/firmware/id3.c \
73 $(ROOT)/firmware/lru.c \
74 $(ROOT)/firmware/mp3data.c \
75 $(ROOT)/firmware/replaygain.c
76# $(ROOT)/apps/recorder/bmp.c
77# $(ROOT)/apps/abrepeat.c \
78# $(ROOT)/apps/action.c \
79# $(ROOT)/apps/cuesheet.c \
80# $(ROOT)/apps/gui/statusbar.c \
81# $(ROOT)/apps/gui/gwps.c \
Frank Gevaerts5d22e3c2008-08-29 21:08:38 +000082
83INCLUDE=-I src/include \
84 -I $(ROOT)/apps/gui \
85 -I $(ROOT)/firmware/export \
86 -I $(ROOT)/firmware/include \
87 -I $(ROOT)/apps/recorder \
88 -I $(ROOT)/apps \
89 -I src
90
Frank Gevaerts6ea90672008-09-04 21:05:16 +000091CFLAGS = -g -Wall -Wno-format -D__PCTOOL__ -DWPSEDITOR -DDEBUG -DROCKBOX_DIR_LEN=1 -DBUTTON_REMOTE
Frank Gevaerts5d22e3c2008-08-29 21:08:38 +000092
Maurus Cuelenaere561df382008-09-04 14:49:53 +000093RESULTS := $(patsubst %,libwps_%$(EXT),$(TARGETS))
Frank Gevaerts5d22e3c2008-08-29 21:08:38 +000094
Maurus Cuelenaere561df382008-09-04 14:49:53 +000095all: $(RESULTS)
Frank Gevaerts5d22e3c2008-08-29 21:08:38 +000096
Maurus Cuelenaere561df382008-09-04 14:49:53 +000097libwps_%$(EXT): $(SOURCES)
98 @echo CC [$(subst libwps_,,$(subst $(EXT),,$@))]
99 @$(CC) $(INCLUDE) $(CFLAGS) -D$(subst libwps_,,$(subst $(EXT),,$@)) $(LDFLAGS) -shared -o $@ $+
Maurus Cuelenaere16c9b162008-09-04 15:19:59 +0000100 @$(COPY) $@ $(COPY_TO)
Frank Gevaerts5d22e3c2008-08-29 21:08:38 +0000101
Maurus Cuelenaere561df382008-09-04 14:49:53 +0000102clean:
103 $(RM) $(RESULTS)