diff --git a/tools/configure b/tools/configure old mode 100755 new mode 100644 index dbef1e8167..5b007e9aa4 --- 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" \ < $(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)))