Rename/change SIMVER to APP_TYPE in the Makefiles.

SIMVER was really only used to detect a simulator build. With APP_TYPE you can
now differentiate between simulator, application, checkwps and database builds.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27372 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2010-07-10 13:49:49 +00:00
parent e87ff2bf91
commit 57613ea5fa
16 changed files with 99 additions and 71 deletions

View file

@ -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 $@

View file

@ -18,7 +18,7 @@ $(TLSFLIB): $(TLSFLIB_OBJ)
TLSFLIBFLAGS = $(CODECFLAGS) -ffunction-sections
ifdef SIMVER
ifdef APP_TYPE
TLSFLIBFLAGS += -DTLSF_STATISTIC=1
endif

View file

@ -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 \

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 $@

View file

@ -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

View file

@ -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 $@

View file

@ -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

View file

@ -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

18
tools/configure vendored
View file

@ -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}<g" \
-e "s<@TOOLSDIR@<${toolsdir}<g" \
-e "s<@APPS@<${apps}<g" \
-e "s<@SIMVER@<${simver}<g" \
-e "s<@APP_TYPE@<${app_type}<g" \
-e "s<@GCCVER@<${gccver}<g" \
-e "s<@GCCNUM@<${gccnum}<g" \
-e "s<@UNAME@<${uname}<g" \
@ -3202,7 +3204,7 @@ export DLLWRAP=@DLLWRAP@
export RANLIB=@RANLIB@
export PREFIX=@PREFIX@
export PROFILE_OPTS=@PROFILE_OPTS@
export SIMVER=@SIMVER@
export APP_TYPE=@APP_TYPE@
export SIMDIR=\$(ROOTDIR)/uisimulator/sdl
export GCCOPTS=@GCCOPTS@
export TARGET_INC=@TARGET_INC@

View file

@ -1,43 +1,69 @@
ifndef V
SILENT = @
endif
INCLUDE = -I../../firmware/export \
-I../../apps -I../../apps/gui -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
## Automatically generated. http://www.rockbox.org/
SRC = database.c tagcache.c replaygain.c \
metadata.c metadata_common.c mp3data.c \
a52.c mp3.c adx.c mp4.c aiff.c mpc.c ape.c ogg.c \
asap.c sid.c asf.c spc.c flac.c vorbis.c wave.c \
mod.c wavpack.c monkeys.c rm.c nsf.c smaf.c \
logf.c unicode.c ctype.c structec.c crc32.c io.c \
misc.c strlcpy.c fixedpoint.c
export ROOTDIR=/home/kugel/rbdev/rockbox-git
export FIRMDIR=$(ROOTDIR)/firmware
export APPSDIR=$(ROOTDIR)/tools/database
export TOOLSDIR=$(ROOTDIR)/tools
export DOCSDIR=$(ROOTDIR)/docs
export MANUALDIR=${ROOTDIR}/manual
export DEBUG=
export MODELNAME=iriverh300
export ARCHOSROM=
export FLASHFILE=
export TARGET_ID=10
export TARGET=-DIRIVER_H300
export CPU=
export MANUFACTURER=iriver
export OBJDIR=/home/kugel/rbdev/rockbox-git/tools/database
export BUILDDIR=/home/kugel/rbdev/rockbox-git/tools/database
export LANGUAGE=english
export VOICELANGUAGE=
export MEMORYSIZE=32
export BUILDDATE:=$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
export MKFIRMWARE=/home/kugel/rbdev/rockbox-git/tools/scramble -add=h300
export BMP2RB_MONO=/home/kugel/rbdev/rockbox-git/tools/bmp2rb -f 0
export BMP2RB_NATIVE=/home/kugel/rbdev/rockbox-git/tools/bmp2rb -f 4
export BMP2RB_REMOTEMONO=/home/kugel/rbdev/rockbox-git/tools/bmp2rb -f 0
export BMP2RB_REMOTENATIVE=/home/kugel/rbdev/rockbox-git/tools/bmp2rb -f 0
export BINARY=database.iriverh300
export APPEXTRA=recorder:gui:radio
export ENABLEDPLUGINS=yes
export SOFTWARECODECS=yes
export EXTRA_DEFINES=
export HOSTCC=/usr/bin/gcc
export HOSTAR=/usr/bin/ar
export CC=/usr/bin/ccache /usr/bin/gcc
export LD=/usr/bin/ar
export AR=/usr/bin/ar
export AS=/usr/bin/as
export OC=/usr/bin/objcopy
export WINDRES=windres
export DLLTOOL=dlltool
export DLLWRAP=dllwrap
export RANLIB=/usr/bin/ranlib
export PREFIX=
export PROFILE_OPTS=
export APP_TYPE=database
export SIMDIR=$(ROOTDIR)/uisimulator/sdl
export GCCOPTS= -Wno-pointer-sign -Wno-override-init
export TARGET_INC=
export LOADADDRESS=
export SHARED_FLAG=-shared
export LDOPTS=-lm -ldl -L/home/kugel/.sdl/lib -Wl,-rpath,/home/kugel/.sdl/lib -lSDL -lpthread
export GLOBAL_LDOPTS= -Wl,-z,defs
export GCCVER=4.4.3
export GCCNUM=404
export UNAME=Linux
export MANUALDEV=iriverh300
export TTS_OPTS=
export TTS_ENGINE=
export ENC_OPTS=
export ENCODER=
export USE_ELF=
export RBDIR=.rockbox
export SDLCONFIG=/home/kugel/.sdl/bin/sdl-config
OBJ = $(SRC:.c=.o)
CONFIGURE_OPTIONS=--target=$(MODELNAME) --ram=$(MEMORYSIZE) --rbdir=$(RBDIR) --type=d --prefix=$(PREFIX)
# source code search path
VPATH = ../../apps ../../apps/metadata ../../firmware/common ../../firmware/ \
../../uisimulator/common
include $(TOOLSDIR)/root.make
TARGET= database
all: $(TARGET)
%.o : ../../uisimulator/common/%.c
@echo CC $(<F)
$(SILENT)$(CC) $(CFLAGS) -c -o $@ $<
%.o : %.c $<
@echo CC $(<F)
$(SILENT)$(CC) $(FIRMINC) $(CFLAGS) -c -o $@ $<
database: $(OBJ)
@echo LD $@
$(SILENT)$(CC) -g -ldl -o $@ $+
clean:
rm -f $(OBJ) $(TARGET)

View file

@ -24,7 +24,7 @@ TOOLS = $(TOOLSDIR)/rdf2binary $(TOOLSDIR)/convbdf \
ifeq (,$(PREFIX))
ifdef SIMVER
ifeq ($(APP_TYPE),sdl-sim)
# for sims, set simdisk/ as default
PREFIX = simdisk
INSTALL = --install="$(PREFIX)"
@ -85,7 +85,7 @@ else
include $(APPSDIR)/plugins/plugins.make
endif
ifdef SIMVER
ifdef APP_TYPE
include $(ROOTDIR)/uisimulator/uisimulator.make
endif
endif # bootloader
@ -141,7 +141,7 @@ ifeq (,$(findstring bootloader,$(APPSDIR)))
OBJ += $(LANG_O)
ifndef SIMVER
ifndef APP_TYPE
## target build
CONFIGFILE := $(FIRMDIR)/export/config/$(MODELNAME).h
@ -221,7 +221,7 @@ $(MAXOUTFILE):
$(BUILDDIR)/rombox.iriver: $(BUILDDIR)/rombox.bin
$(call PRINTS,Build ROM file)$(MKFIRMWARE) $< $@
endif # !SIMVER
endif # !APP_TYPE
endif # !bootloader

View file

@ -24,7 +24,7 @@ DEBUG = -g
# Use this for simulator-only files
INCLUDES = -I. -I$(OBJDIR) $(TARGET_INC) -I$(FIRMDIR)/export -I$(APPSDIR) \
-I$(ROOTDIR)/uisimulator/$(SIMVER) -I$(BUILDDIR)
-I$(ROOTDIR)/uisimulator/sdl -I$(BUILDDIR)
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc