5d236b2bfd
It's now easier to force rebuild of files depending on the svn revision version.c/version.h are generated once with new tools/genversion.sh Changes in the VCS are still not auto detected, so you'll have to remove builddir/version.* if you want to change the string in your binaries APPSVERSION is now called RBVERSION and is defined in the generated header instead of being defined by the Makefiles appsversion is now called rbversion (the plugin api number didn't change since old modules are still binary compatible) Change some bootloaders to use knwon-at-buildtime RBVERSION instead of "%s" + rbversion You'll need to run make clean to regenerate dependencies after the removal of apps/version.h To build binaries with a different version string, hand-edit tools/version.sh or tools/genversion.sh (which calls the former) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26320 a1c6a512-1295-4272-9138-f99709370657
101 lines
2.7 KiB
Makefile
101 lines
2.7 KiB
Makefile
# __________ __ ___.
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
# \/ \/ \/ \/ \/
|
|
# $Id$
|
|
#
|
|
|
|
ifeq ($(MODELNAME),ifp7xx)
|
|
|
|
INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(OBJDIR) \
|
|
-I$(BUILDDIR)
|
|
|
|
DEPFILE = $(OBJDIR)/dep-stub
|
|
LDS := linker.cfg
|
|
|
|
SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - )
|
|
DIRS = .
|
|
|
|
ifdef APPEXTRA
|
|
DIRS += $(subst :, ,$(APPEXTRA))
|
|
INCLUDES += $(patsubst %,-I%,$(subst :, ,$(APPEXTRA)))
|
|
endif
|
|
|
|
ifndef VERSION
|
|
VERSION=$(shell date +%y%m%d-%H%M)
|
|
endif
|
|
|
|
CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(DEFINES) \
|
|
$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
|
|
|
|
OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
|
|
SOURCES = $(SRC)
|
|
LINKFILE = $(OBJDIR)/linkage.lds
|
|
|
|
LIBROCKBOX = $(BUILDDIR)/librockbox.a
|
|
|
|
all: $(BUILDDIR)/$(BINARY) $(FLASHFILE)
|
|
|
|
dep: $(DEPFILE)
|
|
|
|
$(LINKFILE): $(LDS)
|
|
$(call PRINTS,Build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@
|
|
|
|
$(OBJDIR)/stub.elf : $(OBJS) $(LINKFILE) $(DEPFILE) $(LIBROCKBOX)
|
|
$(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -L$(BUILDDIR)/firmware -lrockbox -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/stub.map
|
|
|
|
$(OBJDIR)/stub.bin : $(OBJDIR)/stub.elf
|
|
$(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
|
|
|
|
$(BUILDDIR)/$(BINARY) : $(OBJDIR)/stub.bin
|
|
$(call PRINTS,Build stub file)$(MKFIRMWARE) $< $@
|
|
|
|
include $(TOOLSDIR)/make.inc
|
|
|
|
clean:
|
|
$(call PRINTS,cleaning stub)-rm -f $(OBJS) $(BUILDDIR)/$(BINARY) \
|
|
$(OBJDIR)/stub.bin $(OBJDIR)/stub.elf $(OBJDIR)/*.map \
|
|
$(LINKFILE) $(DEPFILE)
|
|
|
|
-include $(DEPFILE)
|
|
|
|
else # not ifp7xx
|
|
|
|
ifdef RECORDER
|
|
EXTRA = -DRECORDER
|
|
EXT = ajz
|
|
else
|
|
EXT = mod
|
|
endif
|
|
|
|
TARGET = stub
|
|
OBJS = start.o sh-stub.o setjmp.o
|
|
LIBS = -lgcc
|
|
|
|
.s.o:
|
|
sh-elf-as -o $@ $<
|
|
|
|
.c.o:
|
|
sh-elf-gcc -O $(EXTRA) -I../firmware/export -I../firmware/include -m1 -Wall -Wstrict-prototypes -c -o $@ $<
|
|
|
|
.S.o:
|
|
sh-elf-gcc -O -I../firmware/export -I../firmware/include -m1 -Wall -Wstrict-prototypes -c -o $@ $<
|
|
|
|
$(TARGET).$(EXT): $(TARGET).elf
|
|
sh-elf-objcopy -O binary $(TARGET).elf $(TARGET).out
|
|
../tools/scramble $(TARGET).out $(TARGET).$(EXT)
|
|
../tools/sh2d $(TARGET).out -o 09000000 > $(TARGET).asm
|
|
|
|
$(TARGET).elf: $(OBJS)
|
|
sh-elf-gcc -nostartfiles $(OBJS) -nostdlib -Wl,-Map,$(TARGET).map -o $(TARGET).elf -Tlinker.cfg
|
|
|
|
clean:
|
|
rm $(OBJS) $(TARGET).map $(TARGET).elf $(TARGET).out $(TARGET).mod $(TARGET).ajz
|
|
|
|
start.o: start.s
|
|
sh-stub.o: sh-stub.c
|
|
setjmp.o: setjmp.S
|
|
|
|
endif
|