diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/Makefile | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile index c19843d979..7d8f0c378a 100644 --- a/apps/plugins/Makefile +++ b/apps/plugins/Makefile | |||
@@ -1,3 +1,6 @@ | |||
1 | ? Makefile.tmpl | ||
2 | ? lib/Makefile.tmpl | ||
3 | ? lib/dep-pluginlib | ||
1 | # __________ __ ___. | 4 | # __________ __ ___. |
2 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | 5 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
3 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | 6 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
@@ -24,9 +27,8 @@ LDS := plugin.lds | |||
24 | LINKFILE := $(OBJDIR)/pluginlink.lds | 27 | LINKFILE := $(OBJDIR)/pluginlink.lds |
25 | DEPFILE = $(OBJDIR)/dep-plugins | 28 | DEPFILE = $(OBJDIR)/dep-plugins |
26 | 29 | ||
27 | # This sets up 'SRC' based on the files mentioned in SOURCES | 30 | SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \ |
28 | include $(TOOLSDIR)/makesrc.inc | 31 | $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) |
29 | |||
30 | ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock) | 32 | ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock) |
31 | SOURCES = $(SRC) | 33 | SOURCES = $(SRC) |
32 | ELFS := $(SRC:%.c=$(OBJDIR)/%.elf) | 34 | ELFS := $(SRC:%.c=$(OBJDIR)/%.elf) |
@@ -35,8 +37,6 @@ OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | |||
35 | DEFS := $(SRC:%.c=$(OBJDIR)/%.def) | 37 | DEFS := $(SRC:%.c=$(OBJDIR)/%.def) |
36 | DIRS = . | 38 | DIRS = . |
37 | 39 | ||
38 | ELFDEP = $(OBJDIR)/dep-elf | ||
39 | |||
40 | #for any recorder and iRiver model | 40 | #for any recorder and iRiver model |
41 | ifneq (,$(strip $(foreach tgt,RECORDER IRIVER,$(findstring $(tgt),$(TARGET))))) | 41 | ifneq (,$(strip $(foreach tgt,RECORDER IRIVER,$(findstring $(tgt),$(TARGET))))) |
42 | SUBDIRS += rockboy | 42 | SUBDIRS += rockboy |
@@ -46,14 +46,9 @@ endif | |||
46 | all: $(OBJDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE) | 46 | all: $(OBJDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE) |
47 | 47 | ||
48 | ifndef SIMVER | 48 | ifndef SIMVER |
49 | 49 | $(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a | |
50 | ELFIT=@echo "LD $@"; \ | 50 | @echo "LD $@" |
51 | $(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) | ||
57 | 52 | ||
58 | $(OBJDIR)/%.rock : $(OBJDIR)/%.elf | 53 | $(OBJDIR)/%.rock : $(OBJDIR)/%.elf |
59 | @echo "OBJCOPY $<" | 54 | @echo "OBJCOPY $<" |
@@ -117,7 +112,7 @@ $(SUBDIRS): | |||
117 | clean: | 112 | clean: |
118 | @echo "cleaning plugins" | 113 | @echo "cleaning plugins" |
119 | @rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \ | 114 | @rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \ |
120 | $(OBJS) $(DEFS) $(ELFDEP) | 115 | $(OBJS) $(DEFS) |
121 | @$(MAKE) -C lib clean | 116 | @$(MAKE) -C lib clean |
122 | @$(MAKE) -C rockboy clean | 117 | @$(MAKE) -C rockboy clean |
123 | 118 | ||