summaryrefslogtreecommitdiffstats
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 @@
#
ROOT=../../..
-OS = w32
-CC = gcc
-MKDIR = mkdir -p
-
-ifeq ($(findstring MINGW,$(shell uname)),MINGW)
+ifneq ($or($(findstring MINGW,$(shell uname)),$(findstring Windows_NT,$(OS))),)
OS = w32
CC = mingw32-gcc
COPY = copy
- RM = rm
+ RM = del
+ EXT = .dll
+ LDFLAGS = -DBUILD_DLL
endif
ifeq ($(findstring Linux,$(shell uname)),Linux)
@@ -24,39 +22,48 @@ ifeq ($(findstring Linux,$(shell uname)),Linux)
CC = gcc
COPY = cp
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 \
+ 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 \
@@ -68,34 +75,14 @@ INCLUDE=-I src/include \
CFLAGS = -g -Wall -D__PCTOOL__ -DWPSEDITOR -DDEBUG -DROCKBOX_DIR_LEN=1 -DBUTTON_REMOTE
-all:
- @echo To build, run the buildall.sh script
-
-build: build-$(OS)
-
-build-w32: $(SOURCES)
- @echo CC [$(TARGET)]
- @$(CC) $(INCLUDE) $(CFLAGS) -D$(TARGET) -DTARGET_MODEL=\"$(MODEL)\" -DBUILD_DLL $(SOURCES) -shared -o libwps_$(MODEL).dll
-
-build-linux: $(SOURCES)
- @echo CC [$(TARGET)]
- @$(CC) $(INCLUDE) $(CFLAGS) -D$(TARGET) -DTARGET_MODEL=\"$(MODEL)\" -shared -Wl,-soname,libwps_$(MODEL).so,-olibwps_$(MODEL).so -fPIC $(SOURCES)
-
-clean: clean-$(OS)
-
-clean-w32:
- $(RM) "libwps_$(MODEL).dll"
-
-clean-linux:
- $(RM) "libwps_$(MODEL).so"
+RESULTS := $(patsubst %,libwps_%$(EXT),$(TARGETS))
-shared: shared-$(OS)
+all: $(RESULTS)
+ @$(COPY) $(RESULTS) ../gui/bin/
-shared-w32: $(SOURCES)
- @echo CC [IRIVER_H10_5GB]
- @$(CC) $(INCLUDE) $(CFLAGS) -DIRIVER_H10_5GB -DTARGET_MODEL=\"h10_5gb\" -DBUILD_DLL -shared $(SOURCES) -o ../gui/bin/libwps_h10_5gb.dll
+libwps_%$(EXT): $(SOURCES)
+ @echo CC [$(subst libwps_,,$(subst $(EXT),,$@))]
+ @$(CC) $(INCLUDE) $(CFLAGS) -D$(subst libwps_,,$(subst $(EXT),,$@)) $(LDFLAGS) -shared -o $@ $+
-shared-linux: $(SOURCES)
- @echo CC [IRIVER_H10_5GB]
- @$(CC) $(INCLUDE) $(CFLAGS) -DIRIVER_H10_5GB -DTARGET_MODEL=\"h10_5gb\" -shared -Wl,-soname,libwps_h10_5gb.so,-olibwps_h10_5gb.so -fPIC $(SOURCES)
- @$(COPY) libwps_h10_5gb.so ../gui/bin/libwps_h10_5gb.so
+clean:
+ $(RM) $(RESULTS)
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 @@
-@echo off
-FOR /F "tokens=1,2* delims=, " %%i in (targets.txt) do @mingw32-make MODEL=%%j TARGET=%%i build 2>nul
-echo Copying files...
-xcopy /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 @@
-#!/bin/sh
-cat targets.txt | (
- while read target model
- do
- make MODEL=$model TARGET=$target build
- done
- cp *.dll ../gui/bin
- cp *.so ../gui/bin
-)
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 @@
-#!/bin/sh
-cat targets.txt | (
- while read target model
- do
- make MODEL=$model TARGET=$target clean
- done
-)
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;
static char pluginbuf[PLUGIN_BUFFER_SIZE];
const char* get_model_name(){
-#ifdef TARGET_MODEL
- return TARGET_MODEL;
+#ifdef MODEL_NAME
+ return MODEL_NAME;
#else
return "unknown";
#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 @@
-IRIVER_H10 h10
-IRIVER_H10_5GB h10_5gb
-IPOD_COLOR ipodcolor
-IPOD_NANO ipodnano
-IPOD_VIDEO ipodvideo
-GIGABEAT_F gigabeatf
-GIGABEAT_S gigabeats
-SANSA_E200 e200
-SANSA_C200 c200