Index: hello_world_ada/ChangeLog
===================================================================
--- hello_world_ada/ChangeLog	(revision fd0047ee9af384407b6b80da2624e9c3be04d995)
+++ hello_world_ada/ChangeLog	(revision db9a1d193035dde6cba8fe4123dc23def5462962)
@@ -1,2 +1,9 @@
+2007-09-27	Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* README: New tests. Clean up. Rework so all tests use the same shared
+	Makefile for the hard logic of producing an executable.
+	* Makefile, pc386-elf2boot: New files.
+	* Makefile.anybsp: Removed.
+
 2007-09-17	Joel Sherrill <joel.sherrill@oarcorp.com>
 
Index: hello_world_ada/Makefile
===================================================================
--- hello_world_ada/Makefile	(revision db9a1d193035dde6cba8fe4123dc23def5462962)
+++ hello_world_ada/Makefile	(revision db9a1d193035dde6cba8fe4123dc23def5462962)
@@ -0,0 +1,25 @@
+#
+#  Makefile for Ada Dump URL example
+#
+#  See README.Makefiles in the main ada-examples directory.
+#
+
+PROGRAM=hello
+
+include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
+include $(RTEMS_CUSTOM)
+include $(PROJECT_ROOT)/make/leaf.cfg
+
+# stack size for the first Ada thread
+CFLAGS +=-DGNAT_MAIN_STACKSPACE=100
+
+# initialize the network stack -- assumes existence of networkconfig.h
+# CFLAGS +=-DMAIN_USE_NETWORKING=1
+
+# Should we prompt for command line arguments?
+# DEFINES +=-DMAIN_USE_REQUIRES_COMMAND_LINE
+
+# If you want to hard-code the command line, define this to a string
+# DEFINES += -DMAIN_COMMAND_LINE="ARGS"
+
+include ../Makefile.shared
Index: llo_world_ada/Makefile.anybsp
===================================================================
--- hello_world_ada/Makefile.anybsp	(revision fd0047ee9af384407b6b80da2624e9c3be04d995)
+++ 	(revision )
@@ -1,75 +1,0 @@
-#
-#  Makefile for Ada sockets example
-#
-#  Directly produces an executable for a BSP which directly runs
-#  the format (usually ELF) produced by just linking an application.
-#  There are a couple of BSP families which require just a bit of
-#  assistance that this Makefile knows about -- gen5200 and pc386.
-#  The executables produced by this Makefile should run on at least the
-#  following BSPs:
-#      arm/edb7312
-#      i386/pc386
-#      mips/jmr3904
-#      powerpc/icecube
-#      powerpc/psim
-#      powerpc/score603e
-#      sparc/erc32
-#      sparc/leon2
-#      sparc/leon3
-#
-#  Some BSPs require extra manipulation of the ELF file before it can
-#  be run on the target hardware.
-#
-
-PROGRAM=hello
-
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg
-
-# GEN5200 Specific Information
-ifeq ($(RTEMS_BSP_FAMILY),gen5200)
-  LINKARGS+=-qnolinkcmds -T$(RTEMS_LINKCMDS)
-endif
-
-# PC386 Specific Information
-ifeq ($(RTEMS_BSP_FAMILY),pc386)
-  HEADERADDR=0x00097E00
-  START16FILE=$(RTEMS_MAKEFILE_PATH)/lib/start16.bin
-  START16ADDR=0x00097C00
-  RELOCADDR=0x00100000
-  LINKARGS+= -Wl,-Ttext,$(RELOCADDR) 
-endif
-
-# Tool helpers
-GNATMAKE=$(AS:as=gnatmake)
-CARGS =-B${RTEMS_MAKEFILE_PATH}/lib/ -specs bsp_specs -qrtems $(CPU_CFLAGS) 
-CARGS+=-DGNAT_MAIN_STACKSPACE=100
-
-all:  $(PROGRAM)
-
-$(PROGRAM): init.o *.adb
-	$(GNATMAKE) -v -O -gnata -gnatE -gnato $(@) -g \
-	    -I../src \
-	    -bargs -Mgnat_main \
-	    -largs $(CARGS) $(LINKARGS) init.o
-	$(SIZE) $(@)
-ifeq ($(RTEMS_BSP_FAMILY),pc386)
-	mv $(@) $(@).obj
-	$(OBJCOPY) -O elf32-i386 \
-            --remove-section=.rodata \
-            --remove-section=.comment \
-            --remove-section=.note \
-            --strip-unneeded $(@).obj $(@)
-	$(OBJCOPY) -O binary $(@).obj $(@).bin
-	$(RTEMS_MAKEFILE_PATH)/build-tools/bin2boot -v $(@).bt $(HEADERADDR) \
-          $(START16FILE) $(START16ADDR) 0 $(@).bin $(RELOCADDR) 0
-else
-endif
-
-init.o: init.c
-	$(CC) $(CFLAGS) $(CPU_CFLAGS) -c init.c
-
-clean:
-	rm -f b~*.*  *.o *.ali $(EXAMPLES)
-	rm -f *.num *.exe *.obj *.bin *.bt
Index: hello_world_ada/README
===================================================================
--- hello_world_ada/README	(revision fd0047ee9af384407b6b80da2624e9c3be04d995)
+++ hello_world_ada/README	(revision db9a1d193035dde6cba8fe4123dc23def5462962)
@@ -3,30 +3,7 @@
 #
 
-The Makefile.anybsp can be used to compile and link an executable
-for most BSPs.  Some BSPs require extra transformation in order to
-download and those may require their own Makefile (e.g. pc386).
+This directory contains a hello world Ada example program. 
 
-The following is an example of how to build this test:
+See the README.Makefiles in the top directory for instructions
+on building for most BSPs.
 
-export RTEMS_MAKEFILE_PATH=/home/joel/rtems-4.8-work/bsp-install/CPU-rtems4.8/BSP/
-make -f Makefile.anybsp clean all
-
-This procedure has been used on the following BSPs:
-
-  arm/edb7312
-  bfin/eZKit533
-  m68k/mcf5206elite
-  mips/jmr3904
-  powerpc/gen5200
-  powerpc/psim
-  sparc/erc32
-  sparc/leon2
-  sparc/leon3
-  sparc/sis
-
-For the i386/pc386 BSP, you need to use the other Makefile.pc386 similar
-to the following:
-
-export RTEMS_MAKEFILE_PATH=/home/joel/rtems-4.8-work/bsp-install/i386-rtems4.8/pc386/
-make -f Makefile.pc386 clean all
-
Index: hello_world_ada/pc386-elf2boot
===================================================================
--- hello_world_ada/pc386-elf2boot	(revision db9a1d193035dde6cba8fe4123dc23def5462962)
+++ hello_world_ada/pc386-elf2boot	(revision db9a1d193035dde6cba8fe4123dc23def5462962)
@@ -0,0 +1,57 @@
+#! /bin/sh
+#
+#  Script for pc386 BSP to convert ELF files to GRUB bootable images
+#
+
+if [ "X${RTEMS_MAKEFILE_PATH}" = "X" ] ; then
+  echo RTEMS_MAKEFILE_PATH is not set 
+  exit 1
+fi
+
+BSPINC=${RTEMS_MAKEFILE_PATH}/Makefile.inc
+if [ ! -r ${BSPINC} ] ; then
+  echo "${BSPINC} does not exist."
+  echo "Is your BSP installed?"
+  exit 1
+fi
+
+OBJCOPY=`grep ^OBJCOPY_FOR_TARGET ${BSPINC} | cut -d'=' -f2`
+
+set -x
+
+if [ $# -ne 2 ] ; then
+  echo "Usage: $0 elf_file boot_file"
+  exit 1
+fi
+if [ ! -r ${BSPINC} ] ; then
+  echo "${BSPINC} does not exist."
+  echo "Is your BSP installed?"
+  exit 1
+fi
+
+echo ${OBJCOPY}
+elf=${1}
+bt=${2}
+
+tmpbin=${elf}.bin
+tmpbin=${elf}.bin
+exit 0
+
+# Constants for relocating
+HEADERADDR=0x00097E00
+START16FILE=$(RTEMS_MAKEFILE_PATH)/lib/start16.bin
+START16ADDR=0x00097C00
+RELOCADDR=0x00100000
+
+# Tool helpers
+${OBJCOPY} -O elf32-i386 \
+  --remove-section=.rodata \
+  --remove-section=.comment \
+  --remove-section=.note \
+  --strip-unneeded ${MAIN}.obj $@
+${OBJCOPY} -O binary ${MAIN}.obj ${MAIN}.bin
+${RTEMS_MAKEFILE_PATH}/build-tools/bin2boot -v \
+  ${MAIN}.bt ${HEADERADDR} \
+  ${START16FILE} ${START16ADDR} 0 ${MAIN}.bin ${RELOCADDR} 0
+
+exit 0
