diff options
-rw-r--r-- | apps/Makefile | 1 | ||||
-rw-r--r-- | apps/plugins/Makefile | 18 | ||||
-rw-r--r-- | apps/plugins/lib/Makefile | 2 |
3 files changed, 14 insertions, 7 deletions
diff --git a/apps/Makefile b/apps/Makefile index 319ed316bb..bd00a0a204 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -97,6 +97,7 @@ all : $(OBJDIR)/$(OUTNAME) $(OBJDIR)/rockbox.ucl rocks endif rocks: + $(MAKE) -C plugins/lib TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR) VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEM} $(MAKE) -C plugins TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR) VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEM} $(OBJDIR)/librockbox.a: diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile index fb54d8d4ac..940f74f506 100644 --- a/apps/plugins/Makefile +++ b/apps/plugins/Makefile @@ -12,8 +12,10 @@ OC = sh-elf-objcopy FIRMWARE = ../../firmware -INCLUDES = -I$(FIRMWARE)/include -I$(FIRMWARE)/export -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers -I.. -CFLAGS = -O -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEM} +INCLUDES = -I$(FIRMWARE)/include -I$(FIRMWARE)/export -I$(FIRMWARE)/common \ +-I$(FIRMWARE)/drivers -I.. -Ilib +CFLAGS = -O -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes \ +$(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEM} LDS := plugin.lds LINKFILE := $(OBJDIR)/pluginlink.lds @@ -30,8 +32,8 @@ no_configure: @echo "http://rockbox.haxx.se/docs/how_to_compile.html" endif -$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) - $(CC) -O -nostdlib -o $@ $< -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map +$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a + $(CC) -O -nostdlib -o $@ $< -L$(OBJDIR) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map $(OBJDIR)/%.rock : $(OBJDIR)/%.elf $(OC) -O binary $< $@ @@ -39,8 +41,11 @@ $(OBJDIR)/%.rock : $(OBJDIR)/%.elf $(OBJDIR)/%.o: %.c ../plugin.h Makefile $(CC) $(CFLAGS) -c $< -o $@ -all: $(ROCKS) - @echo done +all: $(OBJDIR)/libplugin.a $(ROCKS) + echo "done" + +$(OBJDIR)/libplugin.a: + $(MAKE) -C lib TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR) VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEM} # MEM should be passed on to this makefile with the chosen memory size given # in number of MB @@ -49,3 +54,4 @@ $(LINKFILE): $(LDS) clean: -rm -f $(ROCKS) $(LINKFILE) + $(MAKE) -C lib clean diff --git a/apps/plugins/lib/Makefile b/apps/plugins/lib/Makefile index 3fbd812c23..f4d3cff990 100644 --- a/apps/plugins/lib/Makefile +++ b/apps/plugins/lib/Makefile @@ -73,7 +73,7 @@ clean: $(OBJDIR)/$(DEPS)/%.d: %.c @$(SHELL) -c 'for d in $(DEPDIRS); do { if [ ! -d $(OBJDIR)/$$d ]; then mkdir $(OBJDIR)/$$d; fi; }; done' @echo "Updating dependencies for $<" - $(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \ + @$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \ |sed '\''s|\($*\)\.o[ :]*|$(OBJDIR)/\1.o $(<:%.c=%.d) : |g'\'' > $@; \ [ -s $@ ] || rm -f $@' |