source: ada-examples/Makefile.shared @ 789d0e8

ada-examples-4-10-branch
Last change on this file since 789d0e8 was dabca92, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 17, 2009 at 5:38:42 PM

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

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