summaryrefslogtreecommitdiff
path: root/apps/plugins/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/Makefile')
-rw-r--r--apps/plugins/Makefile20
1 files changed, 14 insertions, 6 deletions
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile
index fdabc8cf22..c19843d979 100644
--- a/apps/plugins/Makefile
+++ b/apps/plugins/Makefile
@@ -24,8 +24,9 @@ LDS := plugin.lds
24LINKFILE := $(OBJDIR)/pluginlink.lds 24LINKFILE := $(OBJDIR)/pluginlink.lds
25DEPFILE = $(OBJDIR)/dep-plugins 25DEPFILE = $(OBJDIR)/dep-plugins
26 26
27SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \ 27# This sets up 'SRC' based on the files mentioned in SOURCES
28 $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) 28include $(TOOLSDIR)/makesrc.inc
29
29ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock) 30ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock)
30SOURCES = $(SRC) 31SOURCES = $(SRC)
31ELFS := $(SRC:%.c=$(OBJDIR)/%.elf) 32ELFS := $(SRC:%.c=$(OBJDIR)/%.elf)
@@ -34,6 +35,8 @@ OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
34DEFS := $(SRC:%.c=$(OBJDIR)/%.def) 35DEFS := $(SRC:%.c=$(OBJDIR)/%.def)
35DIRS = . 36DIRS = .
36 37
38ELFDEP = $(OBJDIR)/dep-elf
39
37#for any recorder and iRiver model 40#for any recorder and iRiver model
38ifneq (,$(strip $(foreach tgt,RECORDER IRIVER,$(findstring $(tgt),$(TARGET))))) 41ifneq (,$(strip $(foreach tgt,RECORDER IRIVER,$(findstring $(tgt),$(TARGET)))))
39 SUBDIRS += rockboy 42 SUBDIRS += rockboy
@@ -43,9 +46,14 @@ endif
43all: $(OBJDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE) 46all: $(OBJDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE)
44 47
45ifndef SIMVER 48ifndef SIMVER
46$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a 49
47 @echo "LD $@" 50ELFIT=@echo "LD $@"; \
48 @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(OBJDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map 51 $(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(OBJDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map
52
53$(ELFDEP): $(SOURCES)
54 perl elfdep.pl > $(ELFDEP)
55
56-include $(ELFDEP)
49 57
50$(OBJDIR)/%.rock : $(OBJDIR)/%.elf 58$(OBJDIR)/%.rock : $(OBJDIR)/%.elf
51 @echo "OBJCOPY $<" 59 @echo "OBJCOPY $<"
@@ -109,7 +117,7 @@ $(SUBDIRS):
109clean: 117clean:
110 @echo "cleaning plugins" 118 @echo "cleaning plugins"
111 @rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \ 119 @rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \
112 $(OBJS) $(DEFS) 120 $(OBJS) $(DEFS) $(ELFDEP)
113 @$(MAKE) -C lib clean 121 @$(MAKE) -C lib clean
114 @$(MAKE) -C rockboy clean 122 @$(MAKE) -C rockboy clean
115 123