2003-06-29 16:33:04 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
INCLUDES = -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/common \
|
2004-10-04 13:03:33 +00:00
|
|
|
-I$(FIRMDIR)/drivers -I$(APPSDIR) -Ilib
|
|
|
|
CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
|
|
|
|
-DMEM=${MEMORYSIZE} -DPLUGIN
|
2003-06-29 16:33:04 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
ifdef APPEXTRA
|
|
|
|
INCLUDES += -I$(APPSDIR)/$(APPEXTRA)
|
2004-09-09 06:01:46 +00:00
|
|
|
endif
|
2004-07-08 13:12:16 +00:00
|
|
|
|
2003-07-13 22:15:19 +00:00
|
|
|
LDS := plugin.lds
|
|
|
|
LINKFILE := $(OBJDIR)/pluginlink.lds
|
2004-09-22 08:58:50 +00:00
|
|
|
DEPFILE = $(OBJDIR)/dep-plugins
|
2003-06-29 16:33:04 +00:00
|
|
|
|
2004-10-04 13:03:33 +00:00
|
|
|
SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) \
|
|
|
|
$(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - )
|
2003-06-29 16:33:04 +00:00
|
|
|
ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock)
|
2004-09-22 08:58:50 +00:00
|
|
|
SOURCES = $(SRC)
|
|
|
|
ELFS := $(SRC:%.c=$(OBJDIR)/%.elf)
|
|
|
|
OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
|
|
|
|
DIRS = .
|
2003-06-29 16:33:04 +00:00
|
|
|
|
2004-09-22 21:40:45 +00:00
|
|
|
all: $(OBJDIR)/libplugin.a $(ROCKS) $(DEPFILE)
|
|
|
|
|
2004-11-04 14:23:05 +00:00
|
|
|
$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a
|
2004-09-06 07:05:12 +00:00
|
|
|
@echo "LD $@"
|
|
|
|
@$(CC) -O -nostdlib -o $@ $< -L$(OBJDIR) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/%.rock : $(OBJDIR)/%.elf
|
2004-09-06 07:05:12 +00:00
|
|
|
@echo "OBJCOPY $<"
|
|
|
|
@$(OC) -O binary $< $@
|
2003-06-29 16:33:04 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
include $(TOOLSDIR)/make.inc
|
2003-06-29 16:33:04 +00:00
|
|
|
|
2004-05-18 23:17:53 +00:00
|
|
|
$(OBJDIR)/libplugin.a:
|
2004-09-06 07:05:12 +00:00
|
|
|
@echo "MAKE in lib"
|
2004-09-22 08:58:50 +00:00
|
|
|
@$(MAKE) -C lib TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR) VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEMORYSIZE}
|
2003-06-29 16:33:04 +00:00
|
|
|
|
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)
|
2004-09-06 07:05:12 +00:00
|
|
|
@echo "build $@"
|
2004-09-22 08:58:50 +00:00
|
|
|
@$(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(DEFINES) -x c -E -P $< >$@
|
2003-07-13 22:15:19 +00:00
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
clean:
|
2004-09-06 07:05:12 +00:00
|
|
|
@echo "cleaning plugins"
|
2004-09-22 08:58:50 +00:00
|
|
|
@rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) $(OBJS)
|
2004-09-06 07:05:12 +00:00
|
|
|
@$(MAKE) -C lib clean
|
2004-09-22 21:40:45 +00:00
|
|
|
|
|
|
|
-include $(DEPFILE)
|