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