summaryrefslogtreecommitdiffstats
path: root/make/custom/pc386.cfg
diff options
context:
space:
mode:
Diffstat (limited to 'make/custom/pc386.cfg')
-rw-r--r--make/custom/pc386.cfg36
1 files changed, 20 insertions, 16 deletions
diff --git a/make/custom/pc386.cfg b/make/custom/pc386.cfg
index 72079833a9..4b9a4bd01d 100644
--- a/make/custom/pc386.cfg
+++ b/make/custom/pc386.cfg
@@ -45,15 +45,24 @@ HEADERADDR=0x00097E00
# The following are definitions of make-exe which will work using ld as
# is currently required.
-define make-exe
+define bsp-link-c
$(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -Wl,-Ttext,$(RELOCADDR) \
- -o $(basename $@).nxe \
+ -o $(basename $@)$(EXEEXT) \
$(LINK_OBJS) $(LINK_LIBS)
+endef
+
+define bsp-link-cxx
+ $(LINK.cc) $(AM_CFLAGS) $(AM_LDFLAGS) -Wl,-Ttext,$(RELOCADDR) \
+ -o $(basename $@)$(EXEEXT) \
+ $(LINK_OBJS) $(LINK_LIBS)
+endef
+
+define bsp-post-link
$(OBJCOPY) -O elf32-i386 \
--remove-section=.rodata \
--remove-section=.comment \
--remove-section=.note \
- --strip-unneeded $(basename $@).nxe $@
+ --strip-unneeded $(basename $@)$(EXEEXT) $(basename $@).nxe
$(OBJCOPY) -O binary $(basename $@).nxe $(basename $@).bin
$(PROJECT_TOOLS)/bin2boot -v $(basename $@).bt $(HEADERADDR)\
$(START16FILE) $(START16ADDR) 0 $(basename $@).bin $(RELOCADDR) 0
@@ -69,20 +78,15 @@ define make-exe
# $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -Wl,-Ttext,$(RELOCADDR) \
# -o $@ $(LINK_OBJS) $(LINK_LIBS)
endef
+
+define make-exe
+ $(bsp-link-c)
+ $(bsp-post-link)
+endef
+
define make-cxx-exe
- $(LINK.cc) $(AM_CFLAGS) $(AM_CXXFLAGS) $(AM_LDFLAGS) \
- -Wl,-Ttext,$(RELOCADDR) -o $(basename $@).nxe \
- $(LINK_OBJS) $(LINK_LIBS)
- $(OBJCOPY) -O elf32-i386 \
- --remove-section=.rodata \
- --remove-section=.comment \
- --remove-section=.note \
- --strip-unneeded $(basename $@).nxe $@
- $(OBJCOPY) -O binary $(basename $@).nxe $(basename $@).bin
- $(PROJECT_TOOLS)/bin2boot -v $(basename $@).bt $(HEADERADDR)\
- $(START16FILE) $(START16ADDR) 0 $(basename $@).bin $(RELOCADDR) 0
- $(NM) -g -n $(basename $@).nxe > $(basename $@).num
- $(SIZE) $(basename $@).nxe
+ $(bsp-link-cxx)
+ $(bsp-post-link)
endef
# Miscellaneous additions go here