diff options
author | Thomas Martitz <kugel@rockbox.org> | 2012-04-04 21:43:22 +0200 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2012-04-04 21:48:19 +0200 |
commit | 4b56ee048a950eb8190abec3f8dc8b7a9b6e8946 (patch) | |
tree | 5f7275d75c32831531963c6fecf64dbcad250efa /apps/plugins | |
parent | a54072e2992ad8b6fccdaf8e8062f37c53743be8 (diff) |
Refactor and unify objcopy calls in the build system. Also now properly handles DEBUG builds on hosted targets to keep debug symbols if necessary.
Change-Id: I884031b79c6d49479e4d95752f35ced68872dd5d
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/chessbox/chessbox.make | 2 | ||||
-rw-r--r-- | apps/plugins/goban/goban.make | 2 | ||||
-rw-r--r-- | apps/plugins/imageviewer/imageviewer.make | 6 | ||||
-rw-r--r-- | apps/plugins/lua/lua.make | 2 | ||||
-rw-r--r-- | apps/plugins/pdbox/pdbox.make | 6 | ||||
-rw-r--r-- | apps/plugins/pictureflow/pictureflow.make | 2 | ||||
-rw-r--r-- | apps/plugins/plugins.make | 8 | ||||
-rw-r--r-- | apps/plugins/rockboy/rockboy.make | 2 | ||||
-rw-r--r-- | apps/plugins/zxbox/zxbox.make | 2 |
9 files changed, 9 insertions, 23 deletions
diff --git a/apps/plugins/chessbox/chessbox.make b/apps/plugins/chessbox/chessbox.make index 357130cb74..ee4940de8b 100644 --- a/apps/plugins/chessbox/chessbox.make +++ b/apps/plugins/chessbox/chessbox.make @@ -44,7 +44,7 @@ $(CHESSBOX_OBJDIR)/chessbox.ovl: $(CHESSBOX_OBJ) $(CHESSBOX_OUTLDS) $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(CHESSBOX_OVLFLAGS) - $(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@ + $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@) # special pattern rule for compiling chessbox with extra flags $(CHESSBOX_OBJDIR)/%.o: $(CHESSBOX_SRCDIR)/%.c $(CHESSBOX_SRCDIR)/chessbox.make diff --git a/apps/plugins/goban/goban.make b/apps/plugins/goban/goban.make index 2bc85ad8e1..a8b41285f0 100644 --- a/apps/plugins/goban/goban.make +++ b/apps/plugins/goban/goban.make @@ -43,4 +43,4 @@ $(GOBAN_BUILDDIR)/goban.ovl: $(GOBAN_OBJ) $(GOBAN_OUTLDS) $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(GOBAN_OVLFLAGS) - $(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@ + $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@) diff --git a/apps/plugins/imageviewer/imageviewer.make b/apps/plugins/imageviewer/imageviewer.make index 7f7d94320a..97af1e98a7 100644 --- a/apps/plugins/imageviewer/imageviewer.make +++ b/apps/plugins/imageviewer/imageviewer.make @@ -40,11 +40,7 @@ $(IMGVBUILDDIR)/%.ovl: $(IMGDEC_OUTLDS) $(filter-out $(PLUGIN_CRT0),$(filter %.o, $^)) \ $(filter %.a, $+) \ -lgcc $(IMGDEC_OVLFLAGS) -ifdef APP_TYPE - $(SILENT)cp $(IMGVBUILDDIR)/$*.elf $@ -else - $(SILENT)$(OC) -O binary $(IMGVBUILDDIR)/$*.elf $@ -endif + $(SILENT)$(call objcopy,$(IMGVBUILDDIR)/$*.elf,$@) # rule to create reference map for image decoder $(IMGVBUILDDIR)/%.refmap: $(APPSDIR)/plugin.h $(IMGVSRCDIR)/imageviewer.h $(PLUGINLINK_LDS) $(PLUGIN_LIBS) diff --git a/apps/plugins/lua/lua.make b/apps/plugins/lua/lua.make index 9e2db62e39..a70f0280b0 100644 --- a/apps/plugins/lua/lua.make +++ b/apps/plugins/lua/lua.make @@ -56,4 +56,4 @@ $(LUA_BUILDDIR)/lua.ovl: $(LUA_OBJ) $(LUA_OUTLDS) $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(LUA_OVLFLAGS) - $(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@ + $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@) diff --git a/apps/plugins/pdbox/pdbox.make b/apps/plugins/pdbox/pdbox.make index 239e1c0852..3edc97efe5 100644 --- a/apps/plugins/pdbox/pdbox.make +++ b/apps/plugins/pdbox/pdbox.make @@ -36,10 +36,6 @@ $(PDBOXBUILDDIR)/pdbox.rock: $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(PDBOXLDFLAGS) -ifdef APP_TYPE - $(SILENT)cp $*.elf $@ -else - $(SILENT)$(OC) -O binary $*.elf $@ -endif + $(SILENT)$(call objcopy,$*.elf,$@) diff --git a/apps/plugins/pictureflow/pictureflow.make b/apps/plugins/pictureflow/pictureflow.make index e3d4544e07..9c29f7abd9 100644 --- a/apps/plugins/pictureflow/pictureflow.make +++ b/apps/plugins/pictureflow/pictureflow.make @@ -50,7 +50,7 @@ $(PICTUREFLOW_OBJDIR)/pictureflow.ovl: $(PICTUREFLOW_OBJ) $(PICTUREFLOW_OUTLDS) $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(PICTUREFLOW_OVLFLAGS) - $(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@ + $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@) # special pattern rule for compiling pictureflow with extra flags $(PICTUREFLOW_OBJDIR)/%.o: $(PICTUREFLOW_SRCDIR)/%.c $(PICTUREFLOW_SRCDIR)/pictureflow.make diff --git a/apps/plugins/plugins.make b/apps/plugins/plugins.make index b80523d41b..27bc69f1ca 100644 --- a/apps/plugins/plugins.make +++ b/apps/plugins/plugins.make @@ -120,13 +120,7 @@ $(BUILDDIR)/%.rock: $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(PLUGINLDFLAGS) -ifndef APP_TYPE - $(SILENT)$(OC) -O binary $(BUILDDIR)/$*.elf $@ # objcopy native -else ifeq (,$(findstring sdl-sim,$(APP_TYPE))) - $(SILENT)$(OC) -S -x $(BUILDDIR)/$*.elf $@ # objcopy hosted -else - $(SILENT)cp $(BUILDDIR)/$*.elf $@ # no objcopy, keep debug symbols -endif + $(SILENT)$(call objcopy,$(BUILDDIR)/$*.elf,$@) $(BUILDDIR)/apps/plugins/%.lua: $(ROOTDIR)/apps/plugins/%.lua $(call PRINTS,CP $(subst $(ROOTDIR)/,,$<))cp $< $(BUILDDIR)/apps/plugins/ diff --git a/apps/plugins/rockboy/rockboy.make b/apps/plugins/rockboy/rockboy.make index 4869cedcbf..625c40eca8 100644 --- a/apps/plugins/rockboy/rockboy.make +++ b/apps/plugins/rockboy/rockboy.make @@ -37,4 +37,4 @@ $(ROCKBOY_OBJDIR)/rockboy.ovl: $(ROCKBOY_OBJ) $(ROCKBOY_OUTLDS) $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(ROCKBOY_OVLFLAGS) - $(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@ + $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@) diff --git a/apps/plugins/zxbox/zxbox.make b/apps/plugins/zxbox/zxbox.make index a04801aa31..4638d5f0a2 100644 --- a/apps/plugins/zxbox/zxbox.make +++ b/apps/plugins/zxbox/zxbox.make @@ -45,7 +45,7 @@ $(ZXBOX_OBJDIR)/zxbox.ovl: $(ZXBOX_OBJ) $(ZXBOX_OUTLDS) $(filter %.o, $^) \ $(filter %.a, $+) \ -lgcc $(ZXBOX_LDFLAGS) - $(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@ + $(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@) # special pattern rule for compiling zxbox with extra flags $(ZXBOX_OBJDIR)/%.o: $(ZXBOX_SRCDIR)/%.c $(ZXBOX_SRCDIR)/zxbox.make |