summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorYoshihisa Uchida <uchida@rockbox.org>2010-02-25 12:28:30 +0000
committerYoshihisa Uchida <uchida@rockbox.org>2010-02-25 12:28:30 +0000
commitec39c055198cc4536e8131f142df1f0a9661982c (patch)
tree7e0d0720189c5d7b13c00cbb51eb5407368cc01d /tools
parent0cf4cab4319c5cfe3960b73ae835f5f4e5e7f525 (diff)
downloadrockbox-ec39c055198cc4536e8131f142df1f0a9661982c.tar.gz
rockbox-ec39c055198cc4536e8131f142df1f0a9661982c.tar.bz2
rockbox-ec39c055198cc4536e8131f142df1f0a9661982c.zip
tools/database: build process updates.
- buildable for Cygwin/MinGW. - SDL cobfig is set by using SDL-config. - metadata/*.c add automaticaly when database tool builds. - bitmap files do not create when database tool builds. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24908 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rw-r--r--[-rwxr-xr-x]tools/configure13
-rw-r--r--tools/database/SOURCES29
-rw-r--r--tools/database/database.make29
-rw-r--r--tools/root.make6
4 files changed, 44 insertions, 33 deletions
diff --git a/tools/configure b/tools/configure
index dbef1e8167..5b007e9aa4 100755..100644
--- a/tools/configure
+++ b/tools/configure
@@ -2672,8 +2672,17 @@ fi
t_cpu='';
GCCOPTS='';
appsdir='\$(ROOTDIR)/tools/database';
- output='database.'${modelname};
archosrom='';
+
+ case $uname in
+ CYGWIN*|MINGW*)
+ output="database_${modelname}.exe"
+ ;;
+ *)
+ output='database.'${modelname};
+ ;;
+ esac
+
echo "Database tool build selected"
;;
*)
@@ -3007,6 +3016,7 @@ sed > Makefile \
-e "s,@RBDIR@,${rbdir},g" \
-e "s,@PREFIX@,$PREFIX,g" \
-e "s,@CMDLINE@,$cmdline,g" \
+ -e "s,@SDLCONFIG@,$sdl,g" \
<<EOF
## Automatically generated. http://www.rockbox.org/
@@ -3071,6 +3081,7 @@ export ENC_OPTS=@ENC_OPTS@
export ENCODER=@ENCODER@
export USE_ELF=@USE_ELF@
export RBDIR=@RBDIR@
+export SDLCONFIG=@SDLCONFIG@
CONFIGURE_OPTIONS=@CMDLINE@
diff --git a/tools/database/SOURCES b/tools/database/SOURCES
index 0300040efa..56bb9f1323 100644
--- a/tools/database/SOURCES
+++ b/tools/database/SOURCES
@@ -1,30 +1,7 @@
database.c
../../apps/fixedpoint.c
../../apps/metadata.c
-../../apps/metadata/mp3.c
#if CONFIG_CODEC == SWCODEC
-../../apps/metadata/metadata_common.c
-../../apps/metadata/aiff.c
-../../apps/metadata/ape.c
-../../apps/metadata/asf.c
-../../apps/metadata/adx.c
-../../apps/metadata/flac.c
-../../apps/metadata/monkeys.c
-../../apps/metadata/mp4.c
-../../apps/metadata/mpc.c
-../../apps/metadata/ogg.c
-../../apps/metadata/sid.c
-../../apps/metadata/mod.c
-../../apps/metadata/spc.c
-../../apps/metadata/vorbis.c
-../../apps/metadata/wave.c
-../../apps/metadata/wavpack.c
-../../apps/metadata/a52.c
-../../apps/metadata/asap.c
-../../apps/metadata/rm.c
-../../apps/metadata/nsf.c
-../../apps/metadata/oma.c
-../../apps/metadata/smaf.c
../../apps/replaygain.c
#endif
../../apps/misc.c
@@ -32,8 +9,14 @@ database.c
../../apps/tagcache.c
../../firmware/common/crc32.c
../../firmware/common/ctype.c
+../../firmware/common/errno.c
../../firmware/common/strlcpy.c
+../../firmware/common/strcasestr.c
../../firmware/common/structec.c
../../firmware/common/unicode.c
../../firmware/logf.c
../../uisimulator/common/io.c
+#if CONFIG_CODEC != SWCODEC
+../../apps/metadata/mp3.c
+#endif
+/* Caution. metadata files do not add!! */
diff --git a/tools/database/database.make b/tools/database/database.make
index a94aa55c78..62b2e9f24c 100644
--- a/tools/database/database.make
+++ b/tools/database/database.make
@@ -7,12 +7,21 @@
# $Id: checkwps.make 22680 2009-09-11 17:58:17Z gevaerts $
#
-FIRMINC = -I../../firmware/include -fno-builtin
-
DBDEFINES=-g -DDEBUG -D__PCTOOL__ -DSIMULATOR
CFLAGS+=$(DBDEFINES)
-SRC= $(call preprocess, $(TOOLSDIR)/database/SOURCES)
+createsrc = $(shell cat $(1) > $(3); echo "\#if CONFIG_CODEC == SWCODEC" >> $(3); \
+ echo $(2) | sed 's/ /\n/g' >> $(3); \
+ echo "\#endif" >> $(3); \
+ echo $(3))
+
+METADATAS := $(subst $(ROOTDIR), ../.., $(wildcard $(ROOTDIR)/apps/metadata/*.c))
+
+SRCFILE := $(call createsrc, $(TOOLSDIR)/database/SOURCES, \
+ $(METADATAS), \
+ $(TOOLSDIR)/database/SOURCES.build)
+
+SRC= $(call preprocess, $(SRCFILE))
FIRMINC = -I$(ROOTDIR)/firmware/include -fno-builtin
@@ -24,19 +33,25 @@ INCLUDES = -I$(ROOTDIR)/apps/gui \
-I$(BUILDDIR) \
SIMINCLUDES += -I$(ROOTDIR)/uisimulator/sdl -I$(ROOTDIR)/uisimulator/common \
- -I$(FIRMDIR)/export $(TARGET_INC) -I$(BUILDDIR) -I$(APPSDIR) -I/usr/include/SDL
+ -I$(FIRMDIR)/export $(TARGET_INC) -I$(BUILDDIR) -I$(APPSDIR)
# Makes mkdepfile happy
+GCCOPTS+=`$(SDLCONFIG) --cflags`
OLDGCCOPTS:=$(GCCOPTS)
GCCOPTS+=-D__PCTOOL__ $(FIRMINC) $(SIMINCLUDES)
+LIBS=`$(SDLCONFIG) --libs`
+ifneq ($(findstring MINGW,$(shell uname)),MINGW)
+LIBS += -ldl
+endif
+
.SECONDEXPANSION: # $$(OBJ) is not populated until after this
+SIMFLAGS += $(SIMINCLUDES) $(DBDEFINES) -DHAVE_CONFIG_H $(OLDGCCOPTS) $(INCLUDES)
+
$(BUILDDIR)/$(BINARY): $$(OBJ)
@echo LD $(BINARY)
- $(SILENT)$(HOSTCC) $(INCLUDE) $(FLAGS) -ldl -o $@ $+
-
-SIMFLAGS += $(SIMINCLUDES) $(DBDEFINES) -DHAVE_CONFIG_H $(OLDGCCOPTS) $(INCLUDES)
+ $(SILENT)$(HOSTCC) $(SIMFLAGS) $(LIBS) -o $@ $+
$(BUILDDIR)/tools/database/../../uisimulator/%.o: $(ROOTDIR)/uisimulator/%.c
$(SILENT)mkdir -p $(dir $@)
diff --git a/tools/root.make b/tools/root.make
index 76d493b22e..4bf1a32728 100644
--- a/tools/root.make
+++ b/tools/root.make
@@ -57,8 +57,10 @@ all: $(DEPFILE) build
include $(TOOLSDIR)/tools.make
ifeq (,$(findstring checkwps,$(APPSDIR)))
- include $(FIRMDIR)/firmware.make
- include $(ROOTDIR)/apps/bitmaps/bitmaps.make
+ ifeq (,$(findstring database,$(APPSDIR)))
+ include $(FIRMDIR)/firmware.make
+ include $(ROOTDIR)/apps/bitmaps/bitmaps.make
+ endif
endif
ifneq (,$(findstring bootloader,$(APPSDIR)))