1 | # |
---|
2 | # Config file for the PC 386 BSP |
---|
3 | # |
---|
4 | # $Id$ |
---|
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 -O2 |
---|
24 | CFLAGS_OPTIMIZE_V = -O2 -g |
---|
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 | |
---|
41 | START16FILE=$(PROJECT_RELEASE)/lib/start16$(LIB_VARIANT).bin |
---|
42 | START16ADDR=0x00097C00 |
---|
43 | HEADERADDR=0x00097E00 |
---|
44 | |
---|
45 | # The following are definitions of make-exe which will work using ld as |
---|
46 | # is currently required. |
---|
47 | |
---|
48 | define make-exe |
---|
49 | $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -Wl,-Ttext,$(RELOCADDR) \ |
---|
50 | -o $(basename $@).nxe \ |
---|
51 | $(LINK_OBJS) $(LINK_LIBS) |
---|
52 | $(OBJCOPY) -O elf32-i386 \ |
---|
53 | --remove-section=.rodata \ |
---|
54 | --remove-section=.comment \ |
---|
55 | --remove-section=.note \ |
---|
56 | --strip-unneeded $(basename $@).nxe $@ |
---|
57 | $(OBJCOPY) -O binary $(basename $@).nxe $(basename $@).bin |
---|
58 | $(PROJECT_TOOLS)/bin2boot -v $(basename $@).bt $(HEADERADDR)\ |
---|
59 | $(START16FILE) $(START16ADDR) 0 $(basename $@).bin $(RELOCADDR) 0 |
---|
60 | $(NM) -g -n $(basename $@).nxe > $(basename $@).num |
---|
61 | $(SIZE) $(basename $@).nxe |
---|
62 | # test -d ${PROJECT_RELEASE}/BootImgs \ |
---|
63 | # || mkdir ${PROJECT_RELEASE}/BootImgs |
---|
64 | # f=`basename $@ .exe`; \ |
---|
65 | # cp $(basename $@).bt \ |
---|
66 | # ${PROJECT_RELEASE}/BootImgs/$${f}$(LIB_VARIANT).bt \ |
---|
67 | # && chmod 755 \ |
---|
68 | # ${PROJECT_RELEASE}/BootImgs/$${f}$(LIB_VARIANT).bt |
---|
69 | # $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -Wl,-Ttext,$(RELOCADDR) \ |
---|
70 | # -o $@ $(LINK_OBJS) $(LINK_LIBS) |
---|
71 | endef |
---|
72 | define make-cxx-exe |
---|
73 | $(LINK.cc) $(AM_CFLAGS) $(AM_CXXFLAGS) $(AM_LDFLAGS) \ |
---|
74 | -Wl,-Ttext,$(RELOCADDR) -o $(basename $@).nxe \ |
---|
75 | $(LINK_OBJS) $(LINK_LIBS) |
---|
76 | $(OBJCOPY) -O elf32-i386 \ |
---|
77 | --remove-section=.rodata \ |
---|
78 | --remove-section=.comment \ |
---|
79 | --remove-section=.note \ |
---|
80 | --strip-unneeded $(basename $@).nxe $@ |
---|
81 | $(OBJCOPY) -O binary $(basename $@).nxe $(basename $@).bin |
---|
82 | $(PROJECT_TOOLS)/bin2boot -v $(basename $@).bt $(HEADERADDR)\ |
---|
83 | $(START16FILE) $(START16ADDR) 0 $(basename $@).bin $(RELOCADDR) 0 |
---|
84 | $(NM) -g -n $(basename $@).nxe > $(basename $@).num |
---|
85 | $(SIZE) $(basename $@).nxe |
---|
86 | endef |
---|
87 | |
---|
88 | # Miscellaneous additions go here |
---|
89 | |
---|
90 | # BSP-specific tools |
---|
91 | BIN2BOOT=$(PROJECT_TOOLS)/bin2boot |
---|