summaryrefslogtreecommitdiff
path: root/tools/database
diff options
context:
space:
mode:
Diffstat (limited to 'tools/database')
-rw-r--r--tools/database/Makefile37
-rw-r--r--tools/database/database.c49
2 files changed, 86 insertions, 0 deletions
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 @@
1INCLUDE = -I../../firmware/export \
2 -I../../apps -I../../uisimulator/sdl -I/usr/include/SDL
3FIRMINC = -I../../firmware/include -fno-builtin
4DEFINES = -D__PCTOOL__ -DHAVE_TAGCACHE -DSIMULATOR -DCONFIG_CODEC=1 \
5 -DROCKBOX_LITTLE_ENDIAN -DROCKBOX_DIR=\".rockbox\" -DROCKBOX_HAS_LOGF \
6 -DCONFIG_CODEC=1
7CFLAGS = -g $(INCLUDE) $(DEFINES) -Wno-pointer-sign
8
9SRC = database.o tagcache.o replaygain.o \
10 metadata.o metadata_common.o mp3data.o \
11 a52.o mp3.o adx.o mp4.o aiff.o mpc.o ape.o ogg.o \
12 asap.o sid.o asf.o spc.o flac.o vorbis.o wave.o \
13 mod.o wavpack.o monkeys.o \
14 logf.o unicode.o ctype.o structec.o crc32.o io.o
15
16OBJ = $(SRC:.c=.o)
17
18# source code search path
19VPATH = ../../apps ../../apps/metadata ../../firmware/common ../../firmware/ \
20 ../../uisimulator/common
21
22all: database
23
24%.o : ../../uisimulator/common/%.c
25 @echo $(<F)
26 @$(CC) $(CFLAGS) -c -o $@ $<
27
28%.o : %.c $<
29 @echo $(<F)
30 @$(CC) $(FIRMINC) $(CFLAGS) -c -o $@ $<
31
32database: $(OBJ)
33 @echo Linking $@
34 @$(CC) -g -ldl -o $@ $+
35
36clean:
37 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 @@
1/* A _very_ skeleton file to demonstrate building tagcache db on host. */
2
3#include <stdio.h>
4#include "tagcache.h"
5
6int main(int argc, char **argv)
7{
8 tagcache_init();
9 tagcache_build(".");
10 tagcache_reverse_scan();
11
12 return 0;
13}
14
15/* stub to avoid including all of apps/misc.c */
16bool file_exists(const char *file)
17{
18 if (!stat(file))
19 return true;
20 return false;
21}
22
23/* stubs to avoid including thread-sdl.c */
24#include "kernel.h"
25void mutex_init(struct mutex *m)
26{
27 (void)m;
28}
29
30void mutex_lock(struct mutex *m)
31{
32 (void)m;
33}
34
35void mutex_unlock(struct mutex *m)
36{
37 (void)m;
38}
39
40void thread_sdl_thread_lock(void *me)
41{
42 (void)me;
43}
44
45void * thread_sdl_thread_unlock(void)
46{
47 return (void*)1;
48}
49