summaryrefslogtreecommitdiffstats
path: root/make/custom/default.cfg
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-03-06 21:51:01 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-03-06 21:51:01 +0000
commit6087a6925701db0d0da461fc38ec39bd73d02390 (patch)
tree8c6b313b671f943f5c661ea16c6b0c645c0c6473 /make/custom/default.cfg
parentSwitch back to old GCC_RPMREL versioning scheme. (diff)
downloadrtems-6087a6925701db0d0da461fc38ec39bd73d02390.tar.bz2
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.
Diffstat (limited to 'make/custom/default.cfg')
-rw-r--r--make/custom/default.cfg38
1 files changed, 37 insertions, 1 deletions
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