Further adjustments for the plugin library

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4634 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2004-05-18 23:17:53 +00:00
parent 7da08a6729
commit defca5b061
3 changed files with 14 additions and 7 deletions

View file

@ -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:

View file

@ -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

View file

@ -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 $@'