<p>Did you see how the examples-v2 (git module) uses RTEMS application makefiles?</p>
<div class="gmail_quote">On Jul 4, 2013 9:24 PM, "Nick Withers" <<a href="mailto:nick.withers@anu.edu.au">nick.withers@anu.edu.au</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hey all!<br>
<br>
I discovered make/Templates/Makefile.leaf the other day and decided it'd<br>
probably be a good idea for me to use that as a base, in place of the<br>
Makefile I'd clobbered together.<br>
<br>
There were a few things that slowed me down a bit getting things back to<br>
where I had 'em:<br>
  - My LD_PATHS settings appeared to have no effect<br>
  - I've application sources in subdirectories (not with Makefiles in<br>
them, mind you, just .c / .h) and these weren't created in the<br>
o-optimize / o-debug output directories, making GCC unhappy<br>
  - I didn't want to use the ".exe" extension but that was hardcoded<br>
<br>
...So I knocked up the diffs at the end of this email.<br>
<br>
Any feedback / concerns / things I've missed? Would it be possible to<br>
merge these (or similar) or a subset in for 4.11? Would you like<br>
individual patches for each "issue" addressed?<br>
<br>
Thanks!<br>
<br>
<br>
P.S.: "ARCH" struck me as a a bit of an unusual variable to use to mean<br>
"object directory" (maybe OBJDIR would be more clear...?). I'd have<br>
thought "ARCH" would refer to the processor architecture, or perhaps the<br>
RTEMS target architecture (maybe it's 'coz the architecture used to be<br>
part of the directory structure?). Happy to submit patches to do so, if<br>
that's the will of the council.<br>
__<br>
<br>
<br>
Righto, the patch for LD_PATHS [1] (all of these were generated with<br>
"git diff" in the rtems.git root):<br>
____<br>
<br>
diff --git a/c/src/make/compilers/gcc-target-default.cfg<br>
b/c/src/make/compilers/gcc-target-default.cfg<br>
index 813bd5c..a70681d 100644<br>
--- a/c/src/make/compilers/gcc-target-default.cfg<br>
+++ b/c/src/make/compilers/gcc-target-default.cfg<br>
@@ -65,13 +65,12 @@ CXXFLAGS += $(CXXFLAGS_OPTIMIZE) $(CXXFLAGS_DEBUG)<br>
 endif<br>
<br>
 # List of library paths without -L<br>
-LD_PATHS= $(PROJECT_RELEASE)/lib<br>
+LD_PATHS+= $(PROJECT_RELEASE)/lib<br>
<br>
 # ld flag for incomplete link<br>
 LDFLAGS_INCOMPLETE = -r<br>
<br>
-# LDFLAGS=$(LDFLAGS_DEBUG) $(LD_PATHS:%=-L%)<br>
-LDFLAGS += $(LDFLAGS_DEBUG)<br>
+LDFLAGS+=$(LDFLAGS_DEBUG) $(LD_PATHS:%=-L%)<br>
<br>
 #<br>
 # Stuff to clean and clobber for the compiler and its tools<br>
____<br>
<br>
[1] See<br>
<a href="http://git.rtems.org/rtems/commit/c/src/make/compilers/gcc-target-default.cfg?id=ea9f76742163cccf98eb326db7459c18d2fad1b6" target="_blank">http://git.rtems.org/rtems/commit/c/src/make/compilers/gcc-target-default.cfg?id=ea9f76742163cccf98eb326db7459c18d2fad1b6</a> for why LD_PATHS had been commented ("Now implicitly handled by gcc-spec"). I've got an extra library to pull in, though (RTEMS_gdb_stub), and Makefile.leaf advertises it should be used, so I think putting it back is the right thing to do...?<br>

<br>
<br>
The patch for source subdirectories:<br>
____<br>
<br>
diff --git a/make/main.cfg b/make/main.cfg<br>
index 1a712de..e9219b4 100644<br>
--- a/make/main.cfg<br>
+++ b/make/main.cfg<br>
@@ -40,8 +40,15 @@ ARCH_DEBUG_V = o-debug<br>
 ARCH__V = $(ARCH_OPTIMIZE_V)<br>
 ARCH = $(ARCH_$(VARIANT_V)_V)<br>
<br>
+ARCH_DIRS = $(filter-out ./, $(dir $(C_FILES)))<br>
+<br>
 $(ARCH):<br>
        test -d ${ARCH} || mkdir $(ARCH)<br>
+<br>
+ifneq ($(strip ARCH_DIRS),)<br>
+       mkdir -p ${ARCH_DIRS:%=${ARCH}/%}<br>
+endif<br>
+<br>
 #<br>
 # Default makefile name<br>
 # May be overridden by command line macro assignment<br>
____<br>
<br>
...and the far longer patch for EXEEXT (in which I also replaced ".ralf"<br>
with "$(DOWNEXT)" in<br>
c/src/lib/libbsp/arm/lm3s69xx/make/custom/lm3s69xx.inc):<br>
____<br>
<br>
diff --git a/c/src/lib/libbsp/arm/gba/make/custom/gba.cfg b/c/src/lib/libbsp/arm/gba/make/custom/gba.cfg<br>
index ee9be6a..1ae2fb8 100644<br>
--- a/c/src/lib/libbsp/arm/gba/make/custom/gba.cfg<br>
+++ b/c/src/lib/libbsp/arm/gba/make/custom/gba.cfg<br>
@@ -20,6 +20,6 @@ CFLAGS_OPTIMIZE_V = -O2 -g<br>
 define bsp-post-link<br>
        $(OBJCOPY) -O binary --remove-section=.comment \<br>
            --remove-section=.note --strip-unneeded \<br>
-           $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+           $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
        $(default-bsp-post-link)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/arm/gp32/make/custom/gp32.cfg b/c/src/lib/libbsp/arm/gp32/make/custom/gp32.cfg<br>
index f287310..a558362 100644<br>
--- a/c/src/lib/libbsp/arm/gp32/make/custom/gp32.cfg<br>
+++ b/c/src/lib/libbsp/arm/gp32/make/custom/gp32.cfg<br>
@@ -16,6 +16,6 @@ CPU_CFLAGS = -mstructure-size-boundary=32 -mcpu=arm920t -mfpu=vfp -mfloat-abi=so<br>
 CFLAGS_OPTIMIZE_V = -O2 -g<br>
<br>
 define bsp-post-link<br>
-       $(OBJCOPY) -O binary $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       $(OBJCOPY) -O binary $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
        $(default-bsp-post-link)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/arm/lm3s69xx/make/custom/lm3s69xx.inc b/c/src/lib/libbsp/arm/lm3s69xx/make/custom/lm3s69xx.inc<br>
index 4387c19..362d9f4 100644<br>
--- a/c/src/lib/libbsp/arm/lm3s69xx/make/custom/lm3s69xx.inc<br>
+++ b/c/src/lib/libbsp/arm/lm3s69xx/make/custom/lm3s69xx.inc<br>
@@ -12,5 +12,5 @@ CFLAGS_OPTIMIZE_V = -O2 -g<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O binary $(basename $@).exe $(basename $@).ralf<br>
+       $(OBJCOPY) -O binary $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/arm/nds/make/custom/nds.cfg b/c/src/lib/libbsp/arm/nds/make/custom/nds.cfg<br>
index 9e4844d..78172e6 100644<br>
--- a/c/src/lib/libbsp/arm/nds/make/custom/nds.cfg<br>
+++ b/c/src/lib/libbsp/arm/nds/make/custom/nds.cfg<br>
@@ -28,7 +28,7 @@ endif<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O binary $(basename $@).exe $(basename $@).bin<br>
+       $(OBJCOPY) -O binary $(basename $@)$(EXEEXT) $(basename $@).bin<br>
        $(NDSTOOL) -c $(basename $@).nds -9 $(basename $@).bin \<br>
            -7 $(COPROC_ELF_PATH)/coproc.bin<br>
        rm -f $(basename $@).bin<br>
diff --git a/c/src/lib/libbsp/arm/raspberrypi/make/custom/raspberrypi.cfg b/c/src/lib/libbsp/arm/raspberrypi/make/custom/raspberrypi.cfg<br>
index 9751658..6b47ea2 100644<br>
--- a/c/src/lib/libbsp/arm/raspberrypi/make/custom/raspberrypi.cfg<br>
+++ b/c/src/lib/libbsp/arm/raspberrypi/make/custom/raspberrypi.cfg<br>
@@ -16,7 +16,7 @@ CFLAGS_OPTIMIZE_V = -O2 -g<br>
 # is currently required.<br>
 define bsp-post-link<br>
     $(OBJCOPY) -O binary --strip-all \<br>
-        $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
-    $(SIZE) $(basename $@).exe<br>
+        $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
+    $(SIZE) $(basename $@)$(EXEEXT)<br>
 endef<br>
<br>
diff --git a/c/src/lib/libbsp/i386/pc386/make/custom/pc386.cfg b/c/src/lib/libbsp/i386/pc386/make/custom/pc386.cfg<br>
index e827d87..9f7428d 100644<br>
--- a/c/src/lib/libbsp/i386/pc386/make/custom/pc386.cfg<br>
+++ b/c/src/lib/libbsp/i386/pc386/make/custom/pc386.cfg<br>
@@ -46,7 +46,7 @@ define bsp-post-link<br>
        $(OBJCOPY) -O elf32-i386 \<br>
            --remove-section=.comment \<br>
            --remove-section=.note \<br>
-           --strip-unneeded $(basename $@).exe $(basename $@).nxe<br>
+           --strip-unneeded $(basename $@)$(EXEEXT) $(basename $@).nxe<br>
        $(OBJCOPY) -O binary $(basename $@).nxe $(basename $@).bin<br>
        $(PROJECT_TOOLS)/bin2boot -v $(basename $@)$(DOWNEXT) $(HEADERADDR)\<br>
          $(START16FILE) $(START16ADDR) 0 $(basename $@).bin $(RELOCADDR) 0<br>
diff --git a/c/src/lib/libbsp/lm32/lm32_evr/make/custom/lm32_evr.cfg b/c/src/lib/libbsp/lm32/lm32_evr/make/custom/lm32_evr.cfg<br>
index d70ff80..c1951d0 100644<br>
--- a/c/src/lib/libbsp/lm32/lm32_evr/make/custom/lm32_evr.cfg<br>
+++ b/c/src/lib/libbsp/lm32/lm32_evr/make/custom/lm32_evr.cfg<br>
@@ -21,7 +21,7 @@ CPU_CFLAGS =<br>
 CFLAGS_OPTIMIZE_V = -O0 -g<br>
<br>
 define bsp-post-link<br>
-       $(OBJCOPY) -O binary --strip-all $(basename $@).exe \<br>
+       $(OBJCOPY) -O binary --strip-all $(basename $@)$(EXEEXT) \<br>
            -R entry -R exceptions $(basename $@)$(DOWNEXT)<br>
        $(default-bsp-post-link)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/lm32/milkymist/make/custom/milkymist.cfg b/c/src/lib/libbsp/lm32/milkymist/make/custom/milkymist.cfg<br>
index 5a44658..ae691eb 100644<br>
--- a/c/src/lib/libbsp/lm32/milkymist/make/custom/milkymist.cfg<br>
+++ b/c/src/lib/libbsp/lm32/milkymist/make/custom/milkymist.cfg<br>
@@ -21,7 +21,7 @@ CPU_CFLAGS = -mbarrel-shift-enabled -mmultiply-enabled \<br>
 CFLAGS_OPTIMIZE_V = -O2 -g<br>
<br>
 define bsp-post-link<br>
-       $(OBJCOPY) -O binary --strip-all $(basename $@).exe \<br>
+       $(OBJCOPY) -O binary --strip-all $(basename $@)$(EXEEXT) \<br>
            -R entry -R exceptions $(basename $@)$(DOWNEXT)<br>
        $(default-bsp-post-link)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/m68k/av5282/make/custom/av5282.cfg b/c/src/lib/libbsp/m68k/av5282/make/custom/av5282.cfg<br>
index 0bbeaf1..a668d99 100644<br>
--- a/c/src/lib/libbsp/m68k/av5282/make/custom/av5282.cfg<br>
+++ b/c/src/lib/libbsp/m68k/av5282/make/custom/av5282.cfg<br>
@@ -22,5 +22,5 @@ endif<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
        $(OBJCOPY) -O binary --strip-all \<br>
-           $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+           $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/m68k/genmcf548x/make/custom/genmcf548x.inc b/c/src/lib/libbsp/m68k/genmcf548x/make/custom/genmcf548x.inc<br>
index 843524c..a910bd3 100644<br>
--- a/c/src/lib/libbsp/m68k/genmcf548x/make/custom/genmcf548x.inc<br>
+++ b/c/src/lib/libbsp/m68k/genmcf548x/make/custom/genmcf548x.inc<br>
@@ -15,7 +15,7 @@ CPU_CFLAGS = -mcfv4e -Wa,-memac<br>
 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer<br>
<br>
 define bsp-post-link<br>
-       $(OBJCOPY) -O binary --strip-all $(basename $@).exe \<br>
+       $(OBJCOPY) -O binary --strip-all $(basename $@)$(EXEEXT) \<br>
            $(basename $@)$(DOWNEXT)<br>
        $(default-bsp-post-link)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/m68k/idp/make/custom/idp.cfg b/c/src/lib/libbsp/m68k/idp/make/custom/idp.cfg<br>
index 937ce30..d10029a 100644<br>
--- a/c/src/lib/libbsp/m68k/idp/make/custom/idp.cfg<br>
+++ b/c/src/lib/libbsp/m68k/idp/make/custom/idp.cfg<br>
@@ -16,7 +16,7 @@ CPU_CFLAGS = -msoft-float<br>
 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer<br>
<br>
 define bsp-post-link<br>
-       $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec<br>
+       $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).srec<br>
        sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \<br>
            $(PACKHEX) > $(basename $@)$(DOWNEXT)<br>
        rm -f  $(basename $@).srec<br>
diff --git a/c/src/lib/libbsp/m68k/mcf52235/make/custom/mcf52235.cfg b/c/src/lib/libbsp/m68k/mcf52235/make/custom/mcf52235.cfg<br>
index 4dcb890..9b22a21 100644<br>
--- a/c/src/lib/libbsp/m68k/mcf52235/make/custom/mcf52235.cfg<br>
+++ b/c/src/lib/libbsp/m68k/mcf52235/make/custom/mcf52235.cfg<br>
@@ -18,6 +18,6 @@ CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer<br>
 # is currently required.<br>
 define bsp-post-link<br>
        $(OBJCOPY) -O binary --strip-all \<br>
-           $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
-       $(SIZE) $(basename $@).exe<br>
+           $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
+       $(SIZE) $(basename $@)$(EXEEXT)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/m68k/mcf5225x/make/custom/mcf5225x.cfg b/c/src/lib/libbsp/m68k/mcf5225x/make/custom/mcf5225x.cfg<br>
index 6a415a7..90e76e2 100644<br>
--- a/c/src/lib/libbsp/m68k/mcf5225x/make/custom/mcf5225x.cfg<br>
+++ b/c/src/lib/libbsp/m68k/mcf5225x/make/custom/mcf5225x.cfg<br>
@@ -22,6 +22,6 @@ CFLAGS_OPTIMIZE_V = -O2 -fomit-frame-pointer<br>
 # is currently required.<br>
 define bsp-post-link<br>
        $(OBJCOPY) -O binary --strip-all \<br>
-           $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
-       $(SIZE) $(basename $@).exe<br>
+           $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
+       $(SIZE) $(basename $@)$(EXEEXT)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/m68k/mcf5235/make/custom/mcf5235.cfg b/c/src/lib/libbsp/m68k/mcf5235/make/custom/mcf5235.cfg<br>
index 8a543ac..b5c3c49 100644<br>
--- a/c/src/lib/libbsp/m68k/mcf5235/make/custom/mcf5235.cfg<br>
+++ b/c/src/lib/libbsp/m68k/mcf5235/make/custom/mcf5235.cfg<br>
@@ -22,6 +22,6 @@ endif<br>
 # is currently required.<br>
 define bsp-post-link<br>
        $(OBJCOPY) -O binary --strip-all \<br>
-           $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
-       $(SIZE) $(basename $@).exe<br>
+           $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
+       $(SIZE) $(basename $@)$(EXEEXT)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/m68k/mcf5329/make/custom/mcf5329.cfg b/c/src/lib/libbsp/m68k/mcf5329/make/custom/mcf5329.cfg<br>
index e68fd28..e1f5734 100644<br>
--- a/c/src/lib/libbsp/m68k/mcf5329/make/custom/mcf5329.cfg<br>
+++ b/c/src/lib/libbsp/m68k/mcf5329/make/custom/mcf5329.cfg<br>
@@ -20,6 +20,6 @@ CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer<br>
 # is currently required.<br>
 define bsp-post-link<br>
        $(OBJCOPY) -O binary --strip-all \<br>
-           $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
-       $(SIZE) $(basename $@).exe<br>
+           $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
+       $(SIZE) $(basename $@)$(EXEEXT)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/m68k/mrm332/make/custom/mrm332.cfg b/c/src/lib/libbsp/m68k/mrm332/make/custom/mrm332.cfg<br>
index a1be91b..bf55e4f 100644<br>
--- a/c/src/lib/libbsp/m68k/mrm332/make/custom/mrm332.cfg<br>
+++ b/c/src/lib/libbsp/m68k/mrm332/make/custom/mrm332.cfg<br>
@@ -31,8 +31,8 @@ define bsp-post-link<br>
                return s } ;\<br>
                /\.text/ { base = $$4 ; size = $$3 };\<br>
                END { printf("0x%x", h2d(base) + h2d(size)) }'\<br>
-              ` $(basename $@).pxe $(basename $@).exe<br>
-       $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec<br>
+              ` $(basename $@).pxe $(basename $@)$(EXEEXT)<br>
+       $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).srec<br>
        sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \<br>
            $(PACKHEX) > $(basename $@)$(DOWNEXT)<br>
        $(NM) -g -n $(basename $@).pxe > $(basename $@).pnum<br>
@@ -41,7 +41,7 @@ define bsp-post-link<br>
 endef<br>
 else<br>
 define bsp-post-link<br>
-       $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec<br>
+       $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).srec<br>
        sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \<br>
            $(PACKHEX) > $(basename $@)$(DOWNEXT)<br>
        rm -f $(basename $@).srec<br>
diff --git a/c/src/lib/libbsp/m68k/mvme136/make/custom/mvme136.cfg b/c/src/lib/libbsp/m68k/mvme136/make/custom/mvme136.cfg<br>
index 74cdd64..2f63f04 100644<br>
--- a/c/src/lib/libbsp/m68k/mvme136/make/custom/mvme136.cfg<br>
+++ b/c/src/lib/libbsp/m68k/mvme136/make/custom/mvme136.cfg<br>
@@ -17,7 +17,7 @@ CPU_CFLAGS = -mcpu=68020<br>
 CFLAGS_OPTIMIZE_V = -Os -g -fomit-frame-pointer -DNDEBUG<br>
<br>
 define bsp-post-link<br>
-       $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec<br>
+       $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).srec<br>
        sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \<br>
            $(PACKHEX) > $(basename $@)$(DOWNEXT)<br>
        rm -f $(basename $@).srec<br>
diff --git a/c/src/lib/libbsp/m68k/mvme147/make/custom/mvme147.cfg b/c/src/lib/libbsp/m68k/mvme147/make/custom/mvme147.cfg<br>
index 0ba9719..9880587 100644<br>
--- a/c/src/lib/libbsp/m68k/mvme147/make/custom/mvme147.cfg<br>
+++ b/c/src/lib/libbsp/m68k/mvme147/make/custom/mvme147.cfg<br>
@@ -15,7 +15,7 @@ CPU_CFLAGS = -mcpu=68030<br>
 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer<br>
<br>
 define bsp-post-link<br>
-       $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec<br>
+       $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).srec<br>
        sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \<br>
            $(PACKHEX) > $(basename $@)$(DOWNEXT)<br>
        rm -f $(basename $@).srec<br>
diff --git a/c/src/lib/libbsp/m68k/mvme147s/make/custom/mvme147s.cfg b/c/src/lib/libbsp/m68k/mvme147s/make/custom/mvme147s.cfg<br>
index e14de8d..3eaade8 100644<br>
--- a/c/src/lib/libbsp/m68k/mvme147s/make/custom/mvme147s.cfg<br>
+++ b/c/src/lib/libbsp/m68k/mvme147s/make/custom/mvme147s.cfg<br>
@@ -15,7 +15,7 @@ CPU_CFLAGS = -mcpu=68030<br>
 CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer<br>
<br>
 define bsp-post-link<br>
-       $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec<br>
+       $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).srec<br>
        sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \<br>
            $(PACKHEX) > $(basename $@)$(DOWNEXT)<br>
        rm -f $(basename $@).srec<br>
diff --git a/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162.cfg b/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162.cfg<br>
index d8a217f..4b343b2 100644<br>
--- a/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162.cfg<br>
+++ b/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162.cfg<br>
@@ -20,7 +20,7 @@ CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O binary $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       $(OBJCOPY) -O binary $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
<br>
 # BSP-specific tools<br>
diff --git a/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162lx.cfg b/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162lx.cfg<br>
index 81c398e..2a210a9 100644<br>
--- a/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162lx.cfg<br>
+++ b/c/src/lib/libbsp/m68k/mvme162/make/custom/mvme162lx.cfg<br>
@@ -25,7 +25,7 @@ CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O binary $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       $(OBJCOPY) -O binary $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
<br>
 # BSP-specific tools<br>
diff --git a/c/src/lib/libbsp/m68k/mvme167/make/custom/mvme167.cfg b/c/src/lib/libbsp/m68k/mvme167/make/custom/mvme167.cfg<br>
index a56de0f..21bd9af 100644<br>
--- a/c/src/lib/libbsp/m68k/mvme167/make/custom/mvme167.cfg<br>
+++ b/c/src/lib/libbsp/m68k/mvme167/make/custom/mvme167.cfg<br>
@@ -36,5 +36,5 @@ CFLAGS_OPTIMIZE_V = -O2 -g -fno-omit-frame-pointer<br>
 # for more details.<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-    $(OBJCOPY) -O binary -R .comment -S $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+    $(OBJCOPY) -O binary -R .comment -S $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/m68k/sim68000/make/custom/sim68000.cfg b/c/src/lib/libbsp/m68k/sim68000/make/custom/sim68000.cfg<br>
index bb3354a..fb355cb 100644<br>
--- a/c/src/lib/libbsp/m68k/sim68000/make/custom/sim68000.cfg<br>
+++ b/c/src/lib/libbsp/m68k/sim68000/make/custom/sim68000.cfg<br>
@@ -16,5 +16,5 @@ CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O srec $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/m68k/sim68000/make/custom/simcpu32.cfg b/c/src/lib/libbsp/m68k/sim68000/make/custom/simcpu32.cfg<br>
index 939a1e1..817e162 100644<br>
--- a/c/src/lib/libbsp/m68k/sim68000/make/custom/simcpu32.cfg<br>
+++ b/c/src/lib/libbsp/m68k/sim68000/make/custom/simcpu32.cfg<br>
@@ -16,5 +16,5 @@ CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O srec $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/m68k/uC5282/make/custom/uC5282.cfg b/c/src/lib/libbsp/m68k/uC5282/make/custom/uC5282.cfg<br>
index caf93a8..3c62a17 100644<br>
--- a/c/src/lib/libbsp/m68k/uC5282/make/custom/uC5282.cfg<br>
+++ b/c/src/lib/libbsp/m68k/uC5282/make/custom/uC5282.cfg<br>
@@ -16,5 +16,5 @@ CFLAGS_OPTIMIZE_V = -O2 -g<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O binary $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       $(OBJCOPY) -O binary $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/nios2/nios2_iss/make/custom/nios2_iss.cfg b/c/src/lib/libbsp/nios2/nios2_iss/make/custom/nios2_iss.cfg<br>
index e8fb39d..8254eec 100644<br>
--- a/c/src/lib/libbsp/nios2/nios2_iss/make/custom/nios2_iss.cfg<br>
+++ b/c/src/lib/libbsp/nios2/nios2_iss/make/custom/nios2_iss.cfg<br>
@@ -21,7 +21,7 @@ CPU_CFLAGS = -mno-hw-mul -mno-hw-div<br>
 CFLAGS_OPTIMIZE_V = -O0 -g<br>
<br>
 define bsp-post-link<br>
-       $(OBJCOPY) -O binary --strip-all $(basename $@).exe \<br>
+       $(OBJCOPY) -O binary --strip-all $(basename $@)$(EXEEXT) \<br>
            -R entry -R exceptions $(basename $@)$(DOWNEXT)<br>
        $(default-bsp-post-link)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/powerpc/haleakala/make/custom/haleakala.cfg b/c/src/lib/libbsp/powerpc/haleakala/make/custom/haleakala.cfg<br>
index 41cd98e..67ffe58 100644<br>
--- a/c/src/lib/libbsp/powerpc/haleakala/make/custom/haleakala.cfg<br>
+++ b/c/src/lib/libbsp/powerpc/haleakala/make/custom/haleakala.cfg<br>
@@ -20,5 +20,5 @@ CFLAGS_OPTIMIZE_V = -O1 -g<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O srec $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/powerpc/mbx8xx/make/custom/mbx8xx.inc b/c/src/lib/libbsp/powerpc/mbx8xx/make/custom/mbx8xx.inc<br>
index c1a2235..4795de7 100644<br>
--- a/c/src/lib/libbsp/powerpc/mbx8xx/make/custom/mbx8xx.inc<br>
+++ b/c/src/lib/libbsp/powerpc/mbx8xx/make/custom/mbx8xx.inc<br>
@@ -49,7 +49,7 @@ CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions<br>
 LDFLAGS += $(MBX8xx_LDFLAGS)<br>
<br>
 define bsp-post-link<br>
-       cp $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       cp $(basename $@)$(EXEEXT)  $(basename $@)$(DOWNEXT)<br>
        $(STRIP) $(basename $@)$(DOWNEXT)<br>
        $(default-bsp-post-link)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/mcp750.cfg b/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/mcp750.cfg<br>
index fc775d1..8ff97b3 100644<br>
--- a/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/mcp750.cfg<br>
+++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/mcp750.cfg<br>
@@ -17,11 +17,11 @@ CFLAGS_OPTIMIZE_V = -O2 -g -mmultiple -mstring -mstrict-align<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O binary -R .comment -S $(basename $@).exe rtems<br>
+       $(OBJCOPY) -O binary -R .comment -S $(basename $@)$(EXEEXT) rtems<br>
        gzip -vf9 rtems<br>
        $(LD) -o $(basename $@)$(DOWNEXT) \<br>
            $ $(PROJECT_RELEASE)/lib/bootloader.o \<br>
-           --just-symbols=$(basename $@).exe \<br>
+           --just-symbols=$(basename $@)$(EXEEXT) \<br>
            -b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \<br>
            -Map $(basename $@).map && chmod 755 $@<br>
        rm -f rtems.gz<br>
diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/mtx603e.cfg b/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/mtx603e.cfg<br>
index 2411501..6c7f597 100644<br>
--- a/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/mtx603e.cfg<br>
+++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/mtx603e.cfg<br>
@@ -16,11 +16,11 @@ CFLAGS_OPTIMIZE_V = -O2 -g -mmultiple -mstring -mstrict-align<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O binary -R .comment -S $(basename $@).exe rtems<br>
+       $(OBJCOPY) -O binary -R .comment -S $(basename $@)$(EXEEXT) rtems<br>
        gzip -vf9 rtems<br>
        $(LD) -o $(basename $@)$(DOWNEXT) \<br>
           $(PROJECT_RELEASE)/lib/bootloader.o \<br>
-           --just-symbols=$(basename $@).exe \<br>
+           --just-symbols=$(basename $@)$(EXEEXT) \<br>
            -b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \<br>
            -Map $(basename $@).map && chmod 755 $@<br>
        rm -f rtems.gz<br>
diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/mvme2100.cfg b/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/mvme2100.cfg<br>
index 93e14ab..d724b5d 100644<br>
--- a/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/mvme2100.cfg<br>
+++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/mvme2100.cfg<br>
@@ -16,11 +16,11 @@ CFLAGS_OPTIMIZE_V = -O2 -g -mmultiple -mstring -mstrict-align<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O binary -R .comment -S $(basename $@).exe rtems<br>
+       $(OBJCOPY) -O binary -R .comment -S $(basename $@)$(EXEEXT) rtems<br>
        gzip -vf9 rtems<br>
        $(LD) -o $(basename $@)$(DOWNEXT) \<br>
            $(PROJECT_RELEASE)/lib/bootloader.o \<br>
-           --just-symbols=$(basename $@).exe \<br>
+           --just-symbols=$(basename $@)$(EXEEXT) \<br>
            -b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \<br>
            -Map $(basename $@).map && chmod 755 $@<br>
        rm -f rtems.gz<br>
diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/mvme2307.cfg b/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/mvme2307.cfg<br>
index d7dac3a..ee00561 100644<br>
--- a/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/mvme2307.cfg<br>
+++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/mvme2307.cfg<br>
@@ -17,10 +17,10 @@ CFLAGS_OPTIMIZE_V = -O2 -g<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O binary -R .comment -S $(basename $@).exe rtems<br>
+       $(OBJCOPY) -O binary -R .comment -S $(basename $@)$(EXEEXT) rtems<br>
        gzip -vf9 rtems<br>
        $(LD) -o $(basename $@)$(DOWNEXT)  $(PROJECT_RELEASE)/lib/bootloader.o \<br>
-           --just-symbols=$(basename $@).exe \<br>
+           --just-symbols=$(basename $@)$(EXEEXT) \<br>
            -b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \<br>
            -Map $(basename $@).map && chmod 755 $@<br>
        rm -f rtems.gz<br>
diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/qemuprep-altivec.cfg b/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/qemuprep-altivec.cfg<br>
index cef17e5..1dd1744 100644<br>
--- a/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/qemuprep-altivec.cfg<br>
+++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/qemuprep-altivec.cfg<br>
@@ -18,15 +18,15 @@ CFLAGS_OPTIMIZE_V = -O2 -g<br>
 ifdef PURE_BINARY<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O binary -R .comment -S $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       $(OBJCOPY) -O binary -R .comment -S $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
 else<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O binary -R .comment -S $(basename $@).exe rtems<br>
+       $(OBJCOPY) -O binary -R .comment -S $(basename $@)$(EXEEXT) rtems<br>
        gzip -vf9 rtems<br>
        $(LD) -o $(basename $@)$(DOWNEXT)  $(PROJECT_RELEASE)/lib/bootloader.o \<br>
-           --just-symbols=$(basename $@).exe \<br>
+           --just-symbols=$(basename $@)$(EXEEXT) \<br>
            -b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \<br>
            -Map $(basename $@).map && chmod 755 $@<br>
        rm -f rtems.gz<br>
diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/qemuprep.cfg b/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/qemuprep.cfg<br>
index 3922767..e5f11fc 100644<br>
--- a/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/qemuprep.cfg<br>
+++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/make/custom/qemuprep.cfg<br>
@@ -18,15 +18,15 @@ CFLAGS_OPTIMIZE_V = -O2 -g<br>
 ifdef PURE_BINARY<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O binary -R .comment -S $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       $(OBJCOPY) -O binary -R .comment -S $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
 else<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O binary -R .comment -S $(basename $@).exe rtems<br>
+       $(OBJCOPY) -O binary -R .comment -S $(basename $@)$(EXEEXT) rtems<br>
        gzip -vf9 rtems<br>
        $(LD) -o $(basename $@)$(DOWNEXT)  $(PROJECT_RELEASE)/lib/bootloader.o \<br>
-           --just-symbols=$(basename $@).exe \<br>
+           --just-symbols=$(basename $@)$(EXEEXT) \<br>
            -b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \<br>
            -Map $(basename $@).map && chmod 755 $@<br>
        rm -f rtems.gz<br>
diff --git a/c/src/lib/libbsp/powerpc/mvme3100/make/custom/mvme3100.cfg b/c/src/lib/libbsp/powerpc/mvme3100/make/custom/mvme3100.cfg<br>
index 3ea5c2b..ddd6d23 100644<br>
--- a/c/src/lib/libbsp/powerpc/mvme3100/make/custom/mvme3100.cfg<br>
+++ b/c/src/lib/libbsp/powerpc/mvme3100/make/custom/mvme3100.cfg<br>
@@ -17,5 +17,5 @@ CFLAGS_OPTIMIZE_V = -O2 -g<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O binary $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       $(OBJCOPY) -O binary $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/powerpc/mvme5500/make/custom/mvme5500.cfg b/c/src/lib/libbsp/powerpc/mvme5500/make/custom/mvme5500.cfg<br>
index b4727bc..4c59a07 100644<br>
--- a/c/src/lib/libbsp/powerpc/mvme5500/make/custom/mvme5500.cfg<br>
+++ b/c/src/lib/libbsp/powerpc/mvme5500/make/custom/mvme5500.cfg<br>
@@ -19,7 +19,7 @@ CFLAGS_OPTIMIZE_V = -O2 -g<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O binary $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       $(OBJCOPY) -O binary $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
<br>
 #<br>
diff --git a/c/src/lib/libbsp/powerpc/qemuppc/make/custom/qemuppc.cfg b/c/src/lib/libbsp/powerpc/qemuppc/make/custom/qemuppc.cfg<br>
index 177f88f..b768855 100644<br>
--- a/c/src/lib/libbsp/powerpc/qemuppc/make/custom/qemuppc.cfg<br>
+++ b/c/src/lib/libbsp/powerpc/qemuppc/make/custom/qemuppc.cfg<br>
@@ -16,5 +16,5 @@ CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O binary $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       $(OBJCOPY) -O binary $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/powerpc/score603e/make/custom/score603e.cfg b/c/src/lib/libbsp/powerpc/score603e/make/custom/score603e.cfg<br>
index 7b03438..a657bb3 100644<br>
--- a/c/src/lib/libbsp/powerpc/score603e/make/custom/score603e.cfg<br>
+++ b/c/src/lib/libbsp/powerpc/score603e/make/custom/score603e.cfg<br>
@@ -22,7 +22,7 @@ CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).s1<br>
+       $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@).s1<br>
        sed -e 's/.$$//' $(basename $@).s1 | \<br>
          $(PACKHEX) >$(basename $@)$(DOWNEXT)<br>
        rm -f $(basename $@).s1<br>
diff --git a/c/src/lib/libbsp/powerpc/ss555/make/custom/ss555.cfg b/c/src/lib/libbsp/powerpc/ss555/make/custom/ss555.cfg<br>
index 22ae7fb..cde7f4a 100644<br>
--- a/c/src/lib/libbsp/powerpc/ss555/make/custom/ss555.cfg<br>
+++ b/c/src/lib/libbsp/powerpc/ss555/make/custom/ss555.cfg<br>
@@ -23,6 +23,6 @@ CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       cp $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       cp $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
        $(STRIP) $(basename $@)$(DOWNEXT)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/make/custom/tqm8xx.inc b/c/src/lib/libbsp/powerpc/tqm8xx/make/custom/tqm8xx.inc<br>
index 119bc28..da32441 100644<br>
--- a/c/src/lib/libbsp/powerpc/tqm8xx/make/custom/tqm8xx.inc<br>
+++ b/c/src/lib/libbsp/powerpc/tqm8xx/make/custom/tqm8xx.inc<br>
@@ -15,7 +15,7 @@ CPU_CFLAGS = -mcpu=860 -Dmpc860 \<br>
 CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions<br>
<br>
 define bsp-post-link<br>
-       cp $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       cp $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
        $(STRIP) $(basename $@)$(DOWNEXT)<br>
        $(default-bsp-post-link)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/powerpc/virtex/make/custom/virtex.cfg b/c/src/lib/libbsp/powerpc/virtex/make/custom/virtex.cfg<br>
index a91530c..96aa7cc 100644<br>
--- a/c/src/lib/libbsp/powerpc/virtex/make/custom/virtex.cfg<br>
+++ b/c/src/lib/libbsp/powerpc/virtex/make/custom/virtex.cfg<br>
@@ -19,5 +19,5 @@ CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions<br>
<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O srec $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
diff --git a/c/src/lib/libbsp/powerpc/virtex4/make/custom/virtex4.cfg b/c/src/lib/libbsp/powerpc/virtex4/make/custom/virtex4.cfg<br>
index 333b144..713c297 100644<br>
--- a/c/src/lib/libbsp/powerpc/virtex4/make/custom/virtex4.cfg<br>
+++ b/c/src/lib/libbsp/powerpc/virtex4/make/custom/virtex4.cfg<br>
@@ -14,6 +14,6 @@ CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions<br>
 # Miscellaneous additions go here<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O srec $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
<br>
diff --git a/c/src/lib/libbsp/powerpc/virtex5/make/custom/virtex5.cfg b/c/src/lib/libbsp/powerpc/virtex5/make/custom/virtex5.cfg<br>
index b4a7bd3..9601fbc 100644<br>
--- a/c/src/lib/libbsp/powerpc/virtex5/make/custom/virtex5.cfg<br>
+++ b/c/src/lib/libbsp/powerpc/virtex5/make/custom/virtex5.cfg<br>
@@ -14,6 +14,6 @@ CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions<br>
 # Miscellaneous additions go here<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       $(OBJCOPY) -O srec $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       $(OBJCOPY) -O srec $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
<br>
diff --git a/c/src/make/leaf.cfg b/c/src/make/leaf.cfg<br>
index dd0defe..8d3f52e 100644<br>
--- a/c/src/make/leaf.cfg<br>
+++ b/c/src/make/leaf.cfg<br>
@@ -8,11 +8,8 @@ ifndef LINKCMDS<br>
 LINKCMDS=$(PROJECT_RELEASE)/lib/linkcmds<br>
 endif<br>
<br>
-## what to do about $(EXEEXT) --> $(EXEEXT)<br>
-##    -o $(basename $@)$(EXEEXT)             OR<br>
-##    -o $(basename $@)$(EXEEXT)                  OR<br>
-<br>
-DOWNEXT=.ralf<br>
+EXEEXT?=.exe<br>
+DOWNEXT?=.ralf<br>
<br>
 define bsp-link-c<br>
        $(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \<br>
diff --git a/make/leaf.cfg b/make/leaf.cfg<br>
index 90cda37..6ebf4bd 100644<br>
--- a/make/leaf.cfg<br>
+++ b/make/leaf.cfg<br>
@@ -78,20 +78,17 @@ clean: clean-am<br>
 .PHONY: clean clean-am<br>
 endif<br>
<br>
-## what to do about $(EXEEXT) --> $(EXEEXT)<br>
-##    -o $(basename $@)$(EXEEXT)             OR<br>
-##    -o $(basename $@)$(EXEEXT)                  OR<br>
-<br>
-DOWNEXT=.ralf<br>
+EXEEXT?=.exe<br>
+DOWNEXT?=.ralf<br>
<br>
 define bsp-link-c<br>
        $(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \<br>
-           -o $(basename $@).exe $(LINK_OBJS) $(LINK_LIBS)<br>
+           -o $(basename $@)$(EXEEXT) $(LINK_OBJS) $(LINK_LIBS)<br>
 endef<br>
<br>
 define bsp-link-cxx<br>
        $(LINK.cc) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \<br>
-           -o $(basename $@).exe $(LINK_OBJS) $(LINK_LIBS)<br>
+           -o $(basename $@)$(EXEEXT) $(LINK_OBJS) $(LINK_LIBS)<br>
 endef<br>
<br>
 define default-bsp-post-link<br>
@@ -102,7 +99,7 @@ endef<br>
 ifndef bsp-post-link<br>
 define bsp-post-link<br>
        $(default-bsp-post-link)<br>
-       cp $(basename $@).exe $(basename $@)$(DOWNEXT)<br>
+       cp $(basename $@)$(EXEEXT) $(basename $@)$(DOWNEXT)<br>
 endef<br>
 endif<br>
<br>
____<br>
--<br>
Nick Withers<br>
<br>
Embedded Systems Programmer<br>
Room 2.26, Building 57<br>
Department of Nuclear Physics<br>
Research School of Physics and Engineering<br>
The Australian National University (CRICOS: 00120C)<br>
<br>
eMail: <a href="mailto:nick.withers@anu.edu.au">nick.withers@anu.edu.au</a><br>
Phone: +61 2 6125 2091<br>
Mobile: +61 414 397 446<br>
<br>
<br>
<br>
_______________________________________________<br>
rtems-devel mailing list<br>
<a href="mailto:rtems-devel@rtems.org">rtems-devel@rtems.org</a><br>
<a href="http://www.rtems.org/mailman/listinfo/rtems-devel" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-devel</a><br>
</blockquote></div>