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/Cygwin-posix.cfg | 9 --------- make/custom/FreeBSD-posix.cfg | 9 --------- make/custom/HPUX9-posix.cfg | 9 --------- make/custom/Linux-posix.cfg | 11 +---------- make/custom/Solaris-posix.cfg | 10 ---------- make/custom/av5282.cfg | 22 ++++----------------- make/custom/bare.cfg | 8 ++++---- make/custom/c3xsim.cfg | 13 ------------ make/custom/c4xsim.cfg | 13 ------------ make/custom/csb336.cfg | 10 ---------- make/custom/csb337.cfg | 11 ----------- make/custom/csb350.cfg | 14 ------------- make/custom/csb360.cfg | 12 ----------- make/custom/default.cfg | 38 ++++++++++++++++++++++++++++++++++- make/custom/eZKit533.cfg | 13 ------------ make/custom/edb7312.cfg | 9 --------- make/custom/ep1a.cfg | 9 --------- make/custom/erc32.cfg | 11 ----------- make/custom/gba.cfg | 26 ++++-------------------- make/custom/gen5200.cfg | 13 +----------- make/custom/gen68302.cfg | 11 ----------- make/custom/gen68340.cfg | 12 ----------- make/custom/gen68360.cfg | 12 ----------- make/custom/gen68360_040.cfg | 1 - make/custom/gen83xx.cfg | 21 +------------------- make/custom/genmongoosev.cfg | 14 ------------- make/custom/gensh1.cfg | 14 ------------- make/custom/gensh2.cfg | 13 ------------ make/custom/gensh4.cfg | 13 ------------ make/custom/gp32.cfg | 19 +++--------------- make/custom/h8sim.cfg | 14 ------------- make/custom/hurricane.cfg | 15 +++----------- make/custom/i386ex.cfg | 19 ++++-------------- make/custom/idp.cfg | 17 +++++----------- make/custom/jmr3904.cfg | 14 ------------- make/custom/leon2.cfg | 11 ----------- make/custom/leon3.cfg | 12 ----------- make/custom/mbx8xx.cfg | 19 +++++++----------- make/custom/mcf5206elite.cfg | 12 ----------- make/custom/mcf5235.cfg | 30 +++------------------------- make/custom/mcp750.cfg | 19 ++++++++---------- make/custom/mpc8260ads.cfg | 12 ----------- make/custom/mrm332.cfg | 46 ++++++------------------------------------- make/custom/mtx603e.cfg | 17 ++++++++-------- make/custom/mvme136.cfg | 16 +++++---------- make/custom/mvme147.cfg | 17 +++++----------- make/custom/mvme162.cfg | 17 +++------------- make/custom/mvme162lx.cfg | 17 +++------------- make/custom/mvme167.cfg | 20 ++++--------------- make/custom/mvme2100.cfg | 32 ++++++++---------------------- make/custom/mvme2307.cfg | 18 +++++++---------- make/custom/mvme3100.cfg | 19 ++++-------------- make/custom/mvme5500.cfg | 10 +++------- make/custom/nios2_iss.cfg | 20 ++++--------------- make/custom/ods68302.cfg | 13 ------------ make/custom/pc386.cfg | 44 +++++------------------------------------ make/custom/posix.cfg | 2 +- make/custom/psim.cfg | 9 --------- make/custom/rbtx4925.cfg | 15 +++----------- make/custom/rbtx4938.cfg | 13 +++--------- make/custom/rtl22xx.cfg | 9 --------- make/custom/score603e.cfg | 13 ++++-------- make/custom/shsim.cfg | 14 ------------- make/custom/sim68000.cfg | 13 +++--------- make/custom/simcpu32.cfg | 14 +++---------- make/custom/simsh4.cfg | 14 ------------- make/custom/simsh7032.cfg | 2 -- make/custom/simsh7045.cfg | 2 -- make/custom/sis.cfg | 1 - make/custom/ss555.cfg | 13 ++++-------- make/custom/ts_386ex.cfg | 12 +++-------- make/custom/uC5282.cfg | 19 +++--------------- make/custom/virtex.cfg | 32 +++--------------------------- 73 files changed, 180 insertions(+), 917 deletions(-) (limited to 'make/custom') diff --git a/make/custom/Cygwin-posix.cfg b/make/custom/Cygwin-posix.cfg index b8754295d7..54fd199fc6 100644 --- a/make/custom/Cygwin-posix.cfg +++ b/make/custom/Cygwin-posix.cfg @@ -16,12 +16,3 @@ include $(RTEMS_ROOT)/make/custom/default.cfg # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# ***************************************************************** -# Miscellaneous additions go here diff --git a/make/custom/FreeBSD-posix.cfg b/make/custom/FreeBSD-posix.cfg index 431d17f788..5caf201133 100644 --- a/make/custom/FreeBSD-posix.cfg +++ b/make/custom/FreeBSD-posix.cfg @@ -13,12 +13,3 @@ include $(RTEMS_ROOT)/make/custom/default.cfg # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# ***************************************************************** -# Miscellaneous additions go here diff --git a/make/custom/HPUX9-posix.cfg b/make/custom/HPUX9-posix.cfg index e632783b88..327b612c4a 100644 --- a/make/custom/HPUX9-posix.cfg +++ b/make/custom/HPUX9-posix.cfg @@ -17,12 +17,3 @@ include $(RTEMS_ROOT)/make/custom/default.cfg # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here - diff --git a/make/custom/Linux-posix.cfg b/make/custom/Linux-posix.cfg index 7a95d5df5d..d29e44cd73 100644 --- a/make/custom/Linux-posix.cfg +++ b/make/custom/Linux-posix.cfg @@ -19,13 +19,4 @@ include $(RTEMS_ROOT)/make/custom/default.cfg CPU_CFLAGS = -D_BSD_SOURCE -D_POSIX_C_SOURCE # optimize flag: typically -O2 -CFLAGS_OPTIMIZE_V = -O2 -g - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# ***************************************************************** -# Miscellaneous additions go here +CFLAGS_OPTIMIZE_V = -O0 -g diff --git a/make/custom/Solaris-posix.cfg b/make/custom/Solaris-posix.cfg index 418248270c..6248b382d0 100644 --- a/make/custom/Solaris-posix.cfg +++ b/make/custom/Solaris-posix.cfg @@ -20,13 +20,3 @@ CPU_CFLAGS += -Dsolaris2 -D__EXTENSIONS__ # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# ***************************************************************** - -# Miscellaneous additions go here diff --git a/make/custom/av5282.cfg b/make/custom/av5282.cfg index 3a1196e98a..8b72b402c2 100644 --- a/make/custom/av5282.cfg +++ b/make/custom/av5282.cfg @@ -22,22 +22,8 @@ ifndef MTARGET MTARGET=ram endif - -# The following are definitions of make-exe which will work using ld as -# is currently required. - - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).nxe \ - $(LINK_OBJS) $(LINK_LIBS) -Wl,-Tlinkcmds - $(OBJCOPY) -O binary --strip-all $(basename $@).nxe $@ - $(SIZE) $(basename $@).nxe +define bsp-post-link + $(default-bsp-post-link) + $(OBJCOPY) -O binary --strip-all \ + $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) endef -define make-cxx-exe - $(LINK.cc) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).nxe \ - $(LINK_OBJS) $(LINK_LIBS) -Wl,-Tlinkcmds - $(OBJCOPY) -O binary --strip-all $(basename $@).nxe $@ - $(SIZE) $(basename $@).nxe -endef - -# Miscellaneous additions go here diff --git a/make/custom/bare.cfg b/make/custom/bare.cfg index 1c3c641018..18757b985e 100644 --- a/make/custom/bare.cfg +++ b/make/custom/bare.cfg @@ -28,14 +28,14 @@ START_BASE= define make-exe @echo "*** Cannot do a link with the bare bsp. ***" - @echo "#!/bin/sh" > $(basename $@).exe - @echo "echo \"Cannot do a link with the bare bsp.\"" >> $(basename $@).exe + @echo "#!/bin/sh" > $(basename $@)$(EXEEXT) + @echo "echo \"Cannot do a link with the bare bsp.\"" >> $(basename $@)$(EXEEXT) endef define make-cxx-exe @echo "*** Cannot do a link with the bare bsp. ***" - @echo "#!/bin/sh" > $(basename $@).exe - @echo "echo \"Cannot do a link with the bare bsp.\"" >> $(basename $@).exe + @echo "#!/bin/sh" > $(basename $@)$(EXEEXT) + @echo "echo \"Cannot do a link with the bare bsp.\"" >> $(basename $@)$(EXEEXT) endef # Miscellaneous additions go here diff --git a/make/custom/c3xsim.cfg b/make/custom/c3xsim.cfg index d9c39e9779..6a8fd86e20 100644 --- a/make/custom/c3xsim.cfg +++ b/make/custom/c3xsim.cfg @@ -22,16 +22,3 @@ CFLAGS_OPTIMIZE_V = -O1 -g # this target has no start file START_BASE= - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - $(LDLIBS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here diff --git a/make/custom/c4xsim.cfg b/make/custom/c4xsim.cfg index 70582cbfd5..907be7b1ae 100644 --- a/make/custom/c4xsim.cfg +++ b/make/custom/c4xsim.cfg @@ -22,16 +22,3 @@ CFLAGS_OPTIMIZE_V = -O1 -g # this target has no start file START_BASE= - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - $(LDLIBS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here diff --git a/make/custom/csb336.cfg b/make/custom/csb336.cfg index 0a05da3ab9..951c0cfd71 100644 --- a/make/custom/csb336.cfg +++ b/make/custom/csb336.cfg @@ -14,17 +14,7 @@ RTEMS_BSP_FAMILY=csb336 # This contains the compiler options necessary to select the CPU model # and (hopefully) optimize for it. -# CPU_CFLAGS = -mcpu=arm920 -mstructure-size-boundary=8 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@).exe > $(basename $@).num - $(SIZE) $(basename $@).exe -endef - -# Miscellaneous additions go here diff --git a/make/custom/csb337.cfg b/make/custom/csb337.cfg index 128a4aee24..2f16f0e679 100644 --- a/make/custom/csb337.cfg +++ b/make/custom/csb337.cfg @@ -14,18 +14,7 @@ RTEMS_BSP_FAMILY=csb337 # This contains the compiler options necessary to select the CPU model # and (hopefully) optimize for it. -# CPU_CFLAGS = -mcpu=arm920 -mstructure-size-boundary=8 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@).exe > $(basename $@).num - $(SIZE) $(basename $@).exe -endef - -# Miscellaneous additions go here diff --git a/make/custom/csb350.cfg b/make/custom/csb350.cfg index 87772c7ff0..b8d2e2be4d 100644 --- a/make/custom/csb350.cfg +++ b/make/custom/csb350.cfg @@ -20,17 +20,3 @@ CPU_CFLAGS = -mips32 -G0 -msoft-float # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - $(LDLIBS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here - diff --git a/make/custom/csb360.cfg b/make/custom/csb360.cfg index f0895bd641..d4a9f66b01 100644 --- a/make/custom/csb360.cfg +++ b/make/custom/csb360.cfg @@ -20,15 +20,3 @@ CPU_CFLAGS = -m5200 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here diff --git a/make/custom/default.cfg b/make/custom/default.cfg index d2e177498e..52f9dff002 100644 --- a/make/custom/default.cfg +++ b/make/custom/default.cfg @@ -3,7 +3,7 @@ # Some of these values are redefined in the target specific .cfg files. # # Created by Jiri Gaisler, 16-03-97 (who is owed a debt of gratitude -# for converting RTEMS to autoconf. Thanks. --joel) +# for the initial RTEMS autoconf support. Thanks. --joel) # # $Id$ # @@ -20,3 +20,39 @@ CONFIG.CC = $(RTEMS_ROOT)/make/compilers/gcc-target-default.cfg # Base name of start file START_BASE=start +## what to do about $(EXEEXT) --> $(EXEEXT) +## -o $(basename $@)$(EXEEXT) OR +## -o $(basename $@)$(EXEEXT) OR + +EXEEXT=.exe +DOWNEXT=.ralf + +define bsp-link-c + $(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \ + -o $(basename $@)$(EXEEXT) $(LINK_OBJS) $(LINK_LIBS) +endef + +define bsp-link-cxx + $(LINK.cc) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \ + -o $(basename $@)$(EXEEXT) $(LINK_OBJS) $(LINK_LIBS) +endef + +define default-bsp-post-link + $(NM) -g -n $@ > $(basename $@).num + $(SIZE) $@ +endef + +define bsp-post-link + $(default-bsp-post-link) + cp $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) +endef + +define make-exe + $(bsp-link-c) + $(bsp-post-link) +endef + +define make-cxx-exe + $(bsp-link-cxx) + $(bsp-post-link) +endef diff --git a/make/custom/eZKit533.cfg b/make/custom/eZKit533.cfg index dd37d42544..e443be0934 100644 --- a/make/custom/eZKit533.cfg +++ b/make/custom/eZKit533.cfg @@ -20,16 +20,3 @@ CPU_CFLAGS = # optimize flag: typically -O2 # gcc-4.2.0 segfaults on -OX > -O0 CFLAGS_OPTIMIZE_V = -O0 -g - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - $(LDLIBS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here diff --git a/make/custom/edb7312.cfg b/make/custom/edb7312.cfg index 388b2bfc1b..3c13747c22 100644 --- a/make/custom/edb7312.cfg +++ b/make/custom/edb7312.cfg @@ -19,12 +19,3 @@ CPU_CFLAGS = -mcpu=$(RTEMS_CPU_MODEL) -mstructure-size-boundary=8 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@).exe > $(basename $@).num - $(SIZE) $(basename $@).exe -endef - -# Miscellaneous additions go here diff --git a/make/custom/ep1a.cfg b/make/custom/ep1a.cfg index cf171e740c..0dd8b01b91 100644 --- a/make/custom/ep1a.cfg +++ b/make/custom/ep1a.cfg @@ -18,12 +18,3 @@ CPU_CFLAGS = -mcpu=603e -Dmpc603e -Dppc603e -mmultiple -mstring -mstrict-align # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).exe \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here diff --git a/make/custom/erc32.cfg b/make/custom/erc32.cfg index e4e1778851..22719cad1f 100644 --- a/make/custom/erc32.cfg +++ b/make/custom/erc32.cfg @@ -19,14 +19,3 @@ CPU_CFLAGS = -mcpu=cypress # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).exe \ - $(LINK_OBJS) $(LINK_LIBS) -Wl,-Map,$(basename $@).map - $(NM) -g -n $(basename $@).exe > $(basename $@).num - $(SIZE) $(basename $@).exe -endef -# Miscellaneous additions go here diff --git a/make/custom/gba.cfg b/make/custom/gba.cfg index 618f98651f..3e4a5b3573 100644 --- a/make/custom/gba.cfg +++ b/make/custom/gba.cfg @@ -21,28 +21,10 @@ CPU_CFLAGS = -mcpu=$(RTEMS_CPU_MODEL) -msoft-float -mstructure-size-boundary=8 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -Wl,-Map,$(basename $@).map -o $(basename $@).nxe \ - $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O binary $(basename $@).nxe $@ +# Some GBA simulators want a .gba extension. +define bsp-post-link $(OBJCOPY) -O binary --remove-section=.comment \ --remove-section=.note --strip-unneeded \ - $(basename $@).nxe $(basename $@).gba - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@).nxe + $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) + $(default-bsp-post-link) endef - -define make-cxx-exe - $(LINK.cc) $(AM_CFLAGS) $(AM_CXXFLAGS) $(AM_LDFLAGS) \ - -Wl,-Map,$(basename $@).map -o $(basename $@).nxe \ - $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O binary $(basename $@).nxe $@ - $(OBJCOPY) -O binary --remove-section=.comment \ - --remove-section=.note --strip-unneeded \ - $(basename $@).nxe $(basename $@).gba - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@).nxe -endef - -# Miscellaneous additions go here diff --git a/make/custom/gen5200.cfg b/make/custom/gen5200.cfg index 8a43b4bc80..81188ade04 100644 --- a/make/custom/gen5200.cfg +++ b/make/custom/gen5200.cfg @@ -20,15 +20,4 @@ CPU_CFLAGS = -mcpu=603e -mstrict-align -D$(RTEMS_BOARD_MODEL) # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -qnolinkcmds -T $(RTEMS_LINKCMDS) -o $(basename $@).exe \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@).exe > $(basename $@).num - $(SIZE) $(basename $@).exe -endef - -# Miscellaneous additions go here +AM_LDFLAGS += -qnolinkcmds -T $(RTEMS_LINKCMDS) diff --git a/make/custom/gen68302.cfg b/make/custom/gen68302.cfg index 37afee91a4..10c0c9cab5 100644 --- a/make/custom/gen68302.cfg +++ b/make/custom/gen68302.cfg @@ -19,14 +19,3 @@ CPU_CFLAGS = -m68302 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef -# Miscellaneous additions go here diff --git a/make/custom/gen68340.cfg b/make/custom/gen68340.cfg index 60a9c22730..cb5efad93f 100644 --- a/make/custom/gen68340.cfg +++ b/make/custom/gen68340.cfg @@ -19,15 +19,3 @@ CPU_CFLAGS = -mcpu32 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $@ $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here diff --git a/make/custom/gen68360.cfg b/make/custom/gen68360.cfg index b637a506cb..4276105d10 100644 --- a/make/custom/gen68360.cfg +++ b/make/custom/gen68360.cfg @@ -27,15 +27,3 @@ endif # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here diff --git a/make/custom/gen68360_040.cfg b/make/custom/gen68360_040.cfg index 66c120c803..e39c6d7350 100644 --- a/make/custom/gen68360_040.cfg +++ b/make/custom/gen68360_040.cfg @@ -12,4 +12,3 @@ RTEMS_GEN68360_COMPANION_MODE=yes include $(RTEMS_ROOT)/make/custom/gen68360.cfg - diff --git a/make/custom/gen83xx.cfg b/make/custom/gen83xx.cfg index 5b8dc6c264..d69e0c7899 100644 --- a/make/custom/gen83xx.cfg +++ b/make/custom/gen83xx.cfg @@ -25,23 +25,4 @@ CPU_CFLAGS = -mcpu=603e -mstrict-align -fno-strict-aliasing\ # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -qnolinkcmds -T $(RTEMS_LINKCMDS) -o $(basename $@).exe \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@).exe > $(basename $@).num - $(SIZE) $(basename $@).exe -endef - -define make-cxx-exe - $(LINK.cc) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -qnolinkcmds -T $(RTEMS_LINKCMDS) -o $(basename $@).exe \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@).exe > $(basename $@).num - $(SIZE) $(basename $@).exe -endef - -# Miscellaneous additions go here +AM_LDFLAGS+= -qnolinkcmds -T $(RTEMS_LINKCMDS) diff --git a/make/custom/genmongoosev.cfg b/make/custom/genmongoosev.cfg index 39e8a9a8bd..b89875fbe5 100644 --- a/make/custom/genmongoosev.cfg +++ b/make/custom/genmongoosev.cfg @@ -19,17 +19,3 @@ CPU_CFLAGS = -mips1 -G0 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - $(LDLIBS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here - diff --git a/make/custom/gensh1.cfg b/make/custom/gensh1.cfg index 8b371438ca..729ffec985 100644 --- a/make/custom/gensh1.cfg +++ b/make/custom/gensh1.cfg @@ -24,17 +24,3 @@ CPU_CFLAGS = -m1 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -Wl,-Map,$(basename $@).map \ - $(LDLIBS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here diff --git a/make/custom/gensh2.cfg b/make/custom/gensh2.cfg index b136b5bf55..dd1e0b8f8a 100644 --- a/make/custom/gensh2.cfg +++ b/make/custom/gensh2.cfg @@ -24,16 +24,3 @@ CPU_CFLAGS = -m2 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -Wl,-Map,$(basename $@).map \ - $(LDLIBS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here diff --git a/make/custom/gensh4.cfg b/make/custom/gensh4.cfg index c3bf5d5be8..bd1fd9c691 100644 --- a/make/custom/gensh4.cfg +++ b/make/custom/gensh4.cfg @@ -31,16 +31,3 @@ CPU_CFLAGS = -m4 -ml # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -Wl,-Map,$(basename $@).map \ - $(LDLIBS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here diff --git a/make/custom/gp32.cfg b/make/custom/gp32.cfg index 950f0fa42a..05e8ec2b93 100644 --- a/make/custom/gp32.cfg +++ b/make/custom/gp32.cfg @@ -20,20 +20,7 @@ CPU_CFLAGS = -mcpu=arm920t -mstructure-size-boundary=32 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O binary $(basename $@).exe $(basename $@).nxe - $(NM) -g -n $(basename $@).exe > $(basename $@).num - $(SIZE) $(basename $@).exe +define bsp-post-link + $(OBJCOPY) -O binary $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) + $(default-bsp-post-link) endef - -define make-cxx-exe - $(LINK.cc) $(AM_CFLAGS) $(AM_CXXFLAGS) $(AM_LDFLAGS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O binary $(basename $@).exe $(basename $@).nxe - $(NM) -g -n $(basename $@).exe > $(basename $@).num - $(SIZE) $(basename $@).exe -endef - -# Miscellaneous additions go here diff --git a/make/custom/h8sim.cfg b/make/custom/h8sim.cfg index 8f1c44172e..aef9ddc6e9 100644 --- a/make/custom/h8sim.cfg +++ b/make/custom/h8sim.cfg @@ -19,17 +19,3 @@ CPU_CFLAGS = -mh -mint32 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - $(LDLIBS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here - diff --git a/make/custom/hurricane.cfg b/make/custom/hurricane.cfg index d7540beb0a..7a244ec02e 100644 --- a/make/custom/hurricane.cfg +++ b/make/custom/hurricane.cfg @@ -18,18 +18,9 @@ CPU_CFLAGS = -mips3 -G0 -EL # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $@ -Xlinker -Map -Xlinker $(basename $@).map $(LINK_OBJS) $(LINK_LIBS) +define bsp-post-link $(OBJCOPY) -O srec $@ $(basename $@).srec1 - $(PACKHEX) < $(basename $@).srec1 > $(basename $@).srec + $(PACKHEX) < $(basename $@).srec1 > $(basename $@)$(DOWNEXT) $(RM) $(basename $@).srec1 - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ + $(default-bsp-post-link) endef - -# Miscellaneous additions go here - diff --git a/make/custom/i386ex.cfg b/make/custom/i386ex.cfg index 2457ce9447..c3f228a568 100644 --- a/make/custom/i386ex.cfg +++ b/make/custom/i386ex.cfg @@ -20,20 +20,9 @@ CPU_CFLAGS = -msoft-float # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -# Something like this should produce a map file but this does not work. - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).nxe \ - $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).srec +define bsp-post-link + $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).srec sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \ - $(PACKHEX) > $(basename $@).exe - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@).nxe + $(PACKHEX) > $(basename $@)$(DOWNEXT) + $(default-bsp-post-link) endef - -# Miscellaneous additions go here - diff --git a/make/custom/idp.cfg b/make/custom/idp.cfg index c9724c9efc..c3e8f846ae 100644 --- a/make/custom/idp.cfg +++ b/make/custom/idp.cfg @@ -20,17 +20,10 @@ CPU_CFLAGS = -msoft-float # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).nxe \ - $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).srec +define bsp-post-link + $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).srec sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \ - $(PACKHEX) > $(basename $@).exe - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@).nxe + $(PACKHEX) > $(basename $@)$(DOWNEXT) + rm -f $(basename $@).srec + $(default-bsp-post-link) endef - -# Miscellaneous additions go here diff --git a/make/custom/jmr3904.cfg b/make/custom/jmr3904.cfg index e733e794f9..42216844ba 100644 --- a/make/custom/jmr3904.cfg +++ b/make/custom/jmr3904.cfg @@ -22,17 +22,3 @@ CPU_CFLAGS = -march=r3900 -Wa,-xgot -G0 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) -G0 $(AM_LDFLAGS) \ - $(LDLIBS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here - diff --git a/make/custom/leon2.cfg b/make/custom/leon2.cfg index 6141cbd4c1..683a123478 100644 --- a/make/custom/leon2.cfg +++ b/make/custom/leon2.cfg @@ -17,14 +17,3 @@ CPU_CFLAGS = -mcpu=cypress -msoft-float # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).exe \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@).exe > $(basename $@).num - $(SIZE) $(basename $@).exe -endef -# Miscellaneous additions go here diff --git a/make/custom/leon3.cfg b/make/custom/leon3.cfg index 423640469b..eb53594592 100644 --- a/make/custom/leon3.cfg +++ b/make/custom/leon3.cfg @@ -19,15 +19,3 @@ CPU_CFLAGS = -mcpu=cypress -msoft-float # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).exe \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@).exe > $(basename $@).num - $(SIZE) $(basename $@).exe -endef -# Miscellaneous additions go here - diff --git a/make/custom/mbx8xx.cfg b/make/custom/mbx8xx.cfg index da1f585528..79b0ccc141 100644 --- a/make/custom/mbx8xx.cfg +++ b/make/custom/mbx8xx.cfg @@ -45,21 +45,16 @@ RTEMS_BSP_FAMILY=mbx8xx # CPU_CFLAGS = -mcpu=$(8XX_CPU_TYPE) -Dmpc$(8XX_CPU_TYPE) -D$(RTEMS_MBX_MODEL) - # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) $(MBX8xx_LDFLAGS) \ - -o $(basename $@)_sym.exe $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@)_sym.exe > $(basename $@).nm - cp $(basename $@)_sym.exe $(basename $@).exe - $(STRIP) $(basename $@).exe - $(SIZE) $(basename $@)_sym.exe -endef - -# Miscellaneous additions go here - # Override default start file START_BASE= +AM_LDFLAGS += $(MBX8xx_LDFLAGS) + +define bsp-post-link + cp $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) + $(STRIP) $(basename $@)$(DOWNEXT) + $(default-bsp-post-link) +endef diff --git a/make/custom/mcf5206elite.cfg b/make/custom/mcf5206elite.cfg index 7e1bf400b9..13bc1547da 100644 --- a/make/custom/mcf5206elite.cfg +++ b/make/custom/mcf5206elite.cfg @@ -20,15 +20,3 @@ CPU_CFLAGS = -m5200 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here diff --git a/make/custom/mcf5235.cfg b/make/custom/mcf5235.cfg index a19c2361d1..dde892f060 100644 --- a/make/custom/mcf5235.cfg +++ b/make/custom/mcf5235.cfg @@ -20,41 +20,17 @@ RTEMS_BSP_FAMILY=mcf5235 # and (hopefully) optimize for it. CPU_CFLAGS = -m528x - # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer - ifndef MTARGET MTARGET=ram endif -# The following are definitions of make-exe which will work using ld as +# This defines the operations performed on the linked executable. # is currently required. - -define bsp-link-c - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $(basename $@)$(EXEEXT) $(LINK_OBJS) $(LINK_LIBS) -endef - -define bsp-link-cxx - $(LINK.cc) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $(basename $@)$(EXEEXT) $(LINK_OBJS) $(LINK_LIBS) -endef - define bsp-post-link - $(OBJCOPY) -O binary --strip-all $(basename $@)$(EXEEXT) $(basename $@).nxe + $(OBJCOPY) -O binary --strip-all \ + $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) $(SIZE) $(basename $@)$(EXEEXT) 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 diff --git a/make/custom/mcp750.cfg b/make/custom/mcp750.cfg index 624e9a89b9..ea9cdd0d5f 100644 --- a/make/custom/mcp750.cfg +++ b/make/custom/mcp750.cfg @@ -20,17 +20,14 @@ CPU_CFLAGS = -mcpu=750 -Dmpc750 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -mmultiple -mstring -mstrict-align -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $(basename $@).nxe $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@).nxe - $(OBJCOPY) -O binary -R .comment -S $(basename $@).nxe rtems +define bsp-post-link + $(default-bsp-post-link) + $(OBJCOPY) -O binary -R .comment -S $(basename $@)$(EXEEXT) rtems gzip -vf9 rtems - $(LD) -o $@ $(PROJECT_RELEASE)/lib/bootloader.o --just-symbols=$(basename $@).nxe \ - -b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \ - -Map $(basename $@).map && chmod 755 $@ + $(LD) -o $(basename $@)$(DOWNEXT) \ + $ $(PROJECT_RELEASE)/lib/bootloader.o \ + --just-symbols=$(basename $@)$(EXEEXT) \ + -b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \ + -Map $(basename $@).map && chmod 755 $@ rm -f rtems.gz endef - -# Miscellaneous additions go here diff --git a/make/custom/mpc8260ads.cfg b/make/custom/mpc8260ads.cfg index 7d6468c11d..db40670cf1 100644 --- a/make/custom/mpc8260ads.cfg +++ b/make/custom/mpc8260ads.cfg @@ -21,15 +21,3 @@ CPU_CFLAGS = -mcpu=603e -mstrict-align -Dmpc8260 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).exe \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here diff --git a/make/custom/mrm332.cfg b/make/custom/mrm332.cfg index cddf6aea5c..ef880bd4a4 100644 --- a/make/custom/mrm332.cfg +++ b/make/custom/mrm332.cfg @@ -19,33 +19,12 @@ CPU_CFLAGS = -mcpu32 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer -# The following are definitions of make-exe which will work using ld as -# is currently required. - ifeq ($(MRM_IN_ROM),yes) # Build a rommable image - move the .data section after the .text section # in the image. CPU_CFLAGS += -qnolinkcmds -T $(exec_prefix)/mrm332/lib/linkcmds_ROM endif -# This is a good way to get debug information. The output file is large -# though and greatly slows the build process so only do this if needed. -# $(OBJDUMP) -dxC $(basename $@).nxe > $(basename $@).dump -# -# chrisj: This is questionable. Why not keep unstipped ELF files -# about the use objdump and nm to get at the debug -# information rather than subject everyone to this. -# - -define bsp-link-c - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@)$(EXEEXT) \ - $(LINK_OBJS) $(LINK_LIBS) -endef -define bsp-link-cxx - $(LINK.cc) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@)$(EXEEXT) \ - $(LINK_OBJS) $(LINK_LIBS) -endef - ifeq ($(MRM_IN_ROM),yes) define bsp-post-link $(OBJCOPY) --adjust-section-vma \ @@ -60,30 +39,17 @@ define bsp-post-link ` $(basename $@).pxe $(basename $@)$(EXEEXT) $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).srec sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \ - $(PACKHEX) > $(basename $@).nxe + $(PACKHEX) > $(basename $@)$(DOWNEXT) $(NM) -g -n $(basename $@).pxe > $(basename $@).pnum - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@)$(EXEEXT) + rm -f $(basename $@).srec $(basename $@).srec + $(default-bsp-post-link) endef else define bsp-post-link $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).srec -# m68k-rtems-objdump -dxC $(basename $@).nxe > $(basename $@).dump sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \ - $(PACKHEX) > $(basename $@).nxe - $(NM) -g -n $(basename $@)$(EXEEXT) > $(basename $@).num - $(SIZE) $(basename $@)$(EXEEXT) + $(PACKHEX) > $(basename $@)$(DOWNEXT) + rm -f $(basename $@).srec + $(default-bsp-post-link) endef endif - -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 diff --git a/make/custom/mtx603e.cfg b/make/custom/mtx603e.cfg index d2455acee9..d1dfd1e7a3 100644 --- a/make/custom/mtx603e.cfg +++ b/make/custom/mtx603e.cfg @@ -19,16 +19,15 @@ CPU_CFLAGS = -mcpu=603e -Dmpc603e -Dppc603e # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -mmultiple -mstring -mstrict-align -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $(basename $@).nxe $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@).nxe - $(OBJCOPY) -O binary -R .comment -S $(basename $@).nxe rtems +define bsp-post-link + $(default-bsp-post-link) + $(OBJCOPY) -O binary -R .comment -S $(basename $@)$(EXEEXT) rtems gzip -vf9 rtems - $(LD) -o $@ $(PROJECT_RELEASE)/lib/bootloader.o --just-symbols=$(basename $@).nxe \ - -b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \ - -Map $(basename $@).map && chmod 755 $@ + $(LD) -o $(basename $@)$(DOWNEXT) \ + $(PROJECT_RELEASE)/lib/bootloader.o \ + --just-symbols=$(basename $@)$(EXEEXT) \ + -b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \ + -Map $(basename $@).map && chmod 755 $@ rm -f rtems.gz endef diff --git a/make/custom/mvme136.cfg b/make/custom/mvme136.cfg index 0f230c879b..c5c99c1c96 100644 --- a/make/custom/mvme136.cfg +++ b/make/custom/mvme136.cfg @@ -21,17 +21,11 @@ CPU_CFLAGS = # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -Os -g -fomit-frame-pointer -DNDEBUG -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).nxe \ - $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).srec +define bsp-post-link + $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).srec sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \ - $(PACKHEX) > $(basename $@).exe - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@).nxe + $(PACKHEX) > $(basename $@)$(DOWNEXT) + rm -f $(basename $@).srec + $(default-bsp-post-link) endef -# Miscellaneous additions go here diff --git a/make/custom/mvme147.cfg b/make/custom/mvme147.cfg index 108bf0875d..c76ae12841 100644 --- a/make/custom/mvme147.cfg +++ b/make/custom/mvme147.cfg @@ -19,17 +19,10 @@ CPU_CFLAGS = # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).nxe \ - $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).srec +define bsp-post-link + $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).srec sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \ - $(PACKHEX) > $(basename $@).exe - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@).nxe + $(PACKHEX) > $(basename $@)$(DOWNEXT) + rm -f $(basename $@).srec + $(default-bsp-post-link) endef -# Miscellaneous additions go here - diff --git a/make/custom/mvme162.cfg b/make/custom/mvme162.cfg index aa66e4a421..ccd5be7a0f 100644 --- a/make/custom/mvme162.cfg +++ b/make/custom/mvme162.cfg @@ -23,21 +23,10 @@ CPU_CFLAGS = -m68040 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $(basename $@).nxe $(LINK_OBJS) $(LINK_LIBS) - #$(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).srec - #sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \ - # $(PACKHEX) > $(basename $@).exe - $(OBJCOPY) -O binary $(basename $@).nxe $(basename $@).exe - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@).nxe +define bsp-post-link + $(default-bsp-post-link) + $(OBJCOPY) -O binary $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) endef -# Miscellaneous additions go here - # BSP-specific tools SLOAD=$(PROJECT_TOOLS)/sload diff --git a/make/custom/mvme162lx.cfg b/make/custom/mvme162lx.cfg index a1ff28da74..0615a11262 100644 --- a/make/custom/mvme162lx.cfg +++ b/make/custom/mvme162lx.cfg @@ -29,21 +29,10 @@ CPU_CFLAGS = -m68040 -msoft-float # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $(basename $@).nxe $(LINK_OBJS) $(LINK_LIBS) - #$(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).srec - #sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \ - # $(PACKHEX) > $(basename $@).exe - $(OBJCOPY) -O binary $(basename $@).nxe $(basename $@).exe - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@).nxe +define bsp-post-link + $(default-bsp-post-link) + $(OBJCOPY) -O binary $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) endef -# Miscellaneous additions go here - # BSP-specific tools SLOAD=$(PROJECT_TOOLS)/sload diff --git a/make/custom/mvme167.cfg b/make/custom/mvme167.cfg index 0fb5253d9a..35e567354f 100644 --- a/make/custom/mvme167.cfg +++ b/make/custom/mvme167.cfg @@ -27,16 +27,9 @@ CPU_CFLAGS = -m68040 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fno-omit-frame-pointer -# Here is the rule to actually build a $(ARCH)/foo.exe -# It also builds $(ARCH)/foo.nm -# Usage ref: src/tests/sptest/sp1/Makefile -# # We use TFTP to transfer files to the MVME167. We generate binary files # rather than S-records. We skip the header during downloads. -# The following are definitions of make-exe which will work using ld as -# is currently required. - # The MC68040 does not implement all MC68881/MC68882 instructions, so use # either the gcc floating-point software support (msoft-float libraries), or # use the Motorola FPSP floating-point emulator in @@ -47,13 +40,8 @@ CFLAGS_OPTIMIZE_V = -O2 -g -fno-omit-frame-pointer # in rtems/c/src/lib/libbsp/m68k/mvme167/startup/bststart.c in bsp_start(). # Floating-point support will then be limited. See the mvme167 README file # for more details. -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@)_sym.exe \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@)_sym.exe > $(basename $@).nm - cp $(basename $@)_sym.exe $(basename $@).exe - $(STRIP) $(basename $@).exe - $(SIZE) $(basename $@)_sym.exe +define bsp-post-link + $(default-bsp-post-link) + cp $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) + $(STRIP) $(basename $@)$(DOWNEXT) endef - -# Miscellaneous additions go here diff --git a/make/custom/mvme2100.cfg b/make/custom/mvme2100.cfg index 8e45b01a83..d4ee157f7d 100644 --- a/make/custom/mvme2100.cfg +++ b/make/custom/mvme2100.cfg @@ -19,30 +19,14 @@ CPU_CFLAGS = -mcpu=603e -Dmpc603e -Dppc603e # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -mmultiple -mstring -mstrict-align -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $(basename $@).nxe $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@).nxe - $(OBJCOPY) -O binary -R .comment -S $(basename $@).nxe rtems +define bsp-post-link + $(default-bsp-post-link) + $(OBJCOPY) -O binary -R .comment -S $(basename $@)$(EXEEXT) rtems gzip -vf9 rtems - $(LD) -o $@ $(PROJECT_RELEASE)/lib/bootloader.o --just-symbols=$(basename $@).nxe \ - -b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \ - -Map $(basename $@).map && chmod 755 $@ + $(LD) -o $(basename $@)$(DOWNEXT) \ + $(PROJECT_RELEASE)/lib/bootloader.o \ + --just-symbols=$(basename $@)$(EXEEXT) \ + -b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \ + -Map $(basename $@).map && chmod 755 $@ rm -f rtems.gz endef - -define make-cxx-exe - $(LINK.cc) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $(basename $@).nxe $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@).nxe - $(OBJCOPY) -O binary -R .comment -S $(basename $@).nxe rtems - gzip -vf9 rtems - $(LD) -o $@ $(PROJECT_RELEASE)/lib/bootloader.o --just-symbols=$(basename $@).nxe \ - -b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \ - -Map $(basename $@).map && chmod 755 $@ - rm -f rtems.gz -endef - -# Miscellaneous additions go here diff --git a/make/custom/mvme2307.cfg b/make/custom/mvme2307.cfg index 646426bb18..609a69bce8 100644 --- a/make/custom/mvme2307.cfg +++ b/make/custom/mvme2307.cfg @@ -20,20 +20,16 @@ CPU_CFLAGS = -mcpu=604 -mmultiple -mstring -mstrict-align -meabi # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $(basename $@).nxe $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@).nxe - $(OBJCOPY) -O binary -R .comment -S $(basename $@).nxe rtems +define bsp-post-link + $(default-bsp-post-link) + $(OBJCOPY) -O binary -R .comment -S $(basename $@)$(EXEEXT) rtems gzip -vf9 rtems - $(LD) -o $@ $(PROJECT_RELEASE)/lib/bootloader.o --just-symbols=$(basename $@).nxe \ - -b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \ - -Map $(basename $@).map && chmod 755 $@ + $(LD) -o $(basename $@)$(DOWNEXT) $(PROJECT_RELEASE)/lib/bootloader.o \ + --just-symbols=$(basename $@)$(EXEEXT) \ + -b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \ + -Map $(basename $@).map && chmod 755 $@ rm -f rtems.gz endef -# Miscellaneous additions go here - # No start file START_BASE= diff --git a/make/custom/mvme3100.cfg b/make/custom/mvme3100.cfg index 8e32fc1750..7c6adbbdde 100644 --- a/make/custom/mvme3100.cfg +++ b/make/custom/mvme3100.cfg @@ -28,21 +28,10 @@ CFLAGS_OPTIMIZE_V = -O4 # BSP using inlined code CFLAGS_DEBUG_V = -O1 -g -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(@:%.exe=%.nxe) $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(@:%.exe=%.nxe) > $(basename $(@:%.exe=%.nxe)).num - $(SIZE) $(@:%.exe=%.nxe) -# test -d ${PROJECT_RELEASE}/bin || mkdir ${PROJECT_RELEASE}/bin - $(OBJCOPY) -Obinary $(@:%.exe=%.nxe) $(@:%.exe=%)$(LIB_VARIANT).exe -endef - -define make-cxx-exe - $(LINK.cc) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(@:%.exe=%.nxe) $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(@:%.exe=%.nxe) > $(basename $(@:%.exe=%.nxe)).num - $(SIZE) $(@:%.exe=%.nxe) -# test -d ${PROJECT_RELEASE}/bin || mkdir ${PROJECT_RELEASE}/bin - $(OBJCOPY) -Obinary $(@:%.exe=%.nxe) $(@:%.exe=%)$(LIB_VARIANT).exe -endef +define bsp-post-link + $(default-bsp-post-link) + $(OBJCOPY) -O binary $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) +endif # Miscellaneous additions go here START_BASE = motld_start diff --git a/make/custom/mvme5500.cfg b/make/custom/mvme5500.cfg index a4978d0872..60ac6972ed 100644 --- a/make/custom/mvme5500.cfg +++ b/make/custom/mvme5500.cfg @@ -22,14 +22,10 @@ CPU_CFLAGS = -fno-strict-aliasing -mcpu=7450 -Dmpc7455 -mno-altivec -mabi=altive # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ - $(OBJCOPY) -Obinary $@ $(@:%.exe=%)$(LIB_VARIANT).bin +define bsp-post-link + $(default-bsp-post-link) + $(OBJCOPY) -O binary $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) endef -# Miscellaneous additions go here - # No start file START_BASE=mvme5500start diff --git a/make/custom/nios2_iss.cfg b/make/custom/nios2_iss.cfg index 11eef1f6b8..2e38d22e22 100644 --- a/make/custom/nios2_iss.cfg +++ b/make/custom/nios2_iss.cfg @@ -23,20 +23,8 @@ CPU_CFLAGS = -mno-hw-mul -mno-hw-div # ATM, doesn't work with optimization levels > 0 CFLAGS_OPTIMIZE_V = -O0 -g -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).nxe \ - $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O binary --strip-all $(basename $@).nxe -R entry -R exceptions $@ - $(SIZE) $(basename $@).nxe -endef -define make-cxx-exe - $(LINK.cc) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).nxe \ - $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O binary --strip-all $(basename $@).nxe -R entry -R exceptions $@ - $(SIZE) $(basename $@).nxe +define bsp-post-link + $(OBJCOPY) -O binary --strip-all $(basename $@)$(EXEEXT) \ + -R entry -R exceptions $(basename $@)$(DOWNEXT) + $(default-bsp-post-link) endef - -# Miscellaneous additions go here diff --git a/make/custom/ods68302.cfg b/make/custom/ods68302.cfg index 6d74b3e394..a15edbdc00 100644 --- a/make/custom/ods68302.cfg +++ b/make/custom/ods68302.cfg @@ -27,19 +27,6 @@ CPU_CFLAGS = -m68302 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here - ifeq ($(RTEMS_DEBUGGER),yes) LINKCMDS=$(PROJECT_RELEASE)/lib/debugrom else 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 diff --git a/make/custom/posix.cfg b/make/custom/posix.cfg index cf1cebd09f..c6acccf9a4 100644 --- a/make/custom/posix.cfg +++ b/make/custom/posix.cfg @@ -17,7 +17,7 @@ LINKCMDS= START_FILE= START_BASE= -# 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 # diff --git a/make/custom/psim.cfg b/make/custom/psim.cfg index 76ef5e4beb..177097c676 100644 --- a/make/custom/psim.cfg +++ b/make/custom/psim.cfg @@ -20,12 +20,3 @@ CPU_CFLAGS = -mcpu=603e -Dppc603e # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).exe \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here diff --git a/make/custom/rbtx4925.cfg b/make/custom/rbtx4925.cfg index 07194fd016..1d9539ca9b 100644 --- a/make/custom/rbtx4925.cfg +++ b/make/custom/rbtx4925.cfg @@ -18,18 +18,9 @@ CPU_CFLAGS = -mips3 -G0 -EL # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $@ -Xlinker -Map -Xlinker $(basename $@).map $(LINK_OBJS) $(LINK_LIBS) +define bsp-post-link $(OBJCOPY) -O srec $@ $(basename $@).srec1 - $(PACKHEX) < $(basename $@).srec1 > $(basename $@).srec + $(PACKHEX) < $(basename $@).srec1 > $(basename $@)$(DOWNEXT) $(RM) $(basename $@).srec1 - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ + $(default-bsp-post-link) endef - -# Miscellaneous additions go here - diff --git a/make/custom/rbtx4938.cfg b/make/custom/rbtx4938.cfg index 6c9f51d02a..81f4886552 100644 --- a/make/custom/rbtx4938.cfg +++ b/make/custom/rbtx4938.cfg @@ -18,14 +18,7 @@ CPU_CFLAGS = -mips3 -G0 -EL # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $@ -Xlinker -Map -Xlinker $(basename $@).map $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) --srec-len=30 -O srec $@ $(basename $@).srec +define bsp-post-link + $(OBJCOPY) --srec-len=30 -O srec $@ $(basename $@)$(DOWNEXT) + $(default-bsp-post-link) endef - -# Miscellaneous additions go here - diff --git a/make/custom/rtl22xx.cfg b/make/custom/rtl22xx.cfg index 87007e4437..c8778463cb 100644 --- a/make/custom/rtl22xx.cfg +++ b/make/custom/rtl22xx.cfg @@ -22,12 +22,3 @@ CPU_CFLAGS = -mcpu=arm7tdmi -mstructure-size-boundary=8 -mapcs-frame # NOTE2: some level of -O may be actually required by inline assembler (at least # -O2 so far. CFLAGS_OPTIMIZE_V = -Os -g -DNDEBUG - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) -Wl,-Map,$(basename $@).map - $(NM) -g -n $(basename $@).exe > $(basename $@).num - $(SIZE) $(basename $@).exe -endef - -# Miscellaneous additions go here diff --git a/make/custom/score603e.cfg b/make/custom/score603e.cfg index b4f9e6611b..76079e3e24 100644 --- a/make/custom/score603e.cfg +++ b/make/custom/score603e.cfg @@ -25,15 +25,10 @@ CPU_CFLAGS = -mcpu=603e -Dmpc603e -Dppc603e -mmultiple -mstring -mstrict-align # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $(basename $@).nxe $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@).nxe - $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).s1 +define bsp-post-link + $(default-bsp-post-link) + $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).s1 sed -e 's/.$$//' $(basename $@).s1 | \ - $(PACKHEX) >$(basename $@).exe + $(PACKHEX) >$(basename $@)$(DOWNEXT) rm -f $(basename $@).s1 endef - -# Miscellaneous additions go here diff --git a/make/custom/shsim.cfg b/make/custom/shsim.cfg index c07ffa1fd1..175840b594 100644 --- a/make/custom/shsim.cfg +++ b/make/custom/shsim.cfg @@ -19,17 +19,3 @@ CPU_CFLAGS = -m1 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - $(LDLIBS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here - diff --git a/make/custom/sim68000.cfg b/make/custom/sim68000.cfg index 9717159e8c..a7b807172f 100644 --- a/make/custom/sim68000.cfg +++ b/make/custom/sim68000.cfg @@ -19,14 +19,7 @@ RTEMS_BSP_FAMILY=sim68000 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $(basename $@).nxe $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).exe - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@).nxe +define bsp-post-link + $(default-bsp-post-link) + $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) endef -# Miscellaneous additions go here diff --git a/make/custom/simcpu32.cfg b/make/custom/simcpu32.cfg index e9bd77d0c1..7f9a16fa91 100644 --- a/make/custom/simcpu32.cfg +++ b/make/custom/simcpu32.cfg @@ -19,15 +19,7 @@ RTEMS_BSP_FAMILY=sim68000 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \ - -o $(basename $@).nxe $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).exe - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ +define bsp-post-link + $(default-bsp-post-link) + $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) endef - -# Miscellaneous additions go here diff --git a/make/custom/simsh4.cfg b/make/custom/simsh4.cfg index a24b9606e3..a01f81906f 100644 --- a/make/custom/simsh4.cfg +++ b/make/custom/simsh4.cfg @@ -28,19 +28,5 @@ RTEMS_BSP_FAMILY=simsh4 # It works with SH4_FPSCR_PR bit set CPU_CFLAGS = -m4 -ml - # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -Wl,-Map,$(basename $@).map \ - $(LDLIBS) -o $@ \ - $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# Miscellaneous additions go here diff --git a/make/custom/simsh7032.cfg b/make/custom/simsh7032.cfg index 2d9a33a044..059ec03fe2 100644 --- a/make/custom/simsh7032.cfg +++ b/make/custom/simsh7032.cfg @@ -21,5 +21,3 @@ CPU_CFLAGS = -m1 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -# Miscellaneous additions go here diff --git a/make/custom/simsh7045.cfg b/make/custom/simsh7045.cfg index aa246a98e0..464b38b44b 100644 --- a/make/custom/simsh7045.cfg +++ b/make/custom/simsh7045.cfg @@ -21,5 +21,3 @@ CPU_CFLAGS = -m2 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g - -# Miscellaneous additions go here diff --git a/make/custom/sis.cfg b/make/custom/sis.cfg index 1c33252e81..d9fd24b23d 100644 --- a/make/custom/sis.cfg +++ b/make/custom/sis.cfg @@ -5,4 +5,3 @@ # include $(RTEMS_ROOT)/make/custom/erc32.cfg - diff --git a/make/custom/ss555.cfg b/make/custom/ss555.cfg index 53f32bd42d..02b686816c 100644 --- a/make/custom/ss555.cfg +++ b/make/custom/ss555.cfg @@ -27,17 +27,12 @@ CPU_CFLAGS = -mcpu=$(GCC_CPU_MODEL) -D$(RTEMS_CPU_MODEL) -D$(RTEMS_BSP_FAMILY) # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) $(SS555_LDFLAGS) \ - -o $(basename $@)_sym.exe $(LINK_OBJS) $(LINK_LIBS) - $(NM) -g -n $(basename $@)_sym.exe > $(basename $@).nm - cp $(basename $@)_sym.exe $(basename $@).exe - $(STRIP) $(basename $@).exe - $(SIZE) $(basename $@)_sym.exe +define bsp-post-link + $(default-bsp-post-link) + cp $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) + $(STRIP) $(basename $@)$(DOWNEXT) endef -# Miscellaneous additions go here - # Override default start file START_BASE= diff --git a/make/custom/ts_386ex.cfg b/make/custom/ts_386ex.cfg index 95f8659f9a..38baf09ee0 100644 --- a/make/custom/ts_386ex.cfg +++ b/make/custom/ts_386ex.cfg @@ -21,13 +21,7 @@ CPU_CFLAGS =-msoft-float -mno-fp-ret-in-387 # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).nxe \ - $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O binary $(basename $@).nxe $(basename $@).exe - $(NM) -g -n $(basename $@).nxe > $(basename $@).num - $(SIZE) $(basename $@).nxe +define bsp-post-link + $(default-bsp-post-link) + $(OBJCOPY) -O binary $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) endef - -# Miscellaneous additions go here - diff --git a/make/custom/uC5282.cfg b/make/custom/uC5282.cfg index f49818716f..31c7b2314f 100644 --- a/make/custom/uC5282.cfg +++ b/make/custom/uC5282.cfg @@ -17,20 +17,7 @@ CPU_CFLAGS = -m528x # optimize flag: typically -O2 CFLAGS_OPTIMIZE_V = -O2 -g -# The following are definitions of make-exe which will work using ld as -# is currently required. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).nxe \ - $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O binary --strip-all $(basename $@).nxe $@ - $(SIZE) $(basename $@).nxe -endef -define make-cxx-exe - $(LINK.cc) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).nxe \ - $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O binary --strip-all $(basename $@).nxe $@ - $(SIZE) $(basename $@).nxe +define bsp-post-link + $(default-bsp-post-link) + $(OBJCOPY) -O binary $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) endef - -# Miscellaneous additions go here diff --git a/make/custom/virtex.cfg b/make/custom/virtex.cfg index df245bed53..effa19bdf1 100644 --- a/make/custom/virtex.cfg +++ b/make/custom/virtex.cfg @@ -3,13 +3,6 @@ # # $Id$ # -# this is derived from: -# -# Config file for a PowerPC 403 based helas403 card -# -# Id: helas403.cfg,v 1.8 2000/07/13 15:05:38 joel Exp -# -# include $(RTEMS_ROOT)/make/custom/default.cfg @@ -29,29 +22,10 @@ CPU_CFLAGS = -mcpu=403 -Dppc405 -Dvirtex # NOTE: some level of -O may be actually required by inline assembler CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions - # No start file START_BASE= -# The following are definitions of make-exe which will work using ld as -# is currently required. It is expected that as of gcc 2.8, the end user -# will be able to override parts of the compilers specs and link using gcc. - -define make-exe - $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).exe $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ -endef - -# $(OBJCOPY) -O srec --srec-len 120 $(basename $@).exe $(basename $@).srec -define make-cxx-exe - $(LINK.cc) $(AM_CFLAGS) $(AM_CXXFLAGS) $(AM_LDFLAGS) \ - -o $(basename $@).exe $(LINK_OBJS) $(LINK_LIBS) - $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec - $(NM) -g -n $@ > $(basename $@).num - $(SIZE) $@ +define bsp-post-link + $(default-bsp-post-link) + $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT) endef - -# Miscellaneous additions go here - -- cgit v1.2.3