2002-04-15 08:35:08 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
# $Id$
|
|
|
|
#
|
2003-05-17 00:31:50 +00:00
|
|
|
|
2021-04-23 15:31:58 +00:00
|
|
|
ifeq ($(MODELNAME),EXAMPLE)
|
2006-01-25 01:43:07 +00:00
|
|
|
|
|
|
|
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) \
|
2010-05-27 09:41:46 +00:00
|
|
|
$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
|
2006-01-25 01:43:07 +00:00
|
|
|
|
|
|
|
OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
|
|
|
|
SOURCES = $(SRC)
|
|
|
|
LINKFILE = $(OBJDIR)/linkage.lds
|
|
|
|
|
|
|
|
LIBROCKBOX = $(BUILDDIR)/librockbox.a
|
|
|
|
|
|
|
|
all: $(BUILDDIR)/$(BINARY) $(FLASHFILE)
|
|
|
|
|
|
|
|
dep: $(DEPFILE)
|
|
|
|
|
|
|
|
$(LINKFILE): $(LDS)
|
2006-10-30 01:40:20 +00:00
|
|
|
$(call PRINTS,Build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@
|
2006-01-25 01:43:07 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/stub.elf : $(OBJS) $(LINKFILE) $(DEPFILE) $(LIBROCKBOX)
|
2006-10-30 01:40:20 +00:00
|
|
|
$(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -L$(BUILDDIR)/firmware -lrockbox -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/stub.map
|
2006-01-25 01:43:07 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/stub.bin : $(OBJDIR)/stub.elf
|
2006-10-30 01:40:20 +00:00
|
|
|
$(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
|
2006-01-25 01:43:07 +00:00
|
|
|
|
|
|
|
$(BUILDDIR)/$(BINARY) : $(OBJDIR)/stub.bin
|
2006-10-30 01:40:20 +00:00
|
|
|
$(call PRINTS,Build stub file)$(MKFIRMWARE) $< $@
|
2006-01-25 01:43:07 +00:00
|
|
|
|
|
|
|
include $(TOOLSDIR)/make.inc
|
|
|
|
|
|
|
|
clean:
|
2006-10-30 01:40:20 +00:00
|
|
|
$(call PRINTS,cleaning stub)-rm -f $(OBJS) $(BUILDDIR)/$(BINARY) \
|
2006-01-25 01:43:07 +00:00
|
|
|
$(OBJDIR)/stub.bin $(OBJDIR)/stub.elf $(OBJDIR)/*.map \
|
|
|
|
$(LINKFILE) $(DEPFILE)
|
|
|
|
|
|
|
|
-include $(DEPFILE)
|
|
|
|
|
|
|
|
endif
|