SD AMSv2: fix r29169
[maemo-rb.git] / tools / database / database.make
blob920acebd5d6e1c171318108a81ede53d118f3555
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
7 # $Id: checkwps.make 22680 2009-09-11 17:58:17Z gevaerts $
10 DBDEFINES=-g -DDEBUG -D__PCTOOL__ -DSIMULATOR
11 CFLAGS+=$(DBDEFINES)
13 createsrc = $(shell cat $(1) > $(3); echo "\#if CONFIG_CODEC == SWCODEC" >> $(3); \
14 echo $(2) | sed 's/ /\n/g' >> $(3); \
15 echo "\#endif" >> $(3); \
16 echo $(3))
18 METADATAS := $(subst $(ROOTDIR), ../.., $(wildcard $(ROOTDIR)/apps/metadata/*.c))
20 SRCFILE := $(call createsrc, $(TOOLSDIR)/database/SOURCES, \
21 $(METADATAS), \
22 $(TOOLSDIR)/database/SOURCES.build)
24 SRC= $(call preprocess, $(SRCFILE))
26 INCLUDES = -I$(ROOTDIR)/apps/gui \
27 -I$(ROOTDIR)/firmware/export \
28 -I$(ROOTDIR)/firmware/include \
29 -I$(ROOTDIR)/apps \
30 -I$(ROOTDIR)/apps/recorder \
31 -I$(APPSDIR) \
32 -I$(BUILDDIR) \
34 SIMINCLUDES += -I$(FIRMDIR)/target/hosted/sdl -I$(FIRMDIR)/target/hosted \
35 -I$(ROOTDIR)/uisimulator/common -I$(FIRMDIR)/export -I$(BUILDDIR) -I$(APPSDIR)
37 # Makes mkdepfile happy
38 GCCOPTS+=`$(SDLCONFIG) --cflags`
39 OLDGCCOPTS:=$(GCCOPTS)
40 GCCOPTS+=-D__PCTOOL__ -fno-builtin $(INCLUDES) $(SIMINCLUDES)
42 LIBS=`$(SDLCONFIG) --libs` -lc
43 ifneq ($(findstring MINGW,$(shell uname)),MINGW)
44 LIBS += -ldl
45 endif
47 .SECONDEXPANSION: # $$(OBJ) is not populated until after this
49 SIMFLAGS += $(SIMINCLUDES) $(DBDEFINES) -DHAVE_CONFIG_H $(OLDGCCOPTS) $(INCLUDES)
51 $(BUILDDIR)/$(BINARY): $$(OBJ)
52 @echo LD $(BINARY)
53 $(SILENT)$(HOSTCC) $(SIMFLAGS) $(LIBS) -o $@ $+
55 $(BUILDDIR)/tools/database/../../uisimulator/%.o: $(ROOTDIR)/uisimulator/%.c
56 $(SILENT)mkdir -p $(dir $@)
57 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SIMFLAGS) -c $< -o $@
59 $(BUILDDIR)/tools/database/database.o: $(APPSDIR)/database.c
60 $(SILENT)mkdir -p $(dir $@)
61 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SIMFLAGS) -c $< -o $@