source: ada-examples/Makefile.shared @ 819c33f

ada-examples-4-10-branchada-examples-4-9-branch
Last change on this file since 819c33f was 3e422c4, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 28, 2007 at 2:32:48 PM

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

  • Makefile: Add stack_check test.
  • Makefile.shared: Add EXTRA_GNATFLAGS so stack_check can specify the flags -fstack-check.
  • Property mode set to 100644
File size: 2.0 KB
Line 
1#
2#  Subdirectory makefiles do some setup, then we get here
3#
4
5# Tool helpers
6CARGS =-B${RTEMS_MAKEFILE_PATH}/lib/ -specs bsp_specs -qrtems $(CPU_CFLAGS)
7
8# GEN5200 Specific Information
9ifeq ($(RTEMS_BSP_FAMILY),gen5200)
10  LINKARGS+=-qnolinkcmds -T$(RTEMS_LINKCMDS)
11endif
12
13# PC386 Specific Information
14ifeq ($(RTEMS_BSP_FAMILY),pc386)
15  HEADERADDR=0x00097E00
16  START16FILE=$(RTEMS_MAKEFILE_PATH)/lib/start16.bin
17  START16ADDR=0x00097C00
18  RELOCADDR=0x00100000
19  LINKARGS+= -Wl,-Ttext,$(RELOCADDR)
20endif
21
22# Some tests need to be able to do a gethostbyname
23ifeq ($(NEED_ROOTFS_FOR_HOST_INFO),yes)
24  CLEAN_ADDITIONS += FilesystemImage FilesystemImage.c FilesystemImage.h
25  FILESYSTEM_OBJS  = FilesystemImage.o
26  FILESYSTEM_SRCS  = FilesystemImage.h
27  CFLAGS          += -DENABLE_UNTAR_ROOT_FILESYSTEM -I.
28endif
29
30all:  $(PROGRAM)
31
32$(PROGRAM): rtems_init.o $(FILESYSTEM_OBJS) $(PROGRAM).adb
33        $(AS:as=gnatmake) -v $(EXTRA_GNATFLAGS) \
34            -O -gnata -gnatE -gnato $(@) -g -I../src \
35            -bargs -Mgnat_main \
36            -largs $(CARGS) $(LINKARGS) rtems_init.o $(FILESYSTEM_OBJS)
37        $(SIZE) $(@)
38ifeq ($(RTEMS_BSP_FAMILY),pc386)
39        mv $(@) $(@).obj
40        $(OBJCOPY) -O elf32-i386 \
41            --remove-section=.rodata \
42            --remove-section=.comment \
43            --remove-section=.note \
44            --strip-unneeded $(@).obj $(@)
45        $(OBJCOPY) -O binary $(@).obj $(@).bin
46        $(RTEMS_MAKEFILE_PATH)/build-tools/bin2boot -v $(@).bt $(HEADERADDR) \
47          $(START16FILE) $(START16ADDR) 0 $(@).bin $(RELOCADDR) 0
48else
49endif
50
51joel:
52        echo $(NEED_ROOTFS_FOR_HOST_INFO)
53
54rtems_init.o: ../rtems_init.c $(FILESYSTEM_SRCS)
55        $(CC) $(CFLAGS) $(CPU_CFLAGS) -c $<
56
57ifeq ($(NEED_ROOTFS_FOR_HOST_INFO),yes)
58FilesystemImage: ../rootfs/etc/host.conf ../rootfs/etc/hosts
59        (cd ../rootfs ; tar cf - --exclude CVS --exclude .cvsignore .) >$(@)
60
61FilesystemImage.c FilesystemImage.h: FilesystemImage
62        $(PROJECT_ROOT)/bin/bin2c FilesystemImage FilesystemImage
63
64FilesystemImage.o: FilesystemImage.c
65        $(CC) $(CFLAGS) $(CPU_CFLAGS) -c $<
66endif
67
68clean:
69        rm -f b~*.*  *.o *.ali $(PROGRAM)
70        rm -f *.num *.exe *.obj *.bin *.bt *.gba
71
Note: See TracBrowser for help on using the repository browser.