summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-03-06 15:40:03 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-03-06 15:40:03 +0000
commit8ebff817a29d8e3fed2602f29fc649d2a3261ebc (patch)
treeac9457a2e251cb54e8668b11a531114baed53b87 /apps/plugins
parente566eede94eb673813bcc017207504a7c48893ad (diff)
downloadrockbox-8ebff817a29d8e3fed2602f29fc649d2a3261ebc.zip
rockbox-8ebff817a29d8e3fed2602f29fc649d2a3261ebc.tar.gz
rockbox-8ebff817a29d8e3fed2602f29fc649d2a3261ebc.tar.bz2
rockbox-8ebff817a29d8e3fed2602f29fc649d2a3261ebc.tar.xz
Use the new generic SRC build "macro" in tools/makesrc.inc to process the
SOURCES file. Hopefully this now works better for Mac OS X people. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6152 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/Makefile20
-rw-r--r--apps/plugins/lib/Makefile4
2 files changed, 17 insertions, 7 deletions
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile
index fdabc8c..c19843d 100644
--- a/apps/plugins/Makefile
+++ b/apps/plugins/Makefile
@@ -24,8 +24,9 @@ LDS := plugin.lds
LINKFILE := $(OBJDIR)/pluginlink.lds
DEPFILE = $(OBJDIR)/dep-plugins
-SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
- $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - )
+# This sets up 'SRC' based on the files mentioned in SOURCES
+include $(TOOLSDIR)/makesrc.inc
+
ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock)
SOURCES = $(SRC)
ELFS := $(SRC:%.c=$(OBJDIR)/%.elf)
@@ -34,6 +35,8 @@ OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
DEFS := $(SRC:%.c=$(OBJDIR)/%.def)
DIRS = .
+ELFDEP = $(OBJDIR)/dep-elf
+
#for any recorder and iRiver model
ifneq (,$(strip $(foreach tgt,RECORDER IRIVER,$(findstring $(tgt),$(TARGET)))))
SUBDIRS += rockboy
@@ -43,9 +46,14 @@ endif
all: $(OBJDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE)
ifndef SIMVER
-$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a
- @echo "LD $@"
- @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(OBJDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map
+
+ELFIT=@echo "LD $@"; \
+ $(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(OBJDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map
+
+$(ELFDEP): $(SOURCES)
+ perl elfdep.pl > $(ELFDEP)
+
+-include $(ELFDEP)
$(OBJDIR)/%.rock : $(OBJDIR)/%.elf
@echo "OBJCOPY $<"
@@ -109,7 +117,7 @@ $(SUBDIRS):
clean:
@echo "cleaning plugins"
@rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \
- $(OBJS) $(DEFS)
+ $(OBJS) $(DEFS) $(ELFDEP)
@$(MAKE) -C lib clean
@$(MAKE) -C rockboy clean
diff --git a/apps/plugins/lib/Makefile b/apps/plugins/lib/Makefile
index b492bb5..fbd4cef 100644
--- a/apps/plugins/lib/Makefile
+++ b/apps/plugins/lib/Makefile
@@ -20,7 +20,9 @@ endif
CFLAGS = $(GCCOPTS) \
$(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} -DPLUGIN
-SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - )
+# This sets up 'SRC' based on the files mentioned in SOURCES
+include $(TOOLSDIR)/makesrc.inc
+
SOURCES = $(SRC)
OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
DEPFILE = $(OBJDIR)/dep-pluginlib