source: ada-examples/Makefile.shared @ e5636e3

ada-examples-4-10-branch SIGAda2010
Last change on this file since e5636e3 was e5636e3, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on Mar 10, 2010 at 5:31:00 PM

pass RTS option to linker, add COBRA5475 options

  • Property mode set to 100644
File size: 2.8 KB
Line 
1#
2#  Subdirectory makefiles do some setup, then we get here
3#
4#  $Id$
5#
6
7# Tool helpers
8SPECFLAGS =-B${RTEMS_MAKEFILE_PATH}/lib/ -specs=bsp_specs -qrtems
9CFLAGS =
10
11# GEN5200 Specific Information
12ifeq ($(RTEMS_BSP),icecube)
13  LINKARGS+=-qnolinkcmds -T$(RTEMS_LINKCMDS)
14endif
15
16# PC386 Specific Information
17ifeq ($(RTEMS_BSP),pc386)
18  HEADERADDR=0x00097E00
19  START16FILE=$(RTEMS_MAKEFILE_PATH)/lib/start16.bin
20  START16ADDR=0x00097C00
21  RELOCADDR=0x00100000
22  LINKARGS+= -Wl,-Ttext,$(RELOCADDR)
23endif
24
25# COBRA5475 Specific Information
26ifeq ($(RTEMS_BSP),COBRA5475)
27  LINKARGS+=-qnolinkcmds -T$(RTEMS_LINKCMDS)
28CFLAGS += -mcpu=5475
29endif
30# Some tests need to be able to do a gethostbyname
31ifeq ($(NEED_ROOTFS_FOR_HOST_INFO),yes)
32  CLEAN_ADDITIONS += FilesystemImage FilesystemImage.c FilesystemImage.h
33  FILESYSTEM_OBJS  = FilesystemImage.o
34  FILESYSTEM_SRCS  = FilesystemImage.h
35  CFLAGS          += -DENABLE_UNTAR_ROOT_FILESYSTEM -I.
36endif
37
38ifeq ($(NEED_NETWORK),yes)
39#NETWORK_HFILE= ../networkconfig_$(RTEMS_BSP).h
40#NETWORK_HFILE= ../networkconfig.h
41endif
42
43
44DEFINES += -D$(RTEMS_BSP)
45CFLAGS += $(DEFINES)
46
47RTS= --RTS=$(shell $(CC) -print-multi-directory $(CFLAGS))
48
49all:  $(PROGRAM).exe
50
51joel:
52        @echo CFLAGS=$(CFLAGS)
53        @echo CC=$(CC)
54        @echo RTS=$(RTS)
55        $(CC) -print-multi-directory $(CFLAGS)
56        $(CC) -mcpu=403 -print-multi-directory
57
58$(PROGRAM).exe: rtems_init.o $(FILESYSTEM_OBJS) $(EXTRA_OBJS)
59        $(AS:as=gnatmake) $(CPU_CFLAGS) $(RTS) -g -v $(EXTRA_GNATFLAGS) \
60            -I$(RTEMS_MAKEFILE_PATH)/lib/include/adainclude \
61            -O -gnata -gnatE -gnato -g $(PROGRAM) -o $(@) \
62            -bargs -Mgnat_main \
63            -largs $(SPECFLAGS) $(CFLAGS) $(LINKARGS) \
64                rtems_init.o $(FILESYSTEM_OBJS) \
65             $(EXTRA_OBJS)
66ifeq ($(RTEMS_BSP_FAMILY),pc386)
67        $(OBJCOPY) -O binary $(@) $(@).bin
68        $(RTEMS_MAKEFILE_PATH)/build-tools/bin2boot -v $(@).bt $(HEADERADDR) \
69          $(START16FILE) $(START16ADDR) 0 $(@).bin $(RELOCADDR) 0
70endif
71ifeq ($(RTEMS_BSP),icecube)
72        $(OBJCOPY) -R -S -O binary obj/$(PROGRAM) obj/$(PROGRAM).bin
73        cat obj/$(PROGRAM).bin | gzip -9 >obj/$(PROGRAM).gz
74        mkimage \
75          -A ppc -O rtems -T kernel -a 0x40000 -e 0x40000 -n "RTEMS" \
76          -d obj/$(PROGRAM).gz obj/$(PROGRAM).img
77        cp obj/$(PROGRAM).img ../../../../tftpboot/main.img
78        rm -f obj/$(PROGRAM).gz obj/$(PROGRAM).img
79endif
80
81rtems_init.o: ../rtems_init.c $(FILESYSTEM_SRCS) $(NETWORK_HFILE)
82        $(CC) $(CFLAGS) -I. $(CPU_CFLAGS) -c $<
83
84ifeq ($(NEED_ROOTFS_FOR_HOST_INFO),yes)
85FilesystemImage: ../rootfs/etc/host.conf ../rootfs/etc/hosts
86        (cd ../rootfs ; tar cf - \
87          --exclude CVS --exclude .cvsignore --exclude .svn .) >$(@)
88
89FilesystemImage.c FilesystemImage.h: FilesystemImage
90        $(PROJECT_ROOT)/bin/rtems-bin2c FilesystemImage FilesystemImage
91
92FilesystemImage.o: FilesystemImage.c
93        $(CC) $(CFLAGS) $(CPU_CFLAGS) -c $<
94endif
95
96clean:
97        rm -f obj/*
98        rm -f b~*.*  *.o *.ali $(PROGRAM)
99        rm -f *.num *.exe *.obj *.bin *.bt *.gba
Note: See TracBrowser for help on using the repository browser.