mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Unified build system to use SOURCES for sim builds too, a single Makefile-look
made by configure and various related adjustments. This has not yet been tested on cygwin. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6001 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f436476f9f
commit
cdde25b597
25 changed files with 414 additions and 571 deletions
|
@ -13,11 +13,6 @@ DEPFILE = $(OBJDIR)/dep-apps
|
||||||
LDS := $(FIRMDIR)/app.lds
|
LDS := $(FIRMDIR)/app.lds
|
||||||
ROMLDS := $(FIRMDIR)/rom.lds
|
ROMLDS := $(FIRMDIR)/rom.lds
|
||||||
|
|
||||||
ifdef DEBUG
|
|
||||||
DEFINES := -DDEBUG
|
|
||||||
CFLAGS += -g
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef ENABLEDPLUGINS
|
ifdef ENABLEDPLUGINS
|
||||||
ROCKS=rocks
|
ROCKS=rocks
|
||||||
endif
|
endif
|
||||||
|
@ -26,7 +21,8 @@ ifdef SOFTWARECODECS
|
||||||
CODECS=build-codecs
|
CODECS=build-codecs
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - )
|
SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
|
||||||
|
$(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - )
|
||||||
DIRS = .
|
DIRS = .
|
||||||
|
|
||||||
ifdef APPEXTRA
|
ifdef APPEXTRA
|
||||||
|
@ -44,9 +40,11 @@ LINKROM = $(OBJDIR)/linkrom.lds
|
||||||
MAXINFILE = $(OBJDIR)/romstart.temp
|
MAXINFILE = $(OBJDIR)/romstart.temp
|
||||||
MAXOUTFILE = $(OBJDIR)/romstart
|
MAXOUTFILE = $(OBJDIR)/romstart
|
||||||
|
|
||||||
ifdef DEBUG
|
ifdef SIMVER
|
||||||
all: $(OBJDIR)/rockbox.elf $(CODECS) $(ROCKS)
|
# this is a sim build
|
||||||
|
all: $(OBJDIR)/$(BINARY) $(CODECS) $(ROCKS)
|
||||||
else
|
else
|
||||||
|
# regular target build
|
||||||
all: $(OBJDIR)/$(BINARY) $(FLASHFILE) $(CODECS) $(ROCKS) $(ARCHOSROM)
|
all: $(OBJDIR)/$(BINARY) $(FLASHFILE) $(CODECS) $(ROCKS) $(ARCHOSROM)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -80,9 +78,11 @@ $(OBJDIR)/rombox.elf : $(OBJS) $(LINKROM) $(OBJDIR)/librockbox.a $(DEPFILE)
|
||||||
@echo "LD rombox.elf"
|
@echo "LD rombox.elf"
|
||||||
@$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(OBJDIR) -lrockbox -lgcc -L$(FIRMDIR) -T$(LINKROM) -Wl,-Map,$(OBJDIR)/rombox.map
|
@$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(OBJDIR) -lrockbox -lgcc -L$(FIRMDIR) -T$(LINKROM) -Wl,-Map,$(OBJDIR)/rombox.map
|
||||||
|
|
||||||
|
ifndef SIMVER
|
||||||
|
|
||||||
$(OBJDIR)/rockbox.elf : $(OBJS) $(LINKFILE) $(OBJDIR)/librockbox.a $(DEPFILE)
|
$(OBJDIR)/rockbox.elf : $(OBJS) $(LINKFILE) $(OBJDIR)/librockbox.a $(DEPFILE)
|
||||||
@echo "LD rockbox.elf"
|
@echo "LD rockbox.elf"
|
||||||
$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(OBJDIR) -lrockbox -lgcc -L$(FIRMDIR) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/rockbox.map
|
$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(OBJDIR) -lrockbox -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/rockbox.map
|
||||||
|
|
||||||
$(OBJDIR)/rockbox.bin : $(OBJDIR)/rockbox.elf
|
$(OBJDIR)/rockbox.bin : $(OBJDIR)/rockbox.elf
|
||||||
@echo "OBJCOPY $<"
|
@echo "OBJCOPY $<"
|
||||||
|
@ -99,6 +99,16 @@ $(OBJDIR)/$(BINARY) : $(OBJDIR)/rockbox.bin
|
||||||
@echo "Build firmware file"
|
@echo "Build firmware file"
|
||||||
@$(MKFIRMWARE) $< $@
|
@$(MKFIRMWARE) $< $@
|
||||||
|
|
||||||
|
else
|
||||||
|
# this is a simulator build
|
||||||
|
$(OBJDIR)/$(BINARY) : $(OBJS) $(OBJDIR)/librockbox.a $(DEPFILE) $(OBJDIR)/libsim.a
|
||||||
|
@echo "LD $(BINARY)"
|
||||||
|
$(CC) $(GCCOPTS) -o $@ $(OBJS) $(LDOPTS) -L$(OBJDIR) -lrockbox -lsim -Wl,-Map,$(OBJDIR)/rockbox.map
|
||||||
|
|
||||||
|
$(OBJDIR)/libsim.a:
|
||||||
|
@$(MAKE) -C $(SIMDIR)
|
||||||
|
endif
|
||||||
|
|
||||||
$(OBJDIR)/rockbox.ucl: $(OBJDIR)/rockbox.bin
|
$(OBJDIR)/rockbox.ucl: $(OBJDIR)/rockbox.bin
|
||||||
@a=`uclpack -h 2>/dev/null`; \
|
@a=`uclpack -h 2>/dev/null`; \
|
||||||
if test -n "$$a"; then \
|
if test -n "$$a"; then \
|
||||||
|
@ -160,5 +170,8 @@ clean:
|
||||||
@$(MAKE) -C plugins clean
|
@$(MAKE) -C plugins clean
|
||||||
@$(MAKE) -C codecs clean
|
@$(MAKE) -C codecs clean
|
||||||
@rm -rf $(OBJDIR)/recorder $(OBJDIR)/player
|
@rm -rf $(OBJDIR)/recorder $(OBJDIR)/player
|
||||||
|
ifdef SIMVER
|
||||||
|
@$(MAKE) -C $(SIMDIR) clean
|
||||||
|
endif
|
||||||
|
|
||||||
-include $(DEPFILE)
|
-include $(DEPFILE)
|
||||||
|
|
|
@ -19,7 +19,9 @@ settings_menu.c
|
||||||
sleeptimer.c
|
sleeptimer.c
|
||||||
sound_menu.c
|
sound_menu.c
|
||||||
status.c
|
status.c
|
||||||
|
#ifndef SIMULATOR
|
||||||
talk.c
|
talk.c
|
||||||
|
#endif
|
||||||
tree.c
|
tree.c
|
||||||
dbtree.c
|
dbtree.c
|
||||||
filetree.c
|
filetree.c
|
||||||
|
|
|
@ -14,11 +14,22 @@ ifdef APPEXTRA
|
||||||
INCLUDES += -I$(APPSDIR)/$(APPEXTRA)
|
INCLUDES += -I$(APPSDIR)/$(APPEXTRA)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
FLACOPTS = -DFLAC__NO_ASM -DFLAC__ALIGN_MALLOC_DATA -DFLAC__INTEGER_ONLY_LIBRARY -DVERSION=\"1.1.2\" -fomit-frame-pointer -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__ --param large-function-insns=10000
|
NEWGCC=$(shell expr $(GCCNUM) ">" 303)
|
||||||
|
|
||||||
|
FLACOPTS = -DFLAC__NO_ASM -DFLAC__ALIGN_MALLOC_DATA \
|
||||||
|
-DFLAC__INTEGER_ONLY_LIBRARY -DVERSION=\"1.1.2\" -fomit-frame-pointer \
|
||||||
|
-funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__
|
||||||
|
|
||||||
|
ifeq ($(NEWGCC), 1)
|
||||||
|
# this is 3.4.X options:
|
||||||
|
FLACOPTS += --param large-function-insns=10000
|
||||||
|
endif
|
||||||
|
|
||||||
CFLAGS = $(GCCOPTS) $(FLACOPTS)\
|
CFLAGS = $(GCCOPTS) $(FLACOPTS)\
|
||||||
$(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
|
$(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
|
||||||
|
|
||||||
SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - )
|
SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
|
||||||
|
$(TARGET) $(DEFINES) -E -P -include "config.h" - )
|
||||||
SOURCES = $(SRC)
|
SOURCES = $(SRC)
|
||||||
OBJS := $(SRC:%.c=$(OBJDIR)/libFLAC/%.o)
|
OBJS := $(SRC:%.c=$(OBJDIR)/libFLAC/%.o)
|
||||||
DEPFILE = $(OBJDIR)/dep-libFLAC
|
DEPFILE = $(OBJDIR)/dep-libFLAC
|
||||||
|
|
|
@ -274,13 +274,6 @@ static bool plugin_browse(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_RECORDING
|
#ifdef HAVE_RECORDING
|
||||||
#ifdef SIMULATOR
|
|
||||||
bool recording_screen(void)
|
|
||||||
{
|
|
||||||
/* a dummy */
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static bool recording_settings(void)
|
static bool recording_settings(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -187,9 +187,7 @@ static const struct plugin_api rockbox_api = {
|
||||||
strncasecmp,
|
strncasecmp,
|
||||||
memset,
|
memset,
|
||||||
memcpy,
|
memcpy,
|
||||||
#ifndef SIMULATOR
|
|
||||||
_ctype_,
|
_ctype_,
|
||||||
#endif
|
|
||||||
atoi,
|
atoi,
|
||||||
|
|
||||||
/* sound */
|
/* sound */
|
||||||
|
|
|
@ -211,9 +211,7 @@ struct plugin_api {
|
||||||
int (*strncasecmp)(const char *s1, const char *s2, size_t n);
|
int (*strncasecmp)(const char *s1, const char *s2, size_t n);
|
||||||
void* (*memset)(void *dst, int c, size_t length);
|
void* (*memset)(void *dst, int c, size_t length);
|
||||||
void* (*memcpy)(void *out, const void *in, size_t n);
|
void* (*memcpy)(void *out, const void *in, size_t n);
|
||||||
#ifndef SIMULATOR
|
|
||||||
const char *_ctype_;
|
const char *_ctype_;
|
||||||
#endif
|
|
||||||
int (*atoi)(const char *str);
|
int (*atoi)(const char *str);
|
||||||
|
|
||||||
/* sound */
|
/* sound */
|
||||||
|
|
|
@ -24,16 +24,19 @@ LDS := plugin.lds
|
||||||
LINKFILE := $(OBJDIR)/pluginlink.lds
|
LINKFILE := $(OBJDIR)/pluginlink.lds
|
||||||
DEPFILE = $(OBJDIR)/dep-plugins
|
DEPFILE = $(OBJDIR)/dep-plugins
|
||||||
|
|
||||||
SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) \
|
SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
|
||||||
$(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - )
|
$(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - )
|
||||||
ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock)
|
ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock)
|
||||||
SOURCES = $(SRC)
|
SOURCES = $(SRC)
|
||||||
ELFS := $(SRC:%.c=$(OBJDIR)/%.elf)
|
ELFS := $(SRC:%.c=$(OBJDIR)/%.elf)
|
||||||
OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
|
OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
|
||||||
|
# as created by the cross-compiler for win32:
|
||||||
|
DEFS := $(SRC:%.c=$(OBJDIR)/%.def)
|
||||||
DIRS = .
|
DIRS = .
|
||||||
|
|
||||||
all: $(OBJDIR)/libplugin.a $(ROCKS) $(DEPFILE)
|
all: $(OBJDIR)/libplugin.a $(ROCKS) $(DEPFILE)
|
||||||
|
|
||||||
|
ifndef SIMVER
|
||||||
$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a
|
$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a
|
||||||
@echo "LD $@"
|
@echo "LD $@"
|
||||||
@$(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(OBJDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map
|
@$(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(OBJDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map
|
||||||
|
@ -41,6 +44,37 @@ $(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a
|
||||||
$(OBJDIR)/%.rock : $(OBJDIR)/%.elf
|
$(OBJDIR)/%.rock : $(OBJDIR)/%.elf
|
||||||
@echo "OBJCOPY $<"
|
@echo "OBJCOPY $<"
|
||||||
@$(OC) -O binary $< $@
|
@$(OC) -O binary $< $@
|
||||||
|
else
|
||||||
|
|
||||||
|
ifeq ($(SIMVER), x11)
|
||||||
|
###################################################
|
||||||
|
# This is the X11 simulator version
|
||||||
|
|
||||||
|
$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(APPSDIR)/plugin.h
|
||||||
|
@echo "LD $@"
|
||||||
|
@$(CC) $(APPCFLAGS) -DPLUGIN -shared $< -L$(OBJDIR) -lplugin -o $@
|
||||||
|
ifeq ($(UNAME),CYGWIN)
|
||||||
|
# 'x' must be kept or you'll have "Win32 error 5"
|
||||||
|
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
|
||||||
|
# #define ERROR_ACCESS_DENIED 5L
|
||||||
|
else
|
||||||
|
@chmod -x $@
|
||||||
|
endif
|
||||||
|
|
||||||
|
else # end of x11-simulator
|
||||||
|
###################################################
|
||||||
|
# This is the win32 simulator version
|
||||||
|
DLLTOOLFLAGS = --export-all
|
||||||
|
DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
|
||||||
|
|
||||||
|
$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(APPSDIR)/plugin.h
|
||||||
|
@echo "DLL $@"
|
||||||
|
@$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $<
|
||||||
|
@$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< $(OBJDIR)/libplugin.a -o $@
|
||||||
|
@chmod -x $@
|
||||||
|
endif # end of win32-simulator
|
||||||
|
|
||||||
|
endif # end of simulator section
|
||||||
|
|
||||||
include $(TOOLSDIR)/make.inc
|
include $(TOOLSDIR)/make.inc
|
||||||
|
|
||||||
|
@ -56,7 +90,8 @@ $(LINKFILE): $(LDS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@echo "cleaning plugins"
|
@echo "cleaning plugins"
|
||||||
@rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) $(OBJS)
|
@rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \
|
||||||
|
$(OBJS) $(DEFS)
|
||||||
@$(MAKE) -C lib clean
|
@$(MAKE) -C lib clean
|
||||||
|
|
||||||
-include $(DEPFILE)
|
-include $(DEPFILE)
|
||||||
|
|
|
@ -18,9 +18,9 @@ INCLUDES += -I$(APPSDIR)/$(APPEXTRA)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS = $(GCCOPTS) \
|
CFLAGS = $(GCCOPTS) \
|
||||||
$(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
|
$(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} -DPLUGIN
|
||||||
|
|
||||||
SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - )
|
SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - )
|
||||||
SOURCES = $(SRC)
|
SOURCES = $(SRC)
|
||||||
OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
|
OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
|
||||||
DEPFILE = $(OBJDIR)/dep-pluginlib
|
DEPFILE = $(OBJDIR)/dep-pluginlib
|
||||||
|
@ -31,8 +31,9 @@ OUTPUT = $(OBJDIR)/libplugin.a
|
||||||
all: $(OUTPUT)
|
all: $(OUTPUT)
|
||||||
|
|
||||||
$(OUTPUT): $(OBJS)
|
$(OUTPUT): $(OBJS)
|
||||||
@echo "AR $@"
|
@echo "AR+RANLIB $@"
|
||||||
@$(AR) ruv $@ $+ >/dev/null 2>&1
|
@$(AR) ruv $@ $+ >/dev/null 2>&1
|
||||||
|
@$(RANLIB) $@
|
||||||
|
|
||||||
include $(TOOLSDIR)/make.inc
|
include $(TOOLSDIR)/make.inc
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ INCLUDES=-Iinclude -I$(FIRMDIR) -Iexport -Icommon -Idrivers
|
||||||
|
|
||||||
CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
|
CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
|
||||||
|
|
||||||
SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - )
|
SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - )
|
||||||
SOURCES = $(SRC)
|
SOURCES = $(SRC)
|
||||||
OBJS2 := $(patsubst %.c, $(OBJDIR)/%.o, $(SRC)) $(OBJDIR)/sysfont.o
|
OBJS2 := $(patsubst %.c, $(OBJDIR)/%.o, $(SRC)) $(OBJDIR)/sysfont.o
|
||||||
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
|
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
|
||||||
|
@ -29,6 +29,7 @@ $(TOOLSDIR)/convbdf:
|
||||||
$(OUTPUT): $(OBJS) $(DEPFILE)
|
$(OUTPUT): $(OBJS) $(DEPFILE)
|
||||||
@echo "AR $@"
|
@echo "AR $@"
|
||||||
@$(AR) ruv $@ $(OBJS) >/dev/null 2>&1
|
@$(AR) ruv $@ $(OBJS) >/dev/null 2>&1
|
||||||
|
@$(RANLIB) $@
|
||||||
|
|
||||||
include $(TOOLSDIR)/make.inc
|
include $(TOOLSDIR)/make.inc
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
|
#ifndef SIMULATOR
|
||||||
backlight.c
|
backlight.c
|
||||||
|
#endif
|
||||||
buffer.c
|
buffer.c
|
||||||
common/atoi.c
|
common/atoi.c
|
||||||
common/ctype.c
|
common/ctype.c
|
||||||
|
#ifndef SIMULATOR
|
||||||
common/dir.c
|
common/dir.c
|
||||||
|
common/file.c
|
||||||
|
#endif
|
||||||
common/disk.c
|
common/disk.c
|
||||||
common/errno.c
|
common/errno.c
|
||||||
common/file.c
|
|
||||||
common/memcmp.c
|
common/memcmp.c
|
||||||
common/qsort.c
|
common/qsort.c
|
||||||
common/random.c
|
common/random.c
|
||||||
|
@ -16,7 +20,7 @@ common/strcat.c
|
||||||
common/strchr.c
|
common/strchr.c
|
||||||
common/strcmp.c
|
common/strcmp.c
|
||||||
common/strcpy.c
|
common/strcpy.c
|
||||||
#if CONFIG_CPU == SH7034
|
#if (CONFIG_CPU == SH7034) && !defined(SIMULATOR)
|
||||||
common/strlen_a.S
|
common/strlen_a.S
|
||||||
#else
|
#else
|
||||||
common/strlen.c
|
common/strlen.c
|
||||||
|
@ -33,7 +37,20 @@ common/memset_a.S
|
||||||
common/memcpy.c
|
common/memcpy.c
|
||||||
common/memset.c
|
common/memset.c
|
||||||
#endif
|
#endif
|
||||||
debug.c
|
#ifdef HAVE_LCD_CHARCELLS
|
||||||
|
drivers/lcd-player-charset.c
|
||||||
|
drivers/lcd-player.c
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
#if CONFIG_LCD == LCD_S1D15E06
|
||||||
|
drivers/lcd-h100.c
|
||||||
|
#else
|
||||||
|
drivers/lcd-recorder.c
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
drivers/power.c
|
||||||
|
drivers/led.c
|
||||||
|
#ifndef SIMULATOR
|
||||||
drivers/adc.c
|
drivers/adc.c
|
||||||
#ifdef HAVE_MMC
|
#ifdef HAVE_MMC
|
||||||
drivers/ata_mmc.c
|
drivers/ata_mmc.c
|
||||||
|
@ -54,42 +71,35 @@ tuner_philips.c
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
drivers/i2c.c
|
drivers/i2c.c
|
||||||
#ifdef HAVE_LCD_CHARCELLS
|
|
||||||
drivers/lcd-player-charset.c
|
|
||||||
drivers/lcd-player.c
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
|
||||||
#if CONFIG_LCD == LCD_S1D15E06
|
|
||||||
drivers/lcd-h100.c
|
|
||||||
#else
|
|
||||||
drivers/lcd-recorder.c
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
drivers/led.c
|
|
||||||
#if CONFIG_HWCODEC != MASNONE
|
#if CONFIG_HWCODEC != MASNONE
|
||||||
drivers/mas.c
|
drivers/mas.c
|
||||||
#endif
|
#endif
|
||||||
drivers/power.c
|
|
||||||
#ifdef HAVE_RTC
|
#ifdef HAVE_RTC
|
||||||
drivers/rtc.c
|
drivers/rtc.c
|
||||||
#endif
|
#endif
|
||||||
drivers/serial.c
|
drivers/serial.c
|
||||||
|
#endif /* !SIMULATOR */
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
font.c
|
font.c
|
||||||
#endif
|
#endif
|
||||||
hwcompat.c
|
hwcompat.c
|
||||||
id3.c
|
id3.c
|
||||||
|
#ifndef SIMULATOR
|
||||||
kernel.c
|
kernel.c
|
||||||
|
rolo.c
|
||||||
|
thread.c
|
||||||
|
crt0.S
|
||||||
|
#endif
|
||||||
mp3_playback.c
|
mp3_playback.c
|
||||||
mp3data.c
|
mp3data.c
|
||||||
mpeg.c
|
mpeg.c
|
||||||
|
#ifndef WIN32 /* the win32 sim has its own versin of these: */
|
||||||
panic.c
|
panic.c
|
||||||
|
debug.c
|
||||||
|
#endif
|
||||||
powermgmt.c
|
powermgmt.c
|
||||||
rolo.c
|
|
||||||
system.c
|
system.c
|
||||||
thread.c
|
|
||||||
usb.c
|
usb.c
|
||||||
crt0.S
|
|
||||||
#if CONFIG_CPU == SH7034
|
#if CONFIG_CPU == SH7034
|
||||||
bitswap.S
|
bitswap.S
|
||||||
descramble.S
|
descramble.S
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h> /* get NULL */
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "rtc.h"
|
#include "rtc.h"
|
||||||
|
|
|
@ -222,6 +222,7 @@ void debugf(const char *fmt, ...)
|
||||||
void debug_init(void)
|
void debug_init(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
extern void *stderr;
|
||||||
|
|
||||||
void debugf(const char *fmt, ...)
|
void debugf(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,8 +22,6 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <file.h>
|
#include <file.h>
|
||||||
|
|
||||||
#ifndef DIRENT_DEFINED
|
|
||||||
|
|
||||||
#define ATTR_READ_ONLY 0x01
|
#define ATTR_READ_ONLY 0x01
|
||||||
#define ATTR_HIDDEN 0x02
|
#define ATTR_HIDDEN 0x02
|
||||||
#define ATTR_SYSTEM 0x04
|
#define ATTR_SYSTEM 0x04
|
||||||
|
@ -32,6 +30,8 @@
|
||||||
#define ATTR_ARCHIVE 0x20
|
#define ATTR_ARCHIVE 0x20
|
||||||
#define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */
|
#define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */
|
||||||
|
|
||||||
|
#ifndef DIRENT_DEFINED
|
||||||
|
|
||||||
struct dirent {
|
struct dirent {
|
||||||
unsigned char d_name[MAX_PATH];
|
unsigned char d_name[MAX_PATH];
|
||||||
int attribute;
|
int attribute;
|
||||||
|
|
|
@ -36,4 +36,13 @@
|
||||||
int snprintf (char *buf, size_t size, const char *fmt, ...);
|
int snprintf (char *buf, size_t size, const char *fmt, ...);
|
||||||
int vsnprintf (char *buf, int size, const char *fmt, __VALIST ap);
|
int vsnprintf (char *buf, int size, const char *fmt, __VALIST ap);
|
||||||
|
|
||||||
|
#ifdef SIMULATOR
|
||||||
|
typedef void FILE;
|
||||||
|
int vfprintf(FILE *stream, const char *format, __VALIST ap);
|
||||||
|
#ifdef WIN32
|
||||||
|
#define FILENAME_MAX 260 /* ugly hard-coded value of a limit that is set
|
||||||
|
in file.h */
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _STDIO_H_ */
|
#endif /* _STDIO_H_ */
|
||||||
|
|
|
@ -20,5 +20,16 @@ struct tm
|
||||||
int tm_isdst;
|
int tm_isdst;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(SIMULATOR) && !defined(_TIME_T_DEFINED)
|
||||||
|
/* for non-win32 simulators */
|
||||||
|
typedef long time_t;
|
||||||
|
|
||||||
|
/* this define below is used by the mingw headers to prevent duplicate
|
||||||
|
typedefs */
|
||||||
|
#define _TIME_T_DEFINED
|
||||||
|
time_t time(time_t *t);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _TIME_H_ */
|
#endif /* _TIME_H_ */
|
||||||
|
|
||||||
|
|
|
@ -2485,9 +2485,12 @@ unsigned long mpeg_num_recorded_bytes(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif CONFIG_HWCODEC == MASNONE
|
#elif (CONFIG_HWCODEC == MASNONE) || defined(SIMULATOR)
|
||||||
|
|
||||||
/* dummies coming up */
|
/* dummies coming up
|
||||||
|
|
||||||
|
NOTE: when we implment these functions for real for software coded targets,
|
||||||
|
these dummies shall remain for the simulator */
|
||||||
|
|
||||||
void bitswap(unsigned char *data, int length)
|
void bitswap(unsigned char *data, int length)
|
||||||
{
|
{
|
||||||
|
|
|
@ -166,10 +166,10 @@ sub runone {
|
||||||
|
|
||||||
my $target = $ARGV[0];
|
my $target = $ARGV[0];
|
||||||
|
|
||||||
my $exe = "";
|
my $exe = $ARGV[1];
|
||||||
|
|
||||||
if($target !~ /sim/i) {
|
if(!$exe) {
|
||||||
# not a simulator
|
# not specified, guess!
|
||||||
if($target =~ /(recorder|ondio)/i) {
|
if($target =~ /(recorder|ondio)/i) {
|
||||||
$exe = "ajbrec.ajz";
|
$exe = "ajbrec.ajz";
|
||||||
}
|
}
|
||||||
|
|
235
tools/configure
vendored
235
tools/configure
vendored
|
@ -19,32 +19,83 @@ input() {
|
||||||
echo $response
|
echo $response
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prefixtools () {
|
||||||
|
prefix="$1"
|
||||||
|
CC=${prefix}gcc
|
||||||
|
WINDRES=${prefix}windres
|
||||||
|
DLLTOOL=${prefix}dlltool
|
||||||
|
DLLWRAP=${prefix}dllwrap
|
||||||
|
RANLIB=${prefix}ranlib
|
||||||
|
LD=${prefix}ld
|
||||||
|
AR=${prefix}ar
|
||||||
|
AS=${prefix}as
|
||||||
|
OC=${prefix}objcopy
|
||||||
|
}
|
||||||
|
|
||||||
|
crosswincc () {
|
||||||
|
# naive approach to selecting a mingw cross-compiler on linux/*nix
|
||||||
|
echo "Enabling win32 crosscompiling"
|
||||||
|
|
||||||
|
prefixtools i386-mingw32msvc-
|
||||||
|
|
||||||
|
LDOPTS="-lgdi32 -luser32 -mwindows"
|
||||||
|
# add cross-compiler option(s)
|
||||||
|
GCCOPTS="$GCCOPTS -mno-cygwin"
|
||||||
|
}
|
||||||
|
|
||||||
|
simcc () {
|
||||||
|
|
||||||
|
# default tool setup for native building
|
||||||
|
prefixtools ""
|
||||||
|
|
||||||
|
GCCOPTS='-W -Wall -g -fno-builtin -I$(ROOTDIR)/uisimulator/common -I$(ROOTDIR)/uisimulator/$(SIMVER)'
|
||||||
|
|
||||||
|
output="rockboxui" # use this as default output binary name
|
||||||
|
|
||||||
|
case $uname in
|
||||||
|
CYGWIN*)
|
||||||
|
echo "Cygwin host detected"
|
||||||
|
LDOPTS='-L/usr/X11R6/lib -lSM -lICE -lXt -lX11 -lXmu -lSM -lICE -lX11 -lpthread'
|
||||||
|
output="rockboxui.exe" # use this as output binary name
|
||||||
|
;;
|
||||||
|
|
||||||
|
Linux)
|
||||||
|
echo "Linux host detected"
|
||||||
|
LDOPTS='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -lnsl -ldl -lpthread'
|
||||||
|
if [ "$simver" = "win32" ]; then
|
||||||
|
crosswincc # setup cross-compiler
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
FreeBSD)
|
||||||
|
echo "FreeBSD host detected"
|
||||||
|
LDOPTS='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -dl -lpthread'
|
||||||
|
if [ "$simver" = "win32" ]; then
|
||||||
|
crosswincc # setup cross-compiler
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "Unsupported system: $uname, fix configure and retry"
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
shcc () {
|
shcc () {
|
||||||
CC=sh-elf-gcc
|
prefixtools sh-elf-
|
||||||
LD=sh-elf-ld
|
|
||||||
AR=sh-elf-ar
|
|
||||||
AS=sh-elf-as
|
|
||||||
OC=sh-elf-objcopy
|
|
||||||
GCCOPTS="$CCOPTS -m1"
|
GCCOPTS="$CCOPTS -m1"
|
||||||
GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
|
GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
|
||||||
}
|
}
|
||||||
|
|
||||||
calmrisccc () {
|
calmrisccc () {
|
||||||
CC=calmrisc16-unknown-elf-gcc
|
prefixtools calmrisc16-unknown-elf-
|
||||||
LD=calmrisc16-unknown-elf-ld
|
|
||||||
AR=calmrisc16-unknown-elf-ar
|
|
||||||
AS=calmrisc16-unknown-elf-as
|
|
||||||
OC=calmrisc16-unknown-elf-objcopy
|
|
||||||
GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
|
GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
|
||||||
GCCOPTIMIZE="-fomit-frame-pointer"
|
GCCOPTIMIZE="-fomit-frame-pointer"
|
||||||
}
|
}
|
||||||
|
|
||||||
coldfirecc () {
|
coldfirecc () {
|
||||||
CC=m68k-elf-gcc
|
prefixtools m68k-elf-
|
||||||
LD=m68k-elf-ld
|
|
||||||
AR=m68k-elf-ar
|
|
||||||
AS=m68k-elf-as
|
|
||||||
OC=m68k-elf-objcopy
|
|
||||||
GCCOPTS="$CCOPTS -g -m5200 -Wa\,-m5249 -malign-int -mstrict-align"
|
GCCOPTS="$CCOPTS -g -m5200 -Wa\,-m5249 -malign-int -mstrict-align"
|
||||||
GCCOPTIMIZE="-fomit-frame-pointer"
|
GCCOPTIMIZE="-fomit-frame-pointer"
|
||||||
}
|
}
|
||||||
|
@ -86,6 +137,13 @@ if [ -z "$simver" ]; then
|
||||||
case $option in
|
case $option in
|
||||||
[Ww])
|
[Ww])
|
||||||
simver="win32"
|
simver="win32"
|
||||||
|
|
||||||
|
WINDRES=windres
|
||||||
|
DLLTOOL=dlltool
|
||||||
|
DLLWRAP=dllwrap
|
||||||
|
|
||||||
|
# make sure the code knows this is for win32
|
||||||
|
extradefines="$extradefines -DWIN32"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
simver="x11"
|
simver="x11"
|
||||||
|
@ -95,77 +153,6 @@ if [ -z "$simver" ]; then
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
simul () {
|
|
||||||
|
|
||||||
sed > Makefile \
|
|
||||||
-e "s,@ROOTDIR@,${rootdir},g" \
|
|
||||||
-e "s,@ARCHOS@,${archos},g" \
|
|
||||||
-e "s,@DEBUG@,${debug},g" \
|
|
||||||
-e "s,@KEYPAD@,${keypad},g" \
|
|
||||||
-e "s,@PWD@,${pwd},g" \
|
|
||||||
-e "s,@LANGUAGE@,${language},g" \
|
|
||||||
-e "s,@TARGET@,${target},g" \
|
|
||||||
-e "s,@PLUGINS@,${plugins},g" \
|
|
||||||
-e "s,@CODECS@,${codecs},g" \
|
|
||||||
-e "s,@SIMVER@,${simver},g" \
|
|
||||||
-e "s,@MEMORY@,${memory},g" \
|
|
||||||
<<EOF
|
|
||||||
## Automaticly generated. http://rockbox.haxx.se
|
|
||||||
|
|
||||||
export ARCHOS=@ARCHOS@
|
|
||||||
export ROOTDIR=@ROOTDIR@
|
|
||||||
export FIRMDIR=\$(ROOTDIR)/firmware
|
|
||||||
export APPSDIR=\$(ROOTDIR)/apps
|
|
||||||
export TOOLSDIR=\$(ROOTDIR)/tools
|
|
||||||
export DOCSDIR=\$(ROOTDIR)/docs
|
|
||||||
export APPSDIR=@ROOTDIR@/apps
|
|
||||||
export SIMDIR=\$(ROOTDIR)/uisimulator/@SIMVER@
|
|
||||||
export DEBUG=@DEBUG@
|
|
||||||
export KEYPAD=@KEYPAD@
|
|
||||||
export OBJDIR=@PWD@
|
|
||||||
export SIMVER=@SIMVER@
|
|
||||||
export TARGET=@TARGET@
|
|
||||||
export LANGUAGE=@LANGUAGE@
|
|
||||||
export VERSION=\$(shell date +%y%m%d-%H%M)
|
|
||||||
export ENABLEDPLUGINS=@PLUGINS@
|
|
||||||
export SOFTWARECODECS=@CODECS@
|
|
||||||
export MEMORYSIZE=@MEMORY@
|
|
||||||
|
|
||||||
.PHONY:
|
|
||||||
|
|
||||||
all: sim
|
|
||||||
|
|
||||||
sim:
|
|
||||||
\$(MAKE) -C \$(SIMDIR)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
\$(MAKE) -C \$(SIMDIR) clean
|
|
||||||
rm -rf rockbox.zip
|
|
||||||
|
|
||||||
tags:
|
|
||||||
@rm -f TAGS
|
|
||||||
make -C \$(SIMDIR) tags
|
|
||||||
|
|
||||||
zip:
|
|
||||||
\$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" sim\$(TARGET)
|
|
||||||
|
|
||||||
install:
|
|
||||||
@echo "installing a full setup in your archos dir"
|
|
||||||
@(make zip && cd archos && unzip -oq ../rockbox.zip)
|
|
||||||
EOF
|
|
||||||
|
|
||||||
echo "Created Makefile"
|
|
||||||
|
|
||||||
if [ -d "archos" ]; then
|
|
||||||
echo "sub directory archos already present"
|
|
||||||
else
|
|
||||||
mkdir archos
|
|
||||||
echo "created an archos subdirectory for simulating the hard disk"
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
picklang() {
|
picklang() {
|
||||||
# figure out which languages that are around
|
# figure out which languages that are around
|
||||||
for file in $rootdir/apps/lang/*.lang; do
|
for file in $rootdir/apps/lang/*.lang; do
|
||||||
|
@ -238,7 +225,7 @@ if [ "$target" = "update" ]; then
|
||||||
else
|
else
|
||||||
|
|
||||||
echo "This script will setup your Rockbox build environment."
|
echo "This script will setup your Rockbox build environment."
|
||||||
echo "Further docs here: http://rockbox.haxx.se/docs/"
|
echo "Further docs here: http://www.rockbox.org/"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
@ -471,6 +458,7 @@ if [ -z "$debug" ]; then
|
||||||
[Ss])
|
[Ss])
|
||||||
debug="1"
|
debug="1"
|
||||||
simulator="yes"
|
simulator="yes"
|
||||||
|
extradefines="-DSIMULATOR"
|
||||||
echo "Simulator build selected"
|
echo "Simulator build selected"
|
||||||
whichsim
|
whichsim
|
||||||
;;
|
;;
|
||||||
|
@ -504,10 +492,43 @@ if [ -z "$language" ]; then
|
||||||
echo "Language set to $language"
|
echo "Language set to $language"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
uname=`uname`
|
||||||
|
|
||||||
if [ "yes" = "$simulator" ]; then
|
if [ "yes" = "$simulator" ]; then
|
||||||
# we have already dealt with the simulator Makefile separately
|
# setup compiler and things for simulator
|
||||||
simul
|
simcc
|
||||||
exit
|
|
||||||
|
if [ -d "archos" ]; then
|
||||||
|
echo "sub directory archos already present"
|
||||||
|
else
|
||||||
|
mkdir archos
|
||||||
|
echo "created an archos subdirectory for simulating the hard disk"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Now, figure out version number of the (gcc) compiler we are about to use
|
||||||
|
gccver=`$CC -dumpversion`;
|
||||||
|
|
||||||
|
if [ -z "$gccver" ]; then
|
||||||
|
echo "WARNING: The compiler you must use ($CC) is not in your path!"
|
||||||
|
echo "WARNING: this may cause your build to fail since we cannot do the"
|
||||||
|
echo "WARNING: checks we want now."
|
||||||
|
else
|
||||||
|
|
||||||
|
# gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't
|
||||||
|
# DEPEND on it
|
||||||
|
|
||||||
|
num1=`echo $gccver | cut -d . -f1`
|
||||||
|
num2=`echo $gccver | cut -d . -f2`
|
||||||
|
gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
|
||||||
|
|
||||||
|
# This makes:
|
||||||
|
# 3.3.X => 303
|
||||||
|
# 3.4.X => 304
|
||||||
|
# 2.95.3 => 295
|
||||||
|
|
||||||
|
echo "Using $CC $gccver ($gccnum)"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed > Makefile \
|
sed > Makefile \
|
||||||
|
@ -523,6 +544,10 @@ sed > Makefile \
|
||||||
-e "s,@AR@,${AR},g" \
|
-e "s,@AR@,${AR},g" \
|
||||||
-e "s,@AS@,${AS},g" \
|
-e "s,@AS@,${AS},g" \
|
||||||
-e "s,@OC@,${OC},g" \
|
-e "s,@OC@,${OC},g" \
|
||||||
|
-e "s,@WINDRES@,${WINDRES},g" \
|
||||||
|
-e "s,@DLLTOOL@,${DLLTOOL},g" \
|
||||||
|
-e "s,@DLLWRAP@,${DLLWRAP},g" \
|
||||||
|
-e "s,@RANLIB@,${RANLIB},g" \
|
||||||
-e "s,@TOOL@,${tool},g" \
|
-e "s,@TOOL@,${tool},g" \
|
||||||
-e "s,@OUTPUT@,${output},g" \
|
-e "s,@OUTPUT@,${output},g" \
|
||||||
-e "s,@APPEXTRA@,${appextra},g" \
|
-e "s,@APPEXTRA@,${appextra},g" \
|
||||||
|
@ -531,11 +556,15 @@ sed > Makefile \
|
||||||
-e "s,@PLUGINS@,${plugins},g" \
|
-e "s,@PLUGINS@,${plugins},g" \
|
||||||
-e "s,@CODECS@,${codecs},g" \
|
-e "s,@CODECS@,${codecs},g" \
|
||||||
-e "s,@GCCOPTS@,${GCCOPTS},g" \
|
-e "s,@GCCOPTS@,${GCCOPTS},g" \
|
||||||
|
-e "s,@LDOPTS@,${LDOPTS},g" \
|
||||||
-e "s,@LOADADDRESS@,${loadaddress},g" \
|
-e "s,@LOADADDRESS@,${loadaddress},g" \
|
||||||
-e "s,@EXTRADEF@,${extradefines},g" \
|
-e "s,@EXTRADEF@,${extradefines},g" \
|
||||||
-e "s,@APPSDIR@,${appsdir},g" \
|
-e "s,@APPSDIR@,${appsdir},g" \
|
||||||
|
-e "s,@SIMVER@,${simver},g" \
|
||||||
|
-e "s,@GCCVER@,${gccver},g" \
|
||||||
|
-e "s,@GCCNUM@,${gccnum},g" \
|
||||||
<<EOF
|
<<EOF
|
||||||
## Automaticly generated. http://rockbox.haxx.se
|
## Automaticly generated. http://www.rockbox.org/
|
||||||
|
|
||||||
export ROOTDIR=@ROOTDIR@
|
export ROOTDIR=@ROOTDIR@
|
||||||
export FIRMDIR=\$(ROOTDIR)/firmware
|
export FIRMDIR=\$(ROOTDIR)/firmware
|
||||||
|
@ -562,8 +591,17 @@ export LD=@LD@
|
||||||
export AR=@AR@
|
export AR=@AR@
|
||||||
export AS=@AS@
|
export AS=@AS@
|
||||||
export OC=@OC@
|
export OC=@OC@
|
||||||
|
export WINDRES=@WINDRES@
|
||||||
|
export DLLTOOL=@DLLTOOL@
|
||||||
|
export DLLWRAP=@DLLWRAP@
|
||||||
|
export RANLIB=@RANLIB@
|
||||||
export GCCOPTS=@GCCOPTS@
|
export GCCOPTS=@GCCOPTS@
|
||||||
export LOADADDRESS=@LOADADDRESS@
|
export LOADADDRESS=@LOADADDRESS@
|
||||||
|
export SIMVER=@SIMVER@
|
||||||
|
export SIMDIR=\$(ROOTDIR)/uisimulator/\$(SIMVER)
|
||||||
|
export LDOPTS=@LDOPTS@
|
||||||
|
export GCCVER=@GCCVER@
|
||||||
|
export GCCNUM=@GCCNUM@
|
||||||
|
|
||||||
.PHONY: all clean tags zip
|
.PHONY: all clean tags zip
|
||||||
|
|
||||||
|
@ -583,8 +621,19 @@ tags:
|
||||||
\$(MAKE) -C \$(APPSDIR)/plugins tags
|
\$(MAKE) -C \$(APPSDIR)/plugins tags
|
||||||
\$(MAKE) -C \$(APPSDIR)/plugins/lib tags
|
\$(MAKE) -C \$(APPSDIR)/plugins/lib tags
|
||||||
|
|
||||||
zip:
|
zip: all
|
||||||
\$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" \$(TARGET)
|
\$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
if [ "yes" = "$simulator" ]; then
|
||||||
|
|
||||||
|
cat >> Makefile <<EOF
|
||||||
|
|
||||||
|
install:
|
||||||
|
@echo "installing a full setup in your archos dir"
|
||||||
|
@(make zip && cd archos && unzip -oq ../rockbox.zip)
|
||||||
|
EOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Created Makefile"
|
echo "Created Makefile"
|
||||||
|
|
|
@ -14,3 +14,6 @@ win32/rockbox.ico
|
||||||
x11/*.[ch]
|
x11/*.[ch]
|
||||||
x11/Makefile
|
x11/Makefile
|
||||||
x11/archos/rockbox112.bmp
|
x11/archos/rockbox112.bmp
|
||||||
|
common/SOURCES
|
||||||
|
win32/SOURCES
|
||||||
|
x11/SOURCES
|
||||||
|
|
56
uisimulator/common/Makefile
Normal file
56
uisimulator/common/Makefile
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
############################################################################
|
||||||
|
# __________ __ ___.
|
||||||
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
# \/ \/ \/ \/ \/
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
# Copyright (C) 2002 by Daniel Stenberg <daniel@haxx.se>
|
||||||
|
#
|
||||||
|
# All files in this archive are subject to the GNU General Public License.
|
||||||
|
# See the file COPYING in the source tree root for full license agreement.
|
||||||
|
#
|
||||||
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
# KIND, either express or implied.
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
DEPFILE = $(OBJDIR)/dep-commonsim
|
||||||
|
|
||||||
|
RM = rm -f
|
||||||
|
DEBUG = -g
|
||||||
|
|
||||||
|
# Use this for simulator-only files
|
||||||
|
INCLUDES = -I. -I$(OBJDIR) -I$(FIRMDIR)/export -I$(APPSDIR)
|
||||||
|
|
||||||
|
SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
|
||||||
|
$(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - )
|
||||||
|
OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
|
||||||
|
|
||||||
|
DEFINES := -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
|
||||||
|
$(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES)
|
||||||
|
|
||||||
|
SOURCES = $(SRC)
|
||||||
|
|
||||||
|
DIRS = .
|
||||||
|
|
||||||
|
CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) $(GCCOPTS)
|
||||||
|
|
||||||
|
OUTFILE = $(OBJDIR)/libsim.a
|
||||||
|
|
||||||
|
all: $(OUTFILE)
|
||||||
|
|
||||||
|
include $(TOOLSDIR)/make.inc
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@echo "cleaning commonsim"
|
||||||
|
@$(RM) $(OBJS) *~ core $(DEPFILE)
|
||||||
|
|
||||||
|
$(OUTFILE): $(OBJS)
|
||||||
|
@echo "AR+RANLIB $@"
|
||||||
|
@$(AR) ruv $@ $(OBJS) >/dev/null 2>&1
|
||||||
|
@$(RANLIB) $@
|
||||||
|
|
||||||
|
-include $(DEPFILE)
|
8
uisimulator/common/SOURCES
Normal file
8
uisimulator/common/SOURCES
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
fmradio.c
|
||||||
|
font-player.c
|
||||||
|
io.c
|
||||||
|
lcd-common.c
|
||||||
|
lcd-playersim.c
|
||||||
|
mpegplay.c
|
||||||
|
sim_icons.c
|
||||||
|
stubs.c
|
|
@ -17,145 +17,52 @@
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
APPDIR = ../../apps
|
|
||||||
RECDIR = $(APPDIR)/recorder
|
|
||||||
PLAYDIR = $(APPDIR)/player
|
|
||||||
PLUGINDIR = $(APPDIR)/plugins
|
|
||||||
SIMCOMMON = ../common
|
SIMCOMMON = ../common
|
||||||
|
|
||||||
ISONDIO := $(findstring ONDIO, $(TARGET))
|
DEPFILE = $(OBJDIR)/dep-simwin
|
||||||
ISIRIVER := $(findstring IRIVER, $(TARGET))
|
|
||||||
ISPLAYER := $(findstring PLAYER, $(TARGET))
|
|
||||||
ifeq ($(ISPLAYER), PLAYER)
|
|
||||||
MACHINEDIR = $(PLAYDIR)
|
|
||||||
else
|
|
||||||
MACHINEDIR = $(RECDIR)
|
|
||||||
endif
|
|
||||||
|
|
||||||
PREVAPPDIR= ..
|
|
||||||
FIRMWAREDIR = ../../firmware
|
|
||||||
|
|
||||||
# build some sources from these dirs
|
|
||||||
DRIVERS = $(FIRMWAREDIR)/drivers
|
|
||||||
COMMON = $(FIRMWAREDIR)/common
|
|
||||||
|
|
||||||
# include here:
|
|
||||||
EXPORT = $(FIRMWAREDIR)/export
|
|
||||||
TOOLSDIR = ../../tools
|
|
||||||
DOCSDIR = ../../docs
|
|
||||||
|
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
DEBUG = -g
|
DEBUG = -g
|
||||||
|
|
||||||
ifndef OBJDIR
|
INCLUDES = -I. -I$(SIMCOMMON) -I$(OBJDIR) -I$(FIRMDIR)/export -I$(APPSDIR)
|
||||||
no_configure:
|
|
||||||
@echo "Don't run make here. Run the tools/configure script from your own build"
|
|
||||||
@echo "directory, then run make there."
|
|
||||||
@echo
|
|
||||||
@echo "More help on how to build rockbox can be found here:"
|
|
||||||
@echo "http://rockbox.haxx.se/docs/how_to_compile.html"
|
|
||||||
endif
|
|
||||||
|
|
||||||
DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
|
DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
|
||||||
$(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES)
|
$(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES)
|
||||||
|
|
||||||
LDFLAGS = -lgdi32 -luser32
|
LDFLAGS = -lgdi32 -luser32
|
||||||
|
|
||||||
# Use this for simulator-only files
|
SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
|
||||||
INCLUDES = -I. -I$(EXPORT) -I$(APPDIR) -I$(MACHINEDIR) -I$(SIMCOMMON) -I$(OBJDIR) -I$(PLUGINDIR)/lib
|
$(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - )
|
||||||
|
OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
|
||||||
|
|
||||||
# The true Rockbox Applications should use this include path:
|
SOURCES = $(SRC)
|
||||||
APPINCLUDES = $(INCLUDES)
|
DIRS = .
|
||||||
|
|
||||||
DEFINES += -DWIN32
|
|
||||||
|
|
||||||
CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall -mno-cygwin
|
CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall -mno-cygwin
|
||||||
|
|
||||||
APPCFLAGS = $(DEBUG) $(DEFINES) $(APPINCLUDES) -W -Wall -mno-cygwin
|
|
||||||
DLLTOOLFLAGS = --export-all
|
DLLTOOLFLAGS = --export-all
|
||||||
DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
|
DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
|
||||||
|
|
||||||
UNAME := $(shell uname|sed -e "s/CYGWIN.*/CYGWIN/")
|
OUTFILE = $(OBJDIR)/libsim.a
|
||||||
EXEFILE := $(OBJDIR)/rockboxui.exe
|
|
||||||
|
|
||||||
ifeq ($(UNAME),CYGWIN)
|
all: $(OUTFILE)
|
||||||
CC = gcc
|
@echo "MAKE in common sim"
|
||||||
WINDRES = windres
|
$(MAKE) -C $(SIMCOMMON)
|
||||||
DLLTOOL = dlltool
|
|
||||||
DLLWRAP = dllwrap
|
|
||||||
RANLIB = ranlib
|
|
||||||
DEFINES += -DNOCYGWIN
|
|
||||||
LDFLAGS += -mno-cygwin
|
|
||||||
else
|
|
||||||
CC = i386-mingw32msvc-gcc
|
|
||||||
WINDRES = i386-mingw32msvc-windres
|
|
||||||
DLLTOOL = i386-mingw32msvc-dlltool
|
|
||||||
DLLWRAP = i386-mingw32msvc-dllwrap
|
|
||||||
RANLIB = i386-mingw32msvc-ranlib
|
|
||||||
CFLAGS += -mwindows
|
|
||||||
LDFLAGS += -mwindows
|
|
||||||
APPCFLAGS += -mwindows
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ISPLAYER),PLAYER)
|
include $(TOOLSDIR)/make.inc
|
||||||
LCDSRSC = lcd-playersim.c lcd-player.c lcd-player-charset.c font-player.c
|
|
||||||
else
|
|
||||||
ifeq ($(ISIRIVER),IRIVER)
|
|
||||||
LCDSRSC = lcd-h100.c sysfont.c font.c
|
|
||||||
else
|
|
||||||
LCDSRSC = lcd-recorder.c sysfont.c font.c
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
COMMONSRCS = io.c stubs.c lcd-common.c sim_icons.c fmradio.c
|
|
||||||
|
|
||||||
FIRMSRCS = $(LCDSRSC) id3.c mp3data.c usb.c mpeg.c mp3_playback.c \
|
$(OUTFILE): $(OBJS)
|
||||||
powermgmt.c power.c sprintf.c buffer.c strtok.c random.c \
|
@echo "AR+RANLIB $@"
|
||||||
timefuncs.c strcasestr.c
|
@$(AR) ruv $@ $(OBJS) >/dev/null 2>&1
|
||||||
|
@$(RANLIB) $@
|
||||||
APPS = main.c tree.c menu.c credits.c main_menu.c icons.c language.c \
|
|
||||||
playlist.c wps.c wps-display.c settings.c status.c \
|
|
||||||
screens.c sleeptimer.c keyboard.c onplay.c\
|
|
||||||
misc.c plugin.c playlist_viewer.c bookmark.c filetypes.c \
|
|
||||||
settings_menu.c sound_menu.c playlist_menu.c filetree.c dbtree.c
|
|
||||||
|
|
||||||
ifneq ($(ISPLAYER),PLAYER)
|
|
||||||
APPS += peakmeter.c bmp.c widgets.c radio.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
SRCS = button.c lcd-win32.c panic-win32.c thread-win32.c \
|
|
||||||
debug-win32.c kernel.c string-win32.c uisw32.c \
|
|
||||||
$(APPS) $(FIRMSRCS) $(COMMONSRCS)
|
|
||||||
|
|
||||||
OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o) $(OBJDIR)/uisw32-res.o
|
|
||||||
|
|
||||||
ifdef ENABLEDPLUGINS
|
|
||||||
ROCKS := $(patsubst $(PLUGINDIR)/%.c,$(OBJDIR)/%.rock,$(wildcard $(PLUGINDIR)/*.c))
|
|
||||||
PLUGINLIBOBJS := $(patsubst $(PLUGINDIR)/lib/%.c,$(OBJDIR)/%.o,$(wildcard $(PLUGINDIR)/lib/*.c))
|
|
||||||
endif
|
|
||||||
|
|
||||||
all: $(TOOLSDIR)/convbdf $(EXEFILE) $(ROCKS)
|
|
||||||
|
|
||||||
$(ROCKS): $(OBJDIR)/libplugin.a
|
|
||||||
|
|
||||||
$(TOOLSDIR)/convbdf:
|
|
||||||
$(MAKE) -C $(TOOLSDIR)
|
|
||||||
|
|
||||||
$(EXEFILE): $(OBJDIR)/lang.o $(OBJS)
|
|
||||||
@echo LD $@
|
|
||||||
@$(CC) $(OBJS) -o $(EXEFILE) $(LDFLAGS)
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(OBJS) *~ core $(EXEFILE) $(CLIENTS) $(OBJDIR)/uisw32-res.o \
|
@echo "cleaning simwin"
|
||||||
$(OBJDIR)/lang.[cho] $(OBJDIR)/build.lang $(OBJDIR)/*.o \
|
@$(RM) $(OBJS) *~ core $(OUTFILE) $(OBJDIR)/uisw32-res.o \
|
||||||
$(OBJDIR)/*.rock $(OBJDIR)/*.def $(OBJDIR)/sysfont.c \
|
$(OBJDIR)/UI256.bmp $(DEPFILE)
|
||||||
$(OBJDIR)/credits.raw $(OBJDIR)/libplugin.a
|
@$(MAKE) -C $(SIMCOMMON) clean
|
||||||
$(RM) -f $(OBJDIR)/UI256.bmp
|
|
||||||
$(RM) -r $(DEPS)
|
|
||||||
|
|
||||||
################## Specific dependencies ##################
|
################## Specific dependencies ##################
|
||||||
$(OBJDIR)/credits.raw: $(DOCSDIR)/CREDITS
|
|
||||||
perl $(APPDIR)/credits.pl < $< > $@
|
|
||||||
|
|
||||||
$(OBJDIR)/UI256.bmp: UI-$(ARCHOS).bmp
|
$(OBJDIR)/UI256.bmp: UI-$(ARCHOS).bmp
|
||||||
@echo UI
|
@echo UI
|
||||||
@cp $< $@
|
@cp $< $@
|
||||||
|
@ -163,83 +70,4 @@ $(OBJDIR)/UI256.bmp: UI-$(ARCHOS).bmp
|
||||||
$(OBJDIR)/uisw32-res.o: uisw32.rc $(OBJDIR)/UI256.bmp
|
$(OBJDIR)/uisw32-res.o: uisw32.rc $(OBJDIR)/UI256.bmp
|
||||||
$(WINDRES) -I$(OBJDIR) -i $< -o $@
|
$(WINDRES) -I$(OBJDIR) -i $< -o $@
|
||||||
|
|
||||||
$(OBJDIR)/credits.o: $(APPDIR)/credits.c $(APPDIR)/credits.h $(OBJDIR)/credits.raw
|
-include $(DEPFILE)
|
||||||
|
|
||||||
$(OBJDIR)/button.o: button.c
|
|
||||||
$(OBJDIR)/plugin.o: $(APPDIR)/plugin.c plugin-win32.h
|
|
||||||
$(OBJDIR)/build.lang: $(APPDIR)/lang/$(LANGUAGE).lang
|
|
||||||
@echo UPLANG
|
|
||||||
@perl $(TOOLSDIR)/uplang $(APPDIR)/lang/english.lang $< > $@
|
|
||||||
|
|
||||||
$(OBJDIR)/lang.o: $(OBJDIR)/build.lang
|
|
||||||
@echo GENLANG
|
|
||||||
@perl -s $(TOOLSDIR)/genlang -p=$(OBJDIR)/lang $<
|
|
||||||
@$(CC) $(CFLAGS) -c $(OBJDIR)/lang.c -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/sysfont.o: $(FIRMWAREDIR)/fonts/clR6x8.bdf
|
|
||||||
@echo CC $<
|
|
||||||
@$(TOOLSDIR)/convbdf -c -o $(OBJDIR)/sysfont.c $<
|
|
||||||
@$(CC) $(APPCFLAGS) -c $(OBJDIR)/sysfont.c -o $@
|
|
||||||
|
|
||||||
################## Plugins ##################
|
|
||||||
$(OBJDIR)/libplugin.a: $(PLUGINLIBOBJS)
|
|
||||||
@echo AR $@
|
|
||||||
@$(AR) ru $@ $+
|
|
||||||
@$(RANLIB) $@
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o: $(PLUGINDIR)/lib/%.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(CFLAGS) -DPLUGIN -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/%.po : $(PLUGINDIR)/%.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(APPCFLAGS) -DPLUGIN -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/%.rock : $(OBJDIR)/%.po $(OBJDIR)/libplugin.a
|
|
||||||
@echo DLL $@
|
|
||||||
@$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $<
|
|
||||||
@$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< $(OBJDIR)/libplugin.a -o $@
|
|
||||||
@chmod -x $@
|
|
||||||
|
|
||||||
################## Patterns for building objects ##################
|
|
||||||
$(OBJDIR)/%.o: %.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(CFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o: $(SIMCOMMON)/%.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(APPCFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o: $(MACHINEDIR)/%.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(APPCFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o: $(DRIVERS)/%.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(APPCFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o: $(FIRMWAREDIR)/%.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(APPCFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o: $(COMMON)/%.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(APPCFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o: $(APPDIR)/%.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(APPCFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
################## Auto-dependencies ##################
|
|
||||||
DEPS:=$(OBJDIR)/.deps
|
|
||||||
|
|
||||||
$(DEPS)/%.d: %.c
|
|
||||||
@$(SHELL) -c 'if [ ! -d $(DEPS) ]; then \
|
|
||||||
echo Creating the dependency directory: $(DEPS); \
|
|
||||||
mkdir -p $(DEPS); fi'
|
|
||||||
@echo "Updating Dependencies for $<"
|
|
||||||
@$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \
|
|
||||||
|sed '\''s|\($*\)\.o[ :]*|$(OBJDIR)/\1.o $(<:%.c=%.d) : |g'\'' > $@; \
|
|
||||||
[ -s $@ ] || rm -f $@'
|
|
||||||
|
|
||||||
-include $(SRCS:%.c=$(DEPS)/%.d)
|
|
||||||
|
|
10
uisimulator/win32/SOURCES
Normal file
10
uisimulator/win32/SOURCES
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
button.c
|
||||||
|
debug-win32.c
|
||||||
|
dir-win32.c
|
||||||
|
kernel.c
|
||||||
|
lcd-win32.c
|
||||||
|
mpeg-win32.c
|
||||||
|
panic-win32.c
|
||||||
|
string-win32.c
|
||||||
|
thread-win32.c
|
||||||
|
uisw32.c
|
|
@ -17,252 +17,44 @@
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
RECDIR = $(APPSDIR)/recorder
|
|
||||||
PLAYDIR = $(APPSDIR)/player
|
|
||||||
PLUGINDIR = $(APPSDIR)/plugins
|
|
||||||
SIMCOMMON = ../common
|
SIMCOMMON = ../common
|
||||||
|
|
||||||
ISONDIO := $(findstring ONDIO, $(TARGET))
|
DEPFILE = $(OBJDIR)/dep-sim
|
||||||
ISIRIVER := $(findstring IRIVER, $(TARGET))
|
|
||||||
ISPLAYER := $(findstring PLAYER, $(TARGET))
|
|
||||||
ifeq ($(ISPLAYER), PLAYER)
|
|
||||||
MACHINEDIR = $(PLAYDIR)
|
|
||||||
else
|
|
||||||
MACHINEDIR = $(RECDIR)
|
|
||||||
endif
|
|
||||||
|
|
||||||
PREVAPPSDIR= ..
|
|
||||||
|
|
||||||
# build some sources from these dirs
|
|
||||||
DRIVERS = $(FIRMDIR)/drivers
|
|
||||||
COMMON = $(FIRMDIR)/common
|
|
||||||
|
|
||||||
# include here:
|
|
||||||
EXPORT = $(FIRMDIR)/export
|
|
||||||
|
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
DEBUG = -g
|
DEBUG = -g
|
||||||
|
|
||||||
ifndef OBJDIR
|
# Use this for simulator-only files
|
||||||
no_configure:
|
INCLUDES = -I. -I$(SIMCOMMON) -I$(OBJDIR) -I$(FIRMDIR)/export -I$(APPSDIR)
|
||||||
@echo "Don't run make here. Run the tools/configure script from your own build"
|
|
||||||
@echo "directory, then run make there."
|
SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
|
||||||
@echo
|
$(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - )
|
||||||
@echo "More help on how to build rockbox can be found here:"
|
OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
|
||||||
@echo "http://rockbox.haxx.se/docs/how_to_compile.html"
|
|
||||||
endif
|
|
||||||
|
|
||||||
DEFINES := -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
|
DEFINES := -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
|
||||||
$(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES)
|
$(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES)
|
||||||
|
|
||||||
# Use this for simulator-only files
|
SOURCES = $(SRC)
|
||||||
INCLUDES = -I. -I$(EXPORT) -I$(APPSDIR) -I$(MACHINEDIR) -I$(SIMCOMMON) -I$(OBJDIR) -I$(PLUGINDIR)/lib
|
|
||||||
|
|
||||||
# The true Rockbox Applications should use this include path:
|
DIRS = .
|
||||||
APPINCLUDES = $(INCLUDES)
|
|
||||||
|
|
||||||
SRCDIRS = . $(DRIVERS) $(FIRMDIR)/export $(APPSDIR) $(MACHINEDIR)
|
CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) $(GCCOPTS)
|
||||||
|
|
||||||
# The true Rockbox Applications should use this include path:
|
OUTFILE = $(OBJDIR)/libsim.a
|
||||||
APPINCLUDES = $(INCLUDES)
|
|
||||||
|
|
||||||
LIBS = -lpthread
|
all: $(OUTFILE)
|
||||||
|
@echo "MAKE in common sim"
|
||||||
|
$(MAKE) -C $(SIMCOMMON)
|
||||||
|
|
||||||
CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall
|
include $(TOOLSDIR)/make.inc
|
||||||
|
|
||||||
APPCFLAGS = $(DEBUG) $(DEFINES) $(APPINCLUDES) -W -Wall
|
|
||||||
|
|
||||||
UNAME := $(shell uname|sed -e "s/CYGWIN.*/CYGWIN/")
|
|
||||||
EXEFILE = $(OBJDIR)/rockboxui
|
|
||||||
ifeq ($(UNAME),Linux)
|
|
||||||
LDFLAGS = -lX11 -lm -lXt -lXmu -lnsl -ldl
|
|
||||||
INCLUDES += -I/usr/X11R6/include
|
|
||||||
LIBDIRS = -L/usr/X11R6/lib
|
|
||||||
DEFINES += -DHAVE_OSS
|
|
||||||
else
|
|
||||||
ifeq ($(UNAME),CYGWIN)
|
|
||||||
LDFLAGS = -lSM -lICE -lXt -lX11 -lXmu -lSM -lICE -lX11
|
|
||||||
INCLUDES += -I/usr/X11R6/include
|
|
||||||
LIBDIRS = -L/usr/X11R6/lib
|
|
||||||
DEFINES += -DHAVE_OSS -D_SSIZE_T_
|
|
||||||
EXEFILE = $(OBJDIR)/rockboxui.exe
|
|
||||||
else
|
|
||||||
ifeq ($(UNAME),FreeBSD)
|
|
||||||
LIBS = -pthread
|
|
||||||
LDFLAGS = -lX11 -lm -lXt -lXmu
|
|
||||||
INCLUDES += -I/usr/X11R6/include
|
|
||||||
LIBDIRS = -L/usr/X11R6/lib
|
|
||||||
DEFINES += -DHAVE_OSS
|
|
||||||
else
|
|
||||||
LDFLAGS = -lX11 -lm -lXt -lXmu -lnsl -ldl
|
|
||||||
DEFINES += -DBIG_ENDIAN
|
|
||||||
LIBDIRS =
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(HAVE_MPEG_PLAY),1)
|
|
||||||
SOUNDSRC = mpegplay.c oss_sound.c
|
|
||||||
LDFLAGS += $(SOUND_LDFLAGS)
|
|
||||||
CFLAGS += $(SOUND_CFLAGS) -DHAVE_MPEG_PLAY
|
|
||||||
else
|
|
||||||
SOUNDSRC =
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ISPLAYER), PLAYER)
|
|
||||||
LCDSRSC = lcd-playersim.c lcd-player.c lcd-player-charset.c font-player.c
|
|
||||||
else
|
|
||||||
ifeq ($(ISIRIVER),IRIVER)
|
|
||||||
LCDSRSC = lcd-h100.c sysfont.c font.c
|
|
||||||
else
|
|
||||||
LCDSRSC = lcd-recorder.c sysfont.c font.c
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
COMMONSRCS = io.c stubs.c lcd-common.c sim_icons.c fmradio.c
|
|
||||||
|
|
||||||
FIRMSRCS = $(LCDSRSC) id3.c mp3data.c usb.c mpeg.c mp3_playback.c \
|
|
||||||
powermgmt.c power.c sprintf.c buffer.c strtok.c random.c \
|
|
||||||
timefuncs.c panic.c debug.c strcasestr.c
|
|
||||||
|
|
||||||
APPS = main.c tree.c menu.c credits.c main_menu.c icons.c language.c \
|
|
||||||
playlist.c wps.c wps-display.c settings.c status.c \
|
|
||||||
screens.c sleeptimer.c keyboard.c onplay.c\
|
|
||||||
misc.c plugin.c playlist_viewer.c bookmark.c filetypes.c \
|
|
||||||
settings_menu.c sound_menu.c playlist_menu.c filetree.c dbtree.c
|
|
||||||
|
|
||||||
ifneq ($(ISPLAYER), PLAYER)
|
|
||||||
APPS += peakmeter.c bmp.c widgets.c radio.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
SRCS = screenhack.c uibasic.c resources.c visual.c lcd-x11.c \
|
|
||||||
button-x11.c thread.c $(APPS) $(MENUS) $(FIRMSRCS) \
|
|
||||||
$(COMMONSRCS) $(SOUNDSRC)
|
|
||||||
|
|
||||||
OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o)
|
|
||||||
|
|
||||||
ifdef ENABLEDPLUGINS
|
|
||||||
ROCKS := $(patsubst $(PLUGINDIR)/%.c,$(OBJDIR)/%.rock,$(wildcard $(PLUGINDIR)/*.c))
|
|
||||||
PLUGINLIBOBJS := $(patsubst $(PLUGINDIR)/lib/%.c,$(OBJDIR)/%.o,$(wildcard $(PLUGINDIR)/lib/*.c))
|
|
||||||
endif
|
|
||||||
|
|
||||||
all: $(TOOLSDIR)/convbdf $(EXEFILE) $(ROCKS)
|
|
||||||
|
|
||||||
$(ROCKS): $(OBJDIR)/libplugin.a
|
|
||||||
|
|
||||||
$(TOOLSDIR)/convbdf:
|
|
||||||
$(MAKE) -C $(TOOLSDIR)
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(OBJS) *~ core $(EXEFILE) $(CLIENTS) $(OBJDIR)/lang.[cho] \
|
@echo "cleaning sim"
|
||||||
$(OBJDIR)/build.lang $(OBJDIR)/*.o $(OBJDIR)/sysfont.c \
|
@$(RM) $(OBJS) *~ core $(OUTFILE) $(DEPFILE)
|
||||||
$(ROCKS) $(OBJDIR)/credits.raw
|
@$(MAKE) -C $(SIMCOMMON) clean
|
||||||
$(RM) -r $(DEPS)
|
|
||||||
$(RM) -f $(OBJDIR)/libplugin.a $(OBJDIR)/rockbox.zip
|
|
||||||
|
|
||||||
################## Specific dependencies ##################
|
$(OUTFILE): $(OBJS)
|
||||||
$(OBJDIR)/credits.raw: $(DOCSDIR)/CREDITS
|
@echo "AR $@"
|
||||||
perl $(APPSDIR)/credits.pl < $< > $@
|
@$(AR) ruv $@ $(OBJS) >/dev/null 2>&1
|
||||||
|
|
||||||
$(OBJDIR)/uisw32-res.o: uisw32.rc
|
|
||||||
$(WINDRES) -i $< -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/credits.o: $(APPSDIR)/credits.c $(APPSDIR)/credits.h $(OBJDIR)/credits.raw
|
|
||||||
|
|
||||||
$(OBJDIR)/thread.o: ./thread.c
|
|
||||||
$(OBJDIR)/plugin.o: $(APPSDIR)/plugin.c
|
|
||||||
$(OBJDIR)/build.lang: $(APPSDIR)/lang/$(LANGUAGE).lang
|
|
||||||
@echo "UPLANG"
|
|
||||||
@perl $(TOOLSDIR)/uplang $(APPSDIR)/lang/english.lang $< > $@
|
|
||||||
|
|
||||||
$(OBJDIR)/lang.o: $(OBJDIR)/build.lang
|
|
||||||
@echo GENLANG
|
|
||||||
@perl -s $(TOOLSDIR)/genlang -p=$(OBJDIR)/lang $<
|
|
||||||
@echo "CC lang.c"
|
|
||||||
$(CC) $(CFLAGS) -c $(OBJDIR)/lang.c -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/sysfont.o: $(FIRMDIR)/fonts/clR6x8.bdf
|
|
||||||
@echo CC $<
|
|
||||||
@$(TOOLSDIR)/convbdf -c -o $(OBJDIR)/sysfont.c $<
|
|
||||||
@$(CC) $(APPCFLAGS) -c $(OBJDIR)/sysfont.c -o $@
|
|
||||||
|
|
||||||
################## Plugins ##################
|
|
||||||
$(OBJDIR)/libplugin.a: $(PLUGINLIBOBJS)
|
|
||||||
@echo AR $<
|
|
||||||
@$(AR) ru $@ $+
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o: $(PLUGINDIR)/lib/%.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(CFLAGS) -DPLUGIN -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/%.rock: $(APPSDIR)/plugins/%.c $(APPSDIR)/plugin.h
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(APPCFLAGS) -DPLUGIN -shared $< -L$(OBJDIR) -lplugin -o $@
|
|
||||||
ifeq ($(UNAME),CYGWIN)
|
|
||||||
# 'x' must be kept or you'll have "Win32 error 5"
|
|
||||||
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
|
|
||||||
# #define ERROR_ACCESS_DENIED 5L
|
|
||||||
else
|
|
||||||
@chmod -x $@
|
|
||||||
endif
|
|
||||||
|
|
||||||
################## Patterns for building objects ##################
|
|
||||||
$(OBJDIR)/%.o: ../x11/%.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(CFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o: $(SIMCOMMON)/%.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(APPCFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o: $(MACHINEDIR)/%.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(APPCFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o: $(DRIVERS)/%.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(APPCFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o: $(FIRMDIR)/%.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(APPCFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o: $(COMMON)/%.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(APPCFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o: $(APPSDIR)/%.c
|
|
||||||
@echo CC $<
|
|
||||||
@$(CC) $(APPCFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
|
|
||||||
################## Auto-dependencies ##################
|
|
||||||
DEPS:=$(OBJDIR)/.deps
|
|
||||||
|
|
||||||
$(DEPS)/%.d: %.c
|
|
||||||
@$(SHELL) -c 'if [ ! -d $(DEPS) ]; then \
|
|
||||||
echo Creating the dependency directory: $(DEPS); \
|
|
||||||
mkdir -p $(DEPS); fi'
|
|
||||||
@$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \
|
|
||||||
|sed '\''s|\($*\)\.o[ :]*|$(OBJDIR)/\1.o $(<:%.c=%.d) : |g'\'' > $@; \
|
|
||||||
[ -s $@ ] || rm -f $@'
|
|
||||||
|
|
||||||
-include $(SRCS:%.c=$(DEPS)/%.d)
|
|
||||||
|
|
||||||
# these ones are simulator-specific
|
|
||||||
|
|
||||||
$(OBJDIR)/%.o: %.c
|
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
ifeq ($(UNAME),CYGWIN)
|
|
||||||
$(EXEFILE): $(OBJS)
|
|
||||||
@echo LD $@
|
|
||||||
@$(CC) -g -o $(EXEFILE) $(OBJS) $(LIBDIRS) $(LDFLAGS) $(LIBS)
|
|
||||||
else
|
|
||||||
$(EXEFILE): $(OBJS)
|
|
||||||
@echo LD $@
|
|
||||||
@$(CC) -g -o $(EXEFILE) $(LIBDIRS) $(LDFLAGS) $(OBJS) $(LIBS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
tags:
|
|
||||||
@$(SHELL) -c 'for d in $(SRCDIRS); do { etags -o $(OBJDIR)/TAGS -a $$d/*.[ch]; }; done'
|
|
||||||
|
|
||||||
|
-include $(DEPFILE)
|
||||||
|
|
10
uisimulator/x11/SOURCES
Normal file
10
uisimulator/x11/SOURCES
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
button-x11.c
|
||||||
|
lcd-x11.c
|
||||||
|
#if 0 /* if sound is enabled */
|
||||||
|
oss_sound.c
|
||||||
|
#endif
|
||||||
|
resources.c
|
||||||
|
screenhack.c
|
||||||
|
thread.c
|
||||||
|
uibasic.c
|
||||||
|
visual.c
|
Loading…
Add table
Add a link
Reference in a new issue