2003-06-29 16:33:04 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
|
|
|
|
CC = sh-elf-gcc
|
|
|
|
OC = sh-elf-objcopy
|
|
|
|
|
|
|
|
FIRMWARE = ../../firmware
|
|
|
|
|
|
|
|
INCLUDES = -I$(FIRMWARE)/include -I$(FIRMWARE)/export -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers -I..
|
2003-07-13 22:15:19 +00:00
|
|
|
CFLAGS = -O -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEM}
|
2003-06-29 16:33:04 +00:00
|
|
|
|
2003-07-13 22:15:19 +00:00
|
|
|
LDS := plugin.lds
|
|
|
|
LINKFILE := $(OBJDIR)/pluginlink.lds
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
|
|
SRC := $(wildcard *.c)
|
|
|
|
ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock)
|
|
|
|
|
|
|
|
ifndef OBJDIR
|
|
|
|
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
|
|
|
|
|
|
|
|
$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE)
|
2003-07-24 09:42:59 +00:00
|
|
|
$(CC) -O -nostdlib -o $@ $< -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/%.rock : $(OBJDIR)/%.elf
|
|
|
|
$(OC) -O binary $< $@
|
|
|
|
|
|
|
|
$(OBJDIR)/%.o: %.c ../plugin.h Makefile
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
all: $(ROCKS)
|
|
|
|
@echo done
|
|
|
|
|
2003-07-13 22:15:19 +00:00
|
|
|
# MEM should be passed on to this makefile with the chosen memory size given
|
|
|
|
# in number of MB
|
|
|
|
$(LINKFILE): $(LDS)
|
2003-11-28 12:06:47 +00:00
|
|
|
$(CC) -DMEMORYSIZE=$(MEM) $(DEFINES) -x c -E -P $< >$@
|
2003-07-13 22:15:19 +00:00
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
clean:
|
2003-07-20 09:29:28 +00:00
|
|
|
-rm -f $(ROCKS) $(LINKFILE)
|