source: ada-examples/hello_world_ada/Makefile.anybsp @ 3538a0c

ada-examples-4-10-branchada-examples-4-8-branchada-examples-4-9-branch
Last change on this file since 3538a0c was 3538a0c, checked in by Joel Sherrill <joel.sherrill@…>, on 09/17/07 at 21:49:50

2007-09-17 Joel Sherrill <joel.sherrill@…>

  • Makefile.anybsp: pc86 now builds with Makefile.anybsp.
  • Makefile.pc386: Removed.
  • Property mode set to 100644
File size: 2.0 KB
Line 
1#
2#  Makefile for Ada sockets example
3#
4#  Directly produces an executable for a BSP which directly runs
5#  the format (usually ELF) produced by just linking an application.
6#  There are a couple of BSP families which require just a bit of
7#  assistance that this Makefile knows about -- gen5200 and pc386.
8#  The executables produced by this Makefile should run on at least the
9#  following BSPs:
10#      arm/edb7312
11#      i386/pc386
12#      mips/jmr3904
13#      powerpc/icecube
14#      powerpc/psim
15#      powerpc/score603e
16#      sparc/erc32
17#      sparc/leon2
18#      sparc/leon3
19#
20#  Some BSPs require extra manipulation of the ELF file before it can
21#  be run on the target hardware.
22#
23
24PROGRAM=hello
25
26include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
27include $(RTEMS_CUSTOM)
28include $(PROJECT_ROOT)/make/leaf.cfg
29
30# GEN5200 Specific Information
31ifeq ($(RTEMS_BSP_FAMILY),gen5200)
32  LINKARGS+=-qnolinkcmds -T$(RTEMS_LINKCMDS)
33endif
34
35# PC386 Specific Information
36ifeq ($(RTEMS_BSP_FAMILY),pc386)
37  HEADERADDR=0x00097E00
38  START16FILE=$(RTEMS_MAKEFILE_PATH)/lib/start16.bin
39  START16ADDR=0x00097C00
40  RELOCADDR=0x00100000
41  LINKARGS+= -Wl,-Ttext,$(RELOCADDR)
42endif
43
44# Tool helpers
45GNATMAKE=$(AS:as=gnatmake)
46CARGS =-B${RTEMS_MAKEFILE_PATH}/lib/ -specs bsp_specs -qrtems $(CPU_CFLAGS)
47CARGS+=-DGNAT_MAIN_STACKSPACE=100
48
49all:  $(PROGRAM)
50
51$(PROGRAM): init.o *.adb
52        $(GNATMAKE) -v -O -gnata -gnatE -gnato $(@) -g \
53            -I../src \
54            -bargs -Mgnat_main \
55            -largs $(CARGS) $(LINKARGS) init.o
56        $(SIZE) $(@)
57ifeq ($(RTEMS_BSP_FAMILY),pc386)
58        mv $(@) $(@).obj
59        $(OBJCOPY) -O elf32-i386 \
60            --remove-section=.rodata \
61            --remove-section=.comment \
62            --remove-section=.note \
63            --strip-unneeded $(@).obj $(@)
64        $(OBJCOPY) -O binary $(@).obj $(@).bin
65        $(RTEMS_MAKEFILE_PATH)/build-tools/bin2boot -v $(@).bt $(HEADERADDR) \
66          $(START16FILE) $(START16ADDR) 0 $(@).bin $(RELOCADDR) 0
67else
68endif
69
70init.o: init.c
71        $(CC) $(CFLAGS) $(CPU_CFLAGS) -c init.c
72
73clean:
74        rm -f b~*.*  *.o *.ali $(EXAMPLES)
75        rm -f *.num *.exe *.obj *.bin *.bt
Note: See TracBrowser for help on using the repository browser.