summaryrefslogtreecommitdiffstats
path: root/hello_world_ada
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-09-17 21:49:50 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-09-17 21:49:50 +0000
commit3538a0cba91906c87b7feab05896ec9a795b2f3c (patch)
treefe5249250c560086e685c262f45ad6d6ceedaeee /hello_world_ada
parent2007-08-17 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadada-examples-3538a0cba91906c87b7feab05896ec9a795b2f3c.tar.bz2
2007-09-17 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.anybsp: pc86 now builds with Makefile.anybsp. * Makefile.pc386: Removed.
Diffstat (limited to 'hello_world_ada')
-rw-r--r--hello_world_ada/ChangeLog5
-rw-r--r--hello_world_ada/Makefile.anybsp55
-rw-r--r--hello_world_ada/Makefile.pc38652
3 files changed, 48 insertions, 64 deletions
diff --git a/hello_world_ada/ChangeLog b/hello_world_ada/ChangeLog
index 7ec22a4..7e8ff74 100644
--- a/hello_world_ada/ChangeLog
+++ b/hello_world_ada/ChangeLog
@@ -1,3 +1,8 @@
+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>
* Makefile.anybsp: ep5200 renamed icecube. Trigger special case logic
diff --git a/hello_world_ada/Makefile.anybsp b/hello_world_ada/Makefile.anybsp
index add3e36..2d6972f 100644
--- a/hello_world_ada/Makefile.anybsp
+++ b/hello_world_ada/Makefile.anybsp
@@ -1,44 +1,75 @@
#
-# 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
$(CC) $(CFLAGS) $(CPU_CFLAGS) -c init.c
clean:
- rm -f b~$(MAIN).* *.o *.ali $(MAIN)
+ rm -f b~*.* *.o *.ali $(EXAMPLES)
rm -f *.num *.exe *.obj *.bin *.bt
diff --git a/hello_world_ada/Makefile.pc386 b/hello_world_ada/Makefile.pc386
deleted file mode 100644
index 422ad4d..0000000
--- a/hello_world_ada/Makefile.pc386
+++ /dev/null
@@ -1,52 +0,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