summaryrefslogtreecommitdiffstats
path: root/utils/wpseditor/libwps/Makefile
blob: ef893927e353eeb8e7e9652ac3be9a0dde4bea10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#             __________               __   ___.
#   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
#   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
#   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
#   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
#                     \/            \/     \/    \/            \/
# $Id$
#
ROOT=../../..

ifneq ($or($(findstring MINGW,$(shell uname)),$(findstring Windows_NT,$(OS))),)
  OS = w32
  CC = mingw32-gcc
  COPY = copy /Y
  COPY_TO = ..\\gui\\bin
  RM = del
  EXT = .dll
  LDFLAGS = -DBUILD_DLL
endif

ifeq ($(findstring Linux,$(shell uname)),Linux)
  OS = linux
  CC = gcc
  COPY = cp -f
  COPY_TO = ../gui/bin
  RM = rm -f
  EXT = .so
  LDFLAGS = -fPIC
endif

TARGETS=IRIVER_H10 \
        IRIVER_H10_5GB \
        IPOD_COLOR \
        IPOD_NANO \
        IPOD_VIDEO \
        GIGABEAT_F \
        GIGABEAT_S \
        SANSA_E200 \
        SANSA_C200

SOURCES= \
        src/api.c \
        src/dummies.c \
        src/lcd.c \
        src/proxy.c \
        $(ROOT)/apps/gui/scrollbar.c \
        $(ROOT)/apps/gui/gwps-common.c \
        $(ROOT)/apps/gui/wps_parser.c \
        $(ROOT)/apps/gui/wps_debug.c \
        $(ROOT)/apps/recorder/peakmeter.c \
        $(ROOT)/apps/recorder/icons.c \
        $(ROOT)/apps/misc.c \
        $(ROOT)/apps/status.c \
        $(ROOT)/firmware/common/ctype.c \
        $(ROOT)/firmware/common/timefuncs.c \
        $(ROOT)/firmware/common/unicode.c \
        $(ROOT)/firmware/font.c \
        $(ROOT)/firmware/font_cache.c \
        $(ROOT)/firmware/id3.c \
        $(ROOT)/firmware/lru.c \
        $(ROOT)/firmware/mp3data.c \
        $(ROOT)/firmware/replaygain.c 
#        $(ROOT)/apps/recorder/bmp.c
#        $(ROOT)/apps/abrepeat.c \
#        $(ROOT)/apps/action.c \
#        $(ROOT)/apps/cuesheet.c \
#        $(ROOT)/apps/gui/statusbar.c \
#        $(ROOT)/apps/gui/gwps.c \

INCLUDE=-I src/include \
        -I $(ROOT)/apps/gui \
        -I $(ROOT)/firmware/export \
        -I $(ROOT)/firmware/include \
        -I $(ROOT)/apps/recorder \
        -I $(ROOT)/apps \
        -I src

CFLAGS = -g -Wall -Wno-format -Wno-pointer-sign -D__PCTOOL__ -DWPSEDITOR -DDEBUG -DROCKBOX_DIR_LEN=1 -DBUTTON_REMOTE 

RESULTS := $(patsubst %,libwps_%$(EXT),$(TARGETS))

all: $(RESULTS)

libwps_%$(EXT): $(SOURCES)
	@echo CC [$(subst libwps_,,$(subst $(EXT),,$@))]
	@$(CC) $(INCLUDE) $(CFLAGS) -D$(subst libwps_,,$(subst $(EXT),,$@)) $(LDFLAGS) -shared -o $@ $+
	@$(COPY) $@ $(COPY_TO)

clean:
	$(RM) $(RESULTS)