source: rtems/make/custom/pc386.cfg @ 997c921

Last change on this file since 997c921 was 997c921, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/30/06 at 06:58:56

Cleanup (Backport from HEAD).

  • Property mode set to 100644
File size: 3.2 KB
Line 
1#
2#  Config file for the PC 386 BSP
3#
4#  $Id$
5#
6
7include $(RTEMS_ROOT)/make/custom/default.cfg
8
9RTEMS_CPU=i386
10ifeq ($(RTEMS_CPU_MODEL),)
11RTEMS_CPU_MODEL=i386_fp
12endif
13
14# This is the actual bsp directory used during the build process.
15RTEMS_BSP_FAMILY=pc386
16
17#  This contains the compiler options necessary to select the CPU model
18#  and (hopefully) optimize for it.
19#
20# NOTE: CPU_CFLAGS is set by pc386 variants.
21# CPU_CFLAGS =
22
23# optimize flag: typically -O2
24CFLAGS_OPTIMIZE_V=-O4
25
26# Here is the rule to actually build a $(ARCH)/foo.exe
27# It also builds $(ARCH)/foo.sr and $(ARCH)/foo.nm
28# Usage ref: src/tests/sptest/sp1/Makefile
29
30#+--------------------------------------------------------------------------+
31#| Set the value of RELOCADDR to the address where you want your image to
32#| load. If you'll be using GRUB to load the images it will have to be >=
33#| 0x100000 (1024K). If you are using NetBoot to load the images it can be
34#| >= 0x10000 (64K) AND <= 0x97C00 (607K) OR >= 0x100000 (1024K). The memory
35#| top is of course another limit. Make sure there is enough space before the
36#| upper memory limits for the image and the memory allocated by it to fit.
37#| Make sure the value you choose is aligned to 4 bytes.
38#+--------------------------------------------------------------------------+
39  RELOCADDR=0x00100000
40
41START16FILE=$(PROJECT_RELEASE)/lib/start16$(LIB_VARIANT).bin
42START16ADDR=0x00097C00
43HEADERADDR=0x00097E00
44
45# The following are definitions of make-exe which will work using ld as
46# is currently required.  It is expected that as of gcc 2.8, the end user
47# will be able to override parts of the compilers specs and link using gcc.
48
49define make-exe
50        $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -Wl,-Ttext,$(RELOCADDR) \
51            -o $(basename $@).elf \
52            $(LINK_OBJS) $(LINK_LIBS)
53        $(OBJCOPY) -O elf32-i386 \
54            --remove-section=.rodata \
55            --remove-section=.comment \
56            --remove-section=.note \
57            --strip-unneeded $(basename $@).elf $@
58        $(OBJCOPY) -O binary $(basename $@).elf $(basename $@).bin
59        $(PROJECT_TOOLS)/bin2boot -v $(basename $@).bt $(HEADERADDR)\
60          $(START16FILE) $(START16ADDR) 0 $(basename $@).bin $(RELOCADDR) 0
61        $(NM) -g -n $(basename $@).elf > $(basename $@).num
62        $(SIZE) $(basename $@).elf
63#       test -d ${PROJECT_RELEASE}/BootImgs \
64#         || mkdir ${PROJECT_RELEASE}/BootImgs
65#       f=`basename $@ .exe`; \
66#        cp $(basename $@).bt \
67#           ${PROJECT_RELEASE}/BootImgs/$${f}$(LIB_VARIANT).bt \
68#       && chmod 755 \
69#         ${PROJECT_RELEASE}/BootImgs/$${f}$(LIB_VARIANT).bt
70#       $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -Wl,-Ttext,$(RELOCADDR) \
71#           -o $@ $(LINK_OBJS) $(LINK_LIBS)
72endef
73define make-cxx-exe
74        $(LINK.cc) $(AM_CFLAGS) $(AM_CXXFLAGS) $(AM_LDFLAGS) \
75           -Wl,-Ttext,$(RELOCADDR) -o $(basename $@).elf \
76            $(LINK_OBJS) $(LINK_LIBS)
77        $(OBJCOPY) -O elf32-i386 \
78            --remove-section=.rodata \
79            --remove-section=.comment \
80            --remove-section=.note \
81            --strip-unneeded $(basename $@).elf $@
82        $(OBJCOPY) -O binary $(basename $@).elf $(basename $@).bin
83        $(PROJECT_TOOLS)/bin2boot -v $(basename $@).bt $(HEADERADDR)\
84          $(START16FILE) $(START16ADDR) 0 $(basename $@).bin $(RELOCADDR) 0
85        $(NM) -g -n $(basename $@).elf > $(basename $@).num
86        $(SIZE) $(basename $@).elf
87endef
88
89# Miscellaneous additions go here
90
91# BSP-specific tools
92BIN2BOOT=$(PROJECT_TOOLS)/bin2boot
Note: See TracBrowser for help on using the repository browser.