Index: hello_world_ada/ChangeLog
===================================================================
--- hello_world_ada/ChangeLog	(revision ed30e2b63dd8ff5c3336b1110fcd0186fa98a5d0)
+++ hello_world_ada/ChangeLog	(revision 3538a0cba91906c87b7feab05896ec9a795b2f3c)
@@ -1,2 +1,7 @@
+2007-09-17	Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* Makefile.anybsp: pc86 now builds with Makefile.anybsp.
+	* Makefile.pc386: Removed.
+
 2007-08-17	Joel Sherrill <joel.sherrill@oarcorp.com>
 
Index: hello_world_ada/Makefile.anybsp
===================================================================
--- hello_world_ada/Makefile.anybsp	(revision ed30e2b63dd8ff5c3336b1110fcd0186fa98a5d0)
+++ hello_world_ada/Makefile.anybsp	(revision 3538a0cba91906c87b7feab05896ec9a795b2f3c)
@@ -1,39 +1,70 @@
 #
-#  Makefile for hello world example -- any BSP without special help
+#  Makefile for Ada sockets example
 #
-#  Directly produces an executable for any BSP which directly runs
+#  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/sis
+#      sparc/leon2
+#      sparc/leon3
+#
+#  Some BSPs require extra manipulation of the ELF file before it can
+#  be run on the target hardware.
 #
 
-MAIN=hello
+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)
+  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
-rtemsdir=${RTEMS_MAKEFILE_PATH}
 GNATMAKE=$(AS:as=gnatmake)
-CARGS =-B${rtemsdir}/lib/ -specs bsp_specs -qrtems $(CPU_CFLAGS) 
+CARGS =-B${RTEMS_MAKEFILE_PATH}/lib/ -specs bsp_specs -qrtems $(CPU_CFLAGS) 
 CARGS+=-DGNAT_MAIN_STACKSPACE=100
 
-all: init.o 
-	$(GNATMAKE) -v -O -gnata -gnatE -gnato $(MAIN) -g \
+all:  $(PROGRAM)
+
+$(PROGRAM): init.o *.adb
+	$(GNATMAKE) -v -O -gnata -gnatE -gnato $(@) -g \
+	    -I../src \
 	    -bargs -Mgnat_main \
 	    -largs $(CARGS) $(LINKARGS) init.o
-	$(SIZE) $(MAIN)
+	$(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
@@ -41,4 +72,4 @@
 
 clean:
-	rm -f b~$(MAIN).*  *.o *.ali $(MAIN)
+	rm -f b~*.*  *.o *.ali $(EXAMPLES)
 	rm -f *.num *.exe *.obj *.bin *.bt
Index: hello_world_ada/Makefile.pc386
===================================================================
--- hello_world_ada/Makefile.pc386	(revision ed30e2b63dd8ff5c3336b1110fcd0186fa98a5d0)
+++ 	(revision )
@@ -1,52 +1,0 @@
-#
-#  Makefile for hello world example
-#
-
-MAIN=hello
-
-
-include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
-
-include $(RTEMS_CUSTOM)
-include $(PROJECT_ROOT)/make/leaf.cfg
-
-# Constants for relocating
-HEADERADDR=0x00097E00
-START16FILE=$(rtemsdir)/lib/start16.bin
-START16ADDR=0x00097C00
-RELOCADDR=0x00100000
-
-# Tool helpers
-rtemsdir=${RTEMS_MAKEFILE_PATH}
-GNATMAKE=$(AS:as=gnatmake)
-CARGS=-B${rtemsdir}/lib/ -specs bsp_specs -qrtems $(CPU_CFLAGS) \
-   -Wl,-Ttext,$(RELOCADDR) 
-CARGS+=-DGNAT_MAIN_STACKSPACE=100
-
-all: init.o $(MAIN)
-
-$(MAIN): $(MAIN).exe
-	ln $(MAIN).exe $(MAIN)
-
-$(MAIN).exe: init.o
-	$(GNATMAKE) -v -O -gnata -gnatE -gnato $(MAIN) -g -o $(MAIN).obj \
-	    -bargs -Mgnat_main \
-	    -cargs $(CARGS) \
-	    -largs $(CARGS) init.o
-	$(SIZE) $(MAIN).obj
-	$(NM) -g -n $(MAIN).obj >$(MAIN).num
-	$(OBJCOPY) -O elf32-i386 \
-            --remove-section=.rodata \
-            --remove-section=.comment \
-            --remove-section=.note \
-            --strip-unneeded $(MAIN).obj $@
-	$(OBJCOPY) -O binary $(MAIN).obj $(MAIN).bin
-	$(rtemsdir)/build-tools/bin2boot -v $(MAIN).bt $(HEADERADDR) \
-          $(START16FILE) $(START16ADDR) 0 $(MAIN).bin $(RELOCADDR) 0
-
-init.o: init.c
-	$(CC) $(CFLAGS) -c init.c
-
-clean:
-	rm -f b_$(MAIN).c b_$(MAIN).o *.o *.ali $(MAIN)
-	rm -f *.num *.exe *.obj *.bin *.bt
