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/default.cfg | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'make/custom/default.cfg') 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 -- cgit v1.2.3