summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2008-12-15 23:42:19 +0000
committerBjörn Stenberg <bjorn@haxx.se>2008-12-15 23:42:19 +0000
commitee46a3d88e8378e58f01ff0d521477ba0b7201fb (patch)
treead63d929d4ebb1f762faf838ee9da965cfc0ab0b /tools
parent9f37f04619feb93a6a5adb36e7db6d7ace3c227c (diff)
downloadrockbox-ee46a3d88e8378e58f01ff0d521477ba0b7201fb.tar.gz
rockbox-ee46a3d88e8378e58f01ff0d521477ba0b7201fb.tar.bz2
rockbox-ee46a3d88e8378e58f01ff0d521477ba0b7201fb.zip
Moved database builder into a separate directory, and gave it its' own Makefile. Now it compiles cleanly and builds a database if ran in root of music tree.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19448 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile11
-rw-r--r--tools/database.c14
-rw-r--r--tools/database/Makefile37
-rw-r--r--tools/database/database.c49
4 files changed, 87 insertions, 24 deletions
diff --git a/tools/Makefile b/tools/Makefile
index 569a727139..43f53e2569 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -12,7 +12,7 @@ LDFLAGS := -g
.PHONY: rbspeexenc uclpack
CLEANALL := scramble descramble iriver sh2d bmp2rb rdf2binary convbdf \
- generate_rocklatin mkboot ipod_fw codepages uclpack mi4 gigabeat database \
+ generate_rocklatin mkboot ipod_fw codepages uclpack mi4 gigabeat \
lngdump telechips gigabeats creative hmac-sha1 mktccboot mknkboot rbspeexenc mkzenboot
all: scramble descramble sh2d rdf2binary mkboot mktccboot mknkboot mkzenboot \
@@ -66,15 +66,6 @@ lngdump: lngdump.c
ipod_fw: ipod_fw.c
$(SILENT)$(CC) $(CFLAGS) $+ -o $@
-database: database.c ../apps/tagcache.c ../apps/metadata.c \
-../firmware/id3.c ../firmware/common/unicode.c \
-../firmware/common/crc32.c ../uisimulator/common/io.c \
-../firmware/mp3data.c ../firmware/logf.c ../firmware/replaygain.c \
-../firmware/common/structec.c
- $(SILENT)$(CC) $(CFLAGS) -I../firmware/export -iquote ../firmware/include \
--D__PCTOOL__ -DHAVE_TAGCACHE -DROCKBOX_HAS_LOGF -DSIMULATOR \
--DCONFIG_CODEC=1 -ldl -I../apps $+ -o $@
-
checkwps: checkwps.c ../apps/gui/wps_parser.c ../apps/gui/wps_debug.c ../firmware/common/ctype.c ../apps/misc.c ../apps/recorder/bmp.c
$(SILENT)$(CC) $(CFLAGS) -I ../apps/gui -I../firmware/export \
-D__PCTOOL__ -DDEBUG -DROCKBOX_HAS_LOGF -DIPOD_COLOR -D ROCKBOX_DIR_LEN -D WPS_DIR=\".\" \
diff --git a/tools/database.c b/tools/database.c
deleted file mode 100644
index 9f0c620c2a..0000000000
--- a/tools/database.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* A _very_ skeleton file to demonstrate building tagcache db on host. */
-
-#include <stdio.h>
-#include "tagcache.h"
-
-int main(int argc, char **argv)
-{
- tagcache_init();
- tagcache_build("/export/stuff/mp3");
- tagcache_reverse_scan();
-
- return 0;
-}
-
diff --git a/tools/database/Makefile b/tools/database/Makefile
new file mode 100644
index 0000000000..01416eca0d
--- /dev/null
+++ b/tools/database/Makefile
@@ -0,0 +1,37 @@
+INCLUDE = -I../../firmware/export \
+ -I../../apps -I../../uisimulator/sdl -I/usr/include/SDL
+FIRMINC = -I../../firmware/include -fno-builtin
+DEFINES = -D__PCTOOL__ -DHAVE_TAGCACHE -DSIMULATOR -DCONFIG_CODEC=1 \
+ -DROCKBOX_LITTLE_ENDIAN -DROCKBOX_DIR=\".rockbox\" -DROCKBOX_HAS_LOGF \
+ -DCONFIG_CODEC=1
+CFLAGS = -g $(INCLUDE) $(DEFINES) -Wno-pointer-sign
+
+SRC = database.o tagcache.o replaygain.o \
+ metadata.o metadata_common.o mp3data.o \
+ a52.o mp3.o adx.o mp4.o aiff.o mpc.o ape.o ogg.o \
+ asap.o sid.o asf.o spc.o flac.o vorbis.o wave.o \
+ mod.o wavpack.o monkeys.o \
+ logf.o unicode.o ctype.o structec.o crc32.o io.o
+
+OBJ = $(SRC:.c=.o)
+
+# source code search path
+VPATH = ../../apps ../../apps/metadata ../../firmware/common ../../firmware/ \
+ ../../uisimulator/common
+
+all: database
+
+%.o : ../../uisimulator/common/%.c
+ @echo $(<F)
+ @$(CC) $(CFLAGS) -c -o $@ $<
+
+%.o : %.c $<
+ @echo $(<F)
+ @$(CC) $(FIRMINC) $(CFLAGS) -c -o $@ $<
+
+database: $(OBJ)
+ @echo Linking $@
+ @$(CC) -g -ldl -o $@ $+
+
+clean:
+ rm $(OBJ)
diff --git a/tools/database/database.c b/tools/database/database.c
new file mode 100644
index 0000000000..a8be48ab4b
--- /dev/null
+++ b/tools/database/database.c
@@ -0,0 +1,49 @@
+/* A _very_ skeleton file to demonstrate building tagcache db on host. */
+
+#include <stdio.h>
+#include "tagcache.h"
+
+int main(int argc, char **argv)
+{
+ tagcache_init();
+ tagcache_build(".");
+ tagcache_reverse_scan();
+
+ return 0;
+}
+
+/* stub to avoid including all of apps/misc.c */
+bool file_exists(const char *file)
+{
+ if (!stat(file))
+ return true;
+ return false;
+}
+
+/* stubs to avoid including thread-sdl.c */
+#include "kernel.h"
+void mutex_init(struct mutex *m)
+{
+ (void)m;
+}
+
+void mutex_lock(struct mutex *m)
+{
+ (void)m;
+}
+
+void mutex_unlock(struct mutex *m)
+{
+ (void)m;
+}
+
+void thread_sdl_thread_lock(void *me)
+{
+ (void)me;
+}
+
+void * thread_sdl_thread_unlock(void)
+{
+ return (void*)1;
+}
+