1 | # |
---|
2 | # Config file for the mrm332 BSP |
---|
3 | # |
---|
4 | # $Id$ |
---|
5 | # |
---|
6 | |
---|
7 | include $(RTEMS_ROOT)/make/custom/default.cfg |
---|
8 | |
---|
9 | RTEMS_CPU=m68k |
---|
10 | RTEMS_CPU_MODEL=m68332 |
---|
11 | |
---|
12 | # This is the actual bsp directory used during the build process. |
---|
13 | RTEMS_BSP_FAMILY=mrm332 |
---|
14 | |
---|
15 | # This contains the compiler options necessary to select the CPU model |
---|
16 | # and (hopefully) optimize for it. |
---|
17 | CPU_CFLAGS = -mcpu=cpu32 |
---|
18 | |
---|
19 | # optimize flag: typically -O2 |
---|
20 | CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer |
---|
21 | |
---|
22 | ifeq ($(MRM_IN_ROM),yes) |
---|
23 | # Build a rommable image - move the .data section after the .text section |
---|
24 | # in the image. |
---|
25 | CPU_CFLAGS += -qnolinkcmds -T $(exec_prefix)/mrm332/lib/linkcmds_ROM |
---|
26 | endif |
---|
27 | |
---|
28 | ifeq ($(MRM_IN_ROM),yes) |
---|
29 | define bsp-post-link |
---|
30 | $(OBJCOPY) --adjust-section-vma \ |
---|
31 | .data=`m68k-rtems-objdump --section-headers $(basename $@).pxe | \ |
---|
32 | awk 'function h2d(x) { x=toupper(x); digits=length(x); s=0 ; \ |
---|
33 | for (p=digits; p>0; p--) \ |
---|
34 | s += (16^(p-1)) * ( index("0123456789ABCDEF",\ |
---|
35 | substr(x,1+digits-p,1)) -1 );\ |
---|
36 | return s } ;\ |
---|
37 | /\.text/ { base = $$4 ; size = $$3 };\ |
---|
38 | END { printf("0x%x", h2d(base) + h2d(size)) }'\ |
---|
39 | ` $(basename $@).pxe $(basename $@).exe |
---|
40 | $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec |
---|
41 | sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \ |
---|
42 | $(PACKHEX) > $(basename $@)$(DOWNEXT) |
---|
43 | $(NM) -g -n $(basename $@).pxe > $(basename $@).pnum |
---|
44 | rm -f $(basename $@).srec $(basename $@).srec |
---|
45 | $(default-bsp-post-link) |
---|
46 | endef |
---|
47 | else |
---|
48 | define bsp-post-link |
---|
49 | $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec |
---|
50 | sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \ |
---|
51 | $(PACKHEX) > $(basename $@)$(DOWNEXT) |
---|
52 | rm -f $(basename $@).srec |
---|
53 | $(default-bsp-post-link) |
---|
54 | endef |
---|
55 | endif |
---|