From 6087a6925701db0d0da461fc38ec39bd73d02390 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 6 Mar 2008 21:51:01 +0000 Subject: Make all BSPs use the same rules for invoking gcc and g++ to link an application. Share as much logic as possible for .num file and size information. Let BSPs provide custom rules to tranform executable from linked .exe to downloadable RTEMS Application Loadable File (RALF) .ralf file. --- make/custom/pc386.cfg | 44 +++++--------------------------------------- 1 file changed, 5 insertions(+), 39 deletions(-) (limited to 'make/custom/pc386.cfg') diff --git a/make/custom/pc386.cfg b/make/custom/pc386.cfg index 48e9613ec3..c5836a6eea 100644 --- a/make/custom/pc386.cfg +++ b/make/custom/pc386.cfg @@ -23,7 +23,7 @@ RTEMS_BSP_FAMILY=pc386 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -# Here is the rule to actually build a $(ARCH)/foo.exe +# Here is the rule to actually build a $(ARCH)/foo$(EXEEXT) # It also builds $(ARCH)/foo.sr and $(ARCH)/foo.nm # Usage ref: src/tests/sptest/sp1/Makefile @@ -42,54 +42,20 @@ START16FILE=$(PROJECT_RELEASE)/lib/start16$(LIB_VARIANT).bin START16ADDR=0x00097C00 HEADERADDR=0x00097E00 -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define bsp-link-c - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -Wl,-Ttext,$(RELOCADDR) \ - -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 +AM_LDFLAGS+= -Wl,-Ttext,$(RELOCADDR) define bsp-post-link + $(default-bsp-post-link) $(OBJCOPY) -O elf32-i386 \ --remove-section=.rodata \ --remove-section=.comment \ --remove-section=.note \ --strip-unneeded $(basename $@)$(EXEEXT) $(basename $@).nxe $(OBJCOPY) -O binary $(basename $@).nxe $(basename $@).bin - $(PROJECT_TOOLS)/bin2boot -v $(basename $@).bt $(HEADERADDR)\ + $(PROJECT_TOOLS)/bin2boot -v $(basename $@)$(DOWNEXT) $(HEADERADDR)\ $(START16FILE) $(START16ADDR) 0 $(basename $@).bin $(RELOCADDR) 0 - $(NM) -g -n $(basename $@)$(EXEEXT) > $(basename $@).num - $(SIZE) $(basename $@)$(EXEEXT) -# test -d ${PROJECT_RELEASE}/BootImgs \ -# || mkdir ${PROJECT_RELEASE}/BootImgs -# f=`basename $@ .exe`; \ -# cp $(basename $@).bt \ -# ${PROJECT_RELEASE}/BootImgs/$${f}$(LIB_VARIANT).bt \ -# && chmod 755 \ -# ${PROJECT_RELEASE}/BootImgs/$${f}$(LIB_VARIANT).bt -# $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -Wl,-Ttext,$(RELOCADDR) \ -# -o $@ $(LINK_OBJS) $(LINK_LIBS) + rm -f $(basename $@).nxe endef -define make-exe - $(bsp-link-c) - $(bsp-post-link) -endef - -define make-cxx-exe - $(bsp-link-cxx) - $(bsp-post-link) -endef - -# Miscellaneous additions go here - # BSP-specific tools BIN2BOOT=$(PROJECT_TOOLS)/bin2boot -- cgit v1.2.3