summaryrefslogtreecommitdiff
path: root/hello_world_ada/Makefile.pc386
diff options
context:
space:
mode:
Diffstat (limited to 'hello_world_ada/Makefile.pc386')
-rw-r--r--hello_world_ada/Makefile.pc38654
1 files changed, 54 insertions, 0 deletions
diff --git a/hello_world_ada/Makefile.pc386 b/hello_world_ada/Makefile.pc386
new file mode 100644
index 0000000..1aac9df
--- /dev/null
+++ b/hello_world_ada/Makefile.pc386
@@ -0,0 +1,54 @@
+#
+# Makefile for hello world example
+#
+
+MAIN=hello
+
+# Tool paths
+target=i386-rtems
+tooldir=/home/joel/gnat-3.10p/${target}/
+rtemsdir=${tooldir}/rtems/pc386
+
+# Tool names
+GCC=${tooldir}/bin/${target}-gcc
+GNATMAKE=${tooldir}/bin/${target}-gnatmake
+SIZE=${tooldir}/bin/${target}-size
+OBJCOPY=${tooldir}/bin/${target}-objcopy
+NM=${tooldir}/bin/${target}-nm
+
+HEADERADDR=0x00097E00
+START16FILE=$(rtemsdir)/lib/start16.bin
+START16ADDR=0x00097C00
+RELOCADDR=0x00100000
+
+CARGS=-B${rtemsdir}/lib/ -specs bsp_specs -qrtems \
+ -Wl,-Ttext,$(RELOCADDR) -Wl,--oformat,elf32-i386
+
+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 -r \
+ -cargs $(CARGS) \
+ -largs $(CARGS) init.o
+ $(SIZE) $(MAIN).obj
+ $(NM) -g -n $(MAIN).obj >$(MAIN).num
+ $(OBJCOPY) -O a.out-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
+ $(GCC) -O4 -g -Wall -ansi -fasm $(CARGS) \
+ -DGNAT_MAIN_STACKSPACE=16 -c init.c
+
+clean:
+ rm -f b_$(MAIN).c b_$(MAIN).o *.o *.ali $(MAIN)