diff --git a/apps/codecs/codecs.make b/apps/codecs/codecs.make index aab23b01a2..c137426591 100644 --- a/apps/codecs/codecs.make +++ b/apps/codecs/codecs.make @@ -47,7 +47,7 @@ include $(APPSDIR)/codecs/libtta/libtta.make CODECFLAGS = $(CFLAGS) -fstrict-aliasing -I$(APPSDIR)/codecs \ -I$(APPSDIR)/codecs/lib -DCODEC -ifndef SIMVER +ifndef APP_TYPE CONFIGFILE := $(FIRMDIR)/export/config/$(MODELNAME).h CODEC_LDS := $(APPSDIR)/plugins/plugin.lds # codecs and plugins use same file CODECLINK_LDS := $(CODECDIR)/codec.link @@ -115,7 +115,7 @@ $(CODECDIR)/%.o: $(ROOTDIR)/apps/codecs/%.S $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \ -I$(dir $<) $(CODECFLAGS) -c $< -o $@ -ifdef SIMVER +ifdef APP_TYPE CODECLDFLAGS = $(SHARED_FLAG) # <-- from Makefile else CODECLDFLAGS = -T$(CODECLINK_LDS) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map @@ -135,7 +135,7 @@ $(CODECDIR)/%.codec: $(CODECDIR)/%.o $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(CODECLDFLAGS) -ifdef SIMVER +ifdef APP_TYPE $(SILENT)cp $(CODECDIR)/$*.elf $@ else $(SILENT)$(OC) -O binary $(CODECDIR)/$*.elf $@ diff --git a/apps/codecs/lib/tlsf/libtlsf.make b/apps/codecs/lib/tlsf/libtlsf.make index 464487f87f..7d37d29b21 100644 --- a/apps/codecs/lib/tlsf/libtlsf.make +++ b/apps/codecs/lib/tlsf/libtlsf.make @@ -18,7 +18,7 @@ $(TLSFLIB): $(TLSFLIB_OBJ) TLSFLIBFLAGS = $(CODECFLAGS) -ffunction-sections -ifdef SIMVER +ifdef APP_TYPE TLSFLIBFLAGS += -DTLSF_STATISTIC=1 endif diff --git a/apps/codecs/libwmapro/libwmapro.make b/apps/codecs/libwmapro/libwmapro.make index 42086a637a..0e8df7e9cb 100644 --- a/apps/codecs/libwmapro/libwmapro.make +++ b/apps/codecs/libwmapro/libwmapro.make @@ -17,7 +17,7 @@ $(WMAPROLIB): $(WMAPROLIB_OBJ) $(SILENT)$(shell rm -f $@) $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null -ifdef SIMVER +ifdef APP_TYPE # wmapro needs libm in the simulator $(CODECDIR)/wmapro.codec: $(CODECDIR)/wmapro.o $(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/wmapro.elf \ diff --git a/apps/plugins/doom/doom.make b/apps/plugins/doom/doom.make index 2f52da4a4e..58a4708819 100644 --- a/apps/plugins/doom/doom.make +++ b/apps/plugins/doom/doom.make @@ -21,7 +21,7 @@ OTHER_SRC += $(DOOM_SRC) DOOMCFLAGS = $(PLUGINFLAGS) -Wno-strict-prototypes -O2 -fno-strict-aliasing -ifndef SIMVER +ifndef APP_TYPE ifeq ($(TARGET), IRIVER_H100) DOOMCCFLAGS += -mstructure-size-boundary=8 endif diff --git a/apps/plugins/goban/goban.make b/apps/plugins/goban/goban.make index 03f2276659..2bc85ad8e1 100644 --- a/apps/plugins/goban/goban.make +++ b/apps/plugins/goban/goban.make @@ -15,7 +15,7 @@ GOBAN_OBJ := $(call c2obj, $(GOBAN_SRC)) OTHER_SRC += $(GOBAN_SRC) -ifndef SIMVER +ifndef APP_TYPE ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET))))) ### lowmem targets ROCKS += $(GOBAN_BUILDDIR)/goban.ovl diff --git a/apps/plugins/lua/Makefile b/apps/plugins/lua/Makefile index 6a4e497801..09535ac530 100644 --- a/apps/plugins/lua/Makefile +++ b/apps/plugins/lua/Makefile @@ -27,7 +27,7 @@ OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) DIRS = . -ifndef SIMVER +ifndef APP_TYPE ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET))))) LDS := archos.lds OUTPUT = $(OUTDIR)/lua.ovl @@ -41,7 +41,7 @@ endif all: $(OUTPUT) -ifndef SIMVER +ifndef APP_TYPE $(OBJDIR)/lua.elf: $(OBJS) $(LINKFILE) $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \ -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/lua.map @@ -50,7 +50,7 @@ $(OUTPUT): $(OBJDIR)/lua.elf $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@ else -ifeq ($(SIMVER), sdl) +ifdef APP_TYPE ################################################### # This is the SDL simulator version diff --git a/apps/plugins/lua/lua.make b/apps/plugins/lua/lua.make index 93139dc8d4..f4dd7710c9 100644 --- a/apps/plugins/lua/lua.make +++ b/apps/plugins/lua/lua.make @@ -15,7 +15,7 @@ LUA_OBJ := $(call c2obj, $(LUA_SRC)) OTHER_SRC += $(LUA_SRC) -ifndef SIMVER +ifndef APP_TYPE ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET))))) ### lowmem targets ROCKS += $(LUA_BUILDDIR)/lua.ovl diff --git a/apps/plugins/pdbox/pdbox.make b/apps/plugins/pdbox/pdbox.make index d39d9fde1e..d2c836f513 100644 --- a/apps/plugins/pdbox/pdbox.make +++ b/apps/plugins/pdbox/pdbox.make @@ -22,7 +22,7 @@ $(PDBOXBUILDDIR)/pdbox.rock: $(PDBOX_OBJ) $(MPEG_OBJ) $(CODECDIR)/libtlsf.a PDBOXFLAGS = $(PLUGINFLAGS) PDBOXLDFLAGS = $(PLUGINLDFLAGS) -ifdef SIMVER +ifdef APP_TYPE PDBOXLDFLAGS += -lm endif @@ -36,7 +36,7 @@ $(PDBOXBUILDDIR)/pdbox.rock: $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(PDBOXLDFLAGS) -ifdef SIMVER +ifdef APP_TYPE $(SILENT)cp $*.elf $@ else $(SILENT)$(OC) -O binary $*.elf $@ diff --git a/apps/plugins/pictureflow/pictureflow.make b/apps/plugins/pictureflow/pictureflow.make index 28ad2aa39e..e3d4544e07 100644 --- a/apps/plugins/pictureflow/pictureflow.make +++ b/apps/plugins/pictureflow/pictureflow.make @@ -15,7 +15,7 @@ PICTUREFLOW_OBJ := $(call c2obj, $(PICTUREFLOW_SRC)) OTHER_SRC += $(PICTUREFLOW_SRC) -ifndef SIMVER +ifndef APP_TYPE ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET))))) ### lowmem targets ROCKS += $(PICTUREFLOW_OBJDIR)/pictureflow.ovl diff --git a/apps/plugins/plugins.make b/apps/plugins/plugins.make index 4bd0cc952e..d3c66c34ca 100644 --- a/apps/plugins/plugins.make +++ b/apps/plugins/plugins.make @@ -27,7 +27,7 @@ PLUGINLIB_OBJ := $(PLUGINLIB_OBJ:.S=.o) PLUGINLIB_OBJ := $(subst $(ROOTDIR),$(BUILDDIR),$(PLUGINLIB_OBJ)) ### build data / rules -ifndef SIMVER +ifndef APP_TYPE CONFIGFILE := $(FIRMDIR)/export/config/$(MODELNAME).h PLUGIN_LDS := $(APPSDIR)/plugins/plugin.lds PLUGINLINK_LDS := $(BUILDDIR)/apps/plugins/plugin.link @@ -81,7 +81,7 @@ $(BUILDDIR)/apps/plugins/%.o: $(ROOTDIR)/apps/plugins/%.c $(SILENT)mkdir -p $(dir $@) $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PLUGINFLAGS) -c $< -o $@ -ifdef SIMVER +ifdef APP_TYPE PLUGINLDFLAGS = $(SHARED_FLAG) # <-- from Makefile else PLUGINLDFLAGS = -T$(PLUGINLINK_LDS) -Wl,--gc-sections -Wl,-Map,$*.map @@ -94,7 +94,7 @@ $(BUILDDIR)/%.rock: $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(PLUGINLDFLAGS) -ifdef SIMVER +ifdef APP_TYPE $(SILENT)cp $(BUILDDIR)/$*.elf $@ else $(SILENT)$(OC) -O binary $(BUILDDIR)/$*.elf $@ diff --git a/apps/plugins/zxbox/zxbox.make b/apps/plugins/zxbox/zxbox.make index de7312e009..a04801aa31 100644 --- a/apps/plugins/zxbox/zxbox.make +++ b/apps/plugins/zxbox/zxbox.make @@ -15,7 +15,7 @@ ZXBOX_OBJ := $(call c2obj, $(ZXBOX_SRC)) OTHER_SRC += $(ZXBOX_SRC) -ifndef SIMVER +ifndef APP_TYPE ifeq ($(findstring YES, $(call preprocess, $(APPSDIR)/plugins/BUILD_OVERLAY)), YES) ## lowmem targets ROCKS += $(ZXBOX_OBJDIR)/zxbox.ovl diff --git a/firmware/firmware.make b/firmware/firmware.make index 9d023ab27f..aab735aa91 100644 --- a/firmware/firmware.make +++ b/firmware/firmware.make @@ -8,7 +8,7 @@ # INCLUDES += -I$(FIRMDIR) -I$(FIRMDIR)/export -I$(FIRMDIR)/drivers -I$(FIRMDIR)/include -ifndef SIMVER +ifndef APP_TYPE INCLUDES += -I$(FIRMDIR)/libc/include endif diff --git a/tools/configure b/tools/configure index 504540505d..9f7c63f569 100755 --- a/tools/configure +++ b/tools/configure @@ -103,7 +103,7 @@ simcc () { prefixtools "$CROSS_COMPILE" ARG_ARM_THUMB=0 # can't use thumb in native builds - simver=sdl + app_type=$1 winbuild="" GCCOPTS='-W -Wall -g -fno-builtin' GCCOPTIMIZE='' @@ -171,7 +171,7 @@ simcc () { [ "$winbuild" != "yes" ] && GLOBAL_LDOPTS="$GLOBAL_LDOPTS -Wl,-z,defs" sdl=`findsdl $winbuild` - if [ $1 = "sdl" ]; then + if [ -n `echo $app_type | grep "sdl"` ]; then if [ -z "$sdl" ]; then echo "configure didn't find sdl-config, which indicates that you" echo "don't have SDL (properly) installed. Please correct and" @@ -233,9 +233,11 @@ EOF echo "WARNING: Cross Compiling, cannot detect endianess. Assuming little endian!" fi - if [ $1 = "sdl" ]; then + if [ "$app_type" = "sdl-sim" ]; then echo "Simulator environment deemed $endian endian" - elif [ $1 = "checkwps" ]; then + elif [ "$app_type" = "sdl-app" ]; then + echo "Application environment deemed $endian endian" + elif [ "$app_type" = "checkwps" ]; then echo "CheckWPS environment deemed $endian endian" fi @@ -2604,7 +2606,7 @@ fi target="-DAPPLICATION" memory=32 uname=`uname` - simcc "sdl" + simcc "sdl-app" tool="cp " boottool="cp " bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" @@ -2855,7 +2857,7 @@ uname=`uname` if [ "yes" = "$simulator" ]; then # setup compiler and things for simulator - simcc "sdl" + simcc "sdl-sim" if [ -d "simdisk" ]; then echo "Subdirectory 'simdisk' already present" @@ -3136,7 +3138,7 @@ sed > Makefile \ -e "s<@FIRMDIR@<${firmdir}