summaryrefslogtreecommitdiff
path: root/utils/wpseditor/libwps
diff options
context:
space:
mode:
Diffstat (limited to 'utils/wpseditor/libwps')
-rw-r--r--utils/wpseditor/libwps/Makefile113
-rw-r--r--utils/wpseditor/libwps/buildall.bat4
-rwxr-xr-xutils/wpseditor/libwps/buildall.sh9
-rw-r--r--utils/wpseditor/libwps/cleanall.sh7
-rw-r--r--utils/wpseditor/libwps/src/proxy.c4
-rw-r--r--utils/wpseditor/libwps/targets.txt9
6 files changed, 52 insertions, 94 deletions
diff --git a/utils/wpseditor/libwps/Makefile b/utils/wpseditor/libwps/Makefile
index c5d0a39de1..879cc8e4db 100644
--- a/utils/wpseditor/libwps/Makefile
+++ b/utils/wpseditor/libwps/Makefile
@@ -8,15 +8,13 @@
8# 8#
9ROOT=../../.. 9ROOT=../../..
10 10
11OS = w32 11ifneq ($or($(findstring MINGW,$(shell uname)),$(findstring Windows_NT,$(OS))),)
12CC = gcc
13MKDIR = mkdir -p
14
15ifeq ($(findstring MINGW,$(shell uname)),MINGW)
16 OS = w32 12 OS = w32
17 CC = mingw32-gcc 13 CC = mingw32-gcc
18 COPY = copy 14 COPY = copy
19 RM = rm 15 RM = del
16 EXT = .dll
17 LDFLAGS = -DBUILD_DLL
20endif 18endif
21 19
22ifeq ($(findstring Linux,$(shell uname)),Linux) 20ifeq ($(findstring Linux,$(shell uname)),Linux)
@@ -24,39 +22,48 @@ ifeq ($(findstring Linux,$(shell uname)),Linux)
24 CC = gcc 22 CC = gcc
25 COPY = cp 23 COPY = cp
26 RM = rm -f 24 RM = rm -f
25 EXT = .so
26 LDFLAGS = -fPIC
27endif 27endif
28 28
29 29TARGETS=IRIVER_H10 \
30 IRIVER_H10_5GB \
31 IPOD_COLOR \
32 IPOD_NANO \
33 IPOD_VIDEO \
34 GIGABEAT_F \
35 GIGABEAT_S \
36 SANSA_E200 \
37 SANSA_C200
30 38
31SOURCES= \ 39SOURCES= \
32 src/api.c \ 40 src/api.c \
33 src/dummies.c \ 41 src/dummies.c \
34 src/lcd.c \ 42 src/lcd.c \
35 src/proxy.c \ 43 src/proxy.c \
36 $(ROOT)/apps/gui/scrollbar.c \ 44 $(ROOT)/apps/gui/scrollbar.c \
37 $(ROOT)/apps/gui/gwps-common.c \ 45 $(ROOT)/apps/gui/gwps-common.c \
38 $(ROOT)/apps/gui/wps_parser.c \ 46 $(ROOT)/apps/gui/wps_parser.c \
39 $(ROOT)/apps/gui/wps_debug.c \ 47 $(ROOT)/apps/gui/wps_debug.c \
40 $(ROOT)/apps/recorder/peakmeter.c \ 48 $(ROOT)/apps/recorder/peakmeter.c \
41 $(ROOT)/apps/recorder/icons.c \ 49 $(ROOT)/apps/recorder/icons.c \
42 $(ROOT)/apps/misc.c \ 50 $(ROOT)/apps/misc.c \
43 $(ROOT)/apps/status.c \ 51 $(ROOT)/apps/status.c \
44 $(ROOT)/firmware/common/ctype.c \ 52 $(ROOT)/firmware/common/ctype.c \
45 $(ROOT)/firmware/common/timefuncs.c \ 53 $(ROOT)/firmware/common/timefuncs.c \
46 $(ROOT)/firmware/common/unicode.c \ 54 $(ROOT)/firmware/common/unicode.c \
47 $(ROOT)/firmware/font.c \ 55 $(ROOT)/firmware/font.c \
48 $(ROOT)/firmware/font_cache.c \ 56 $(ROOT)/firmware/font_cache.c \
49 $(ROOT)/firmware/id3.c \ 57 $(ROOT)/firmware/id3.c \
50 $(ROOT)/firmware/lru.c \ 58 $(ROOT)/firmware/lru.c \
51 $(ROOT)/firmware/mp3data.c \ 59 $(ROOT)/firmware/mp3data.c \
52 $(ROOT)/firmware/replaygain.c 60 $(ROOT)/firmware/replaygain.c
53 61# $(ROOT)/apps/recorder/bmp.c
54# $(ROOT)/apps/recorder/bmp.c 62# $(ROOT)/apps/abrepeat.c \
55# $(ROOT)/apps/abrepeat.c \ 63# $(ROOT)/apps/action.c \
56# $(ROOT)/apps/action.c \ 64# $(ROOT)/apps/cuesheet.c \
57# $(ROOT)/apps/cuesheet.c \ 65# $(ROOT)/apps/gui/statusbar.c \
58# $(ROOT)/apps/gui/statusbar.c \ 66# $(ROOT)/apps/gui/gwps.c \
59# $(ROOT)/apps/gui/gwps.c \
60 67
61INCLUDE=-I src/include \ 68INCLUDE=-I src/include \
62 -I $(ROOT)/apps/gui \ 69 -I $(ROOT)/apps/gui \
@@ -68,34 +75,14 @@ INCLUDE=-I src/include \
68 75
69CFLAGS = -g -Wall -D__PCTOOL__ -DWPSEDITOR -DDEBUG -DROCKBOX_DIR_LEN=1 -DBUTTON_REMOTE 76CFLAGS = -g -Wall -D__PCTOOL__ -DWPSEDITOR -DDEBUG -DROCKBOX_DIR_LEN=1 -DBUTTON_REMOTE
70 77
71all: 78RESULTS := $(patsubst %,libwps_%$(EXT),$(TARGETS))
72 @echo To build, run the buildall.sh script
73
74build: build-$(OS)
75
76build-w32: $(SOURCES)
77 @echo CC [$(TARGET)]
78 @$(CC) $(INCLUDE) $(CFLAGS) -D$(TARGET) -DTARGET_MODEL=\"$(MODEL)\" -DBUILD_DLL $(SOURCES) -shared -o libwps_$(MODEL).dll
79
80build-linux: $(SOURCES)
81 @echo CC [$(TARGET)]
82 @$(CC) $(INCLUDE) $(CFLAGS) -D$(TARGET) -DTARGET_MODEL=\"$(MODEL)\" -shared -Wl,-soname,libwps_$(MODEL).so,-olibwps_$(MODEL).so -fPIC $(SOURCES)
83
84clean: clean-$(OS)
85
86clean-w32:
87 $(RM) "libwps_$(MODEL).dll"
88
89clean-linux:
90 $(RM) "libwps_$(MODEL).so"
91 79
92shared: shared-$(OS) 80all: $(RESULTS)
81 @$(COPY) $(RESULTS) ../gui/bin/
93 82
94shared-w32: $(SOURCES) 83libwps_%$(EXT): $(SOURCES)
95 @echo CC [IRIVER_H10_5GB] 84 @echo CC [$(subst libwps_,,$(subst $(EXT),,$@))]
96 @$(CC) $(INCLUDE) $(CFLAGS) -DIRIVER_H10_5GB -DTARGET_MODEL=\"h10_5gb\" -DBUILD_DLL -shared $(SOURCES) -o ../gui/bin/libwps_h10_5gb.dll 85 @$(CC) $(INCLUDE) $(CFLAGS) -D$(subst libwps_,,$(subst $(EXT),,$@)) $(LDFLAGS) -shared -o $@ $+
97 86
98shared-linux: $(SOURCES) 87clean:
99 @echo CC [IRIVER_H10_5GB] 88 $(RM) $(RESULTS)
100 @$(CC) $(INCLUDE) $(CFLAGS) -DIRIVER_H10_5GB -DTARGET_MODEL=\"h10_5gb\" -shared -Wl,-soname,libwps_h10_5gb.so,-olibwps_h10_5gb.so -fPIC $(SOURCES)
101 @$(COPY) libwps_h10_5gb.so ../gui/bin/libwps_h10_5gb.so
diff --git a/utils/wpseditor/libwps/buildall.bat b/utils/wpseditor/libwps/buildall.bat
deleted file mode 100644
index fb66b41904..0000000000
--- a/utils/wpseditor/libwps/buildall.bat
+++ /dev/null
@@ -1,4 +0,0 @@
1@echo off
2FOR /F "tokens=1,2* delims=, " %%i in (targets.txt) do @mingw32-make MODEL=%%j TARGET=%%i build 2>nul
3echo Copying files...
4xcopy /I /Y *.dll ..\gui\bin
diff --git a/utils/wpseditor/libwps/buildall.sh b/utils/wpseditor/libwps/buildall.sh
deleted file mode 100755
index 0f32bb9b9a..0000000000
--- a/utils/wpseditor/libwps/buildall.sh
+++ /dev/null
@@ -1,9 +0,0 @@
1#!/bin/sh
2cat targets.txt | (
3 while read target model
4 do
5 make MODEL=$model TARGET=$target build
6 done
7 cp *.dll ../gui/bin
8 cp *.so ../gui/bin
9)
diff --git a/utils/wpseditor/libwps/cleanall.sh b/utils/wpseditor/libwps/cleanall.sh
deleted file mode 100644
index 15b733a6a7..0000000000
--- a/utils/wpseditor/libwps/cleanall.sh
+++ /dev/null
@@ -1,7 +0,0 @@
1#!/bin/sh
2cat targets.txt | (
3 while read target model
4 do
5 make MODEL=$model TARGET=$target clean
6 done
7)
diff --git a/utils/wpseditor/libwps/src/proxy.c b/utils/wpseditor/libwps/src/proxy.c
index 8f9218e3ff..1e4804cd11 100644
--- a/utils/wpseditor/libwps/src/proxy.c
+++ b/utils/wpseditor/libwps/src/proxy.c
@@ -23,8 +23,8 @@ pfdebugf dbgf = 0;
23static char pluginbuf[PLUGIN_BUFFER_SIZE]; 23static char pluginbuf[PLUGIN_BUFFER_SIZE];
24 24
25const char* get_model_name(){ 25const char* get_model_name(){
26#ifdef TARGET_MODEL 26#ifdef MODEL_NAME
27 return TARGET_MODEL; 27 return MODEL_NAME;
28#else 28#else
29 return "unknown"; 29 return "unknown";
30#endif 30#endif
diff --git a/utils/wpseditor/libwps/targets.txt b/utils/wpseditor/libwps/targets.txt
deleted file mode 100644
index 547a2ba42c..0000000000
--- a/utils/wpseditor/libwps/targets.txt
+++ /dev/null
@@ -1,9 +0,0 @@
1IRIVER_H10 h10
2IRIVER_H10_5GB h10_5gb
3IPOD_COLOR ipodcolor
4IPOD_NANO ipodnano
5IPOD_VIDEO ipodvideo
6GIGABEAT_F gigabeatf
7GIGABEAT_S gigabeats
8SANSA_E200 e200
9SANSA_C200 c200