1 | # |
---|
2 | # Config file for the PC 386 BSP |
---|
3 | # |
---|
4 | |
---|
5 | include $(RTEMS_ROOT)/make/custom/default.cfg |
---|
6 | |
---|
7 | RTEMS_CPU=i386 |
---|
8 | |
---|
9 | # This contains the compiler options necessary to select the CPU model |
---|
10 | # and (hopefully) optimize for it. |
---|
11 | # |
---|
12 | # NOTE: CPU_CFLAGS is set by pc386 variants. |
---|
13 | ifeq ($(CPU_CFLAGS),) |
---|
14 | CPU_CFLAGS = -mtune=i386 |
---|
15 | endif |
---|
16 | |
---|
17 | # optimize flag: typically -O2 |
---|
18 | CFLAGS_OPTIMIZE_V = -O2 -g |
---|
19 | # Per function sections disabled per https://devel.rtems.org/ticket/2638 |
---|
20 | CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections |
---|
21 | |
---|
22 | LDFLAGS = -Wl,--gc-sections |
---|
23 | |
---|
24 | # Here is the rule to actually build a $(ARCH)/foo$(EXEEXT) |
---|
25 | # It also builds $(ARCH)/foo.sr and $(ARCH)/foo.nm |
---|
26 | # Usage ref: src/tests/sptest/sp1/Makefile |
---|
27 | |
---|
28 | #+--------------------------------------------------------------------------+ |
---|
29 | #| Set the value of RELOCADDR to the address where you want your image to |
---|
30 | #| load. If you'll be using GRUB to load the images it will have to be >= |
---|
31 | #| 0x100000 (1024K). If you are using NetBoot to load the images it can be |
---|
32 | #| >= 0x10000 (64K) AND <= 0x97C00 (607K) OR >= 0x100000 (1024K). The memory |
---|
33 | #| top is of course another limit. Make sure there is enough space before the |
---|
34 | #| upper memory limits for the image and the memory allocated by it to fit. |
---|
35 | #| Make sure the value you choose is aligned to 4 bytes. |
---|
36 | #+--------------------------------------------------------------------------+ |
---|
37 | RELOCADDR=0x00100000 |
---|
38 | |
---|
39 | START16FILE=$(PROJECT_RELEASE)/lib/start16$(LIB_VARIANT).bin |
---|
40 | START16ADDR=0x00097C00 |
---|
41 | HEADERADDR=0x00097E00 |
---|
42 | |
---|
43 | LDFLAGS += -Wl,-Ttext,$(RELOCADDR) |
---|
44 | |
---|
45 | define bsp-post-link |
---|
46 | $(default-bsp-post-link) |
---|
47 | $(OBJCOPY) -O elf32-i386 \ |
---|
48 | --remove-section=.comment \ |
---|
49 | --remove-section=.note \ |
---|
50 | --strip-unneeded $(basename $@)$(EXEEXT) $(basename $@).nxe |
---|
51 | $(OBJCOPY) -O binary $(basename $@).nxe $(basename $@).bin |
---|
52 | $(PROJECT_TOOLS)/bin2boot -v $(basename $@)$(DOWNEXT) $(HEADERADDR)\ |
---|
53 | $(START16FILE) $(START16ADDR) 0 $(basename $@).bin $(RELOCADDR) 0 |
---|
54 | rm -f $(basename $@).nxe |
---|
55 | endef |
---|
56 | |
---|
57 | # BSP-specific tools |
---|
58 | BIN2BOOT=$(PROJECT_TOOLS)/bin2boot |
---|