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 = -mcpu32 |
---|
18 | |
---|
19 | # optimize flag: typically -O2 |
---|
20 | CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer |
---|
21 | |
---|
22 | # The following are definitions of make-exe which will work using ld as |
---|
23 | # is currently required. |
---|
24 | |
---|
25 | ifeq ($(MRM_IN_ROM),yes) |
---|
26 | # Build a rommable image - move the .data section after the .text section |
---|
27 | # in the image. |
---|
28 | CPU_CFLAGS += -qnolinkcmds -T $(exec_prefix)/mrm332/lib/linkcmds_ROM |
---|
29 | |
---|
30 | # This is a good way to get debug information. The output file is large |
---|
31 | # though and greatly slows the build process so only do this if needed. |
---|
32 | # $(OBJDUMP) -dxC $(basename $@).nxe > $(basename $@).dump |
---|
33 | |
---|
34 | define make-exe |
---|
35 | $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).pxe \ |
---|
36 | $(LINK_OBJS) $(LINK_LIBS) |
---|
37 | $(OBJCOPY) --adjust-section-vma \ |
---|
38 | .data=`m68k-rtems-objdump --section-headers $(basename $@).pxe | \ |
---|
39 | awk 'function h2d(x) { x=toupper(x); digits=length(x); s=0 ; \ |
---|
40 | for (p=digits; p>0; p--) \ |
---|
41 | s += (16^(p-1)) * ( index("0123456789ABCDEF",\ |
---|
42 | substr(x,1+digits-p,1)) -1 );\ |
---|
43 | return s } ;\ |
---|
44 | /\.text/ { base = $$4 ; size = $$3 };\ |
---|
45 | END { printf("0x%x", h2d(base) + h2d(size)) }'\ |
---|
46 | ` $(basename $@).pxe $(basename $@).nxe |
---|
47 | $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).srec |
---|
48 | sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \ |
---|
49 | $(PACKHEX) > $(basename $@).exe |
---|
50 | $(NM) -g -n $(basename $@).pxe > $(basename $@).pnum |
---|
51 | $(NM) -g -n $(basename $@).nxe > $(basename $@).num |
---|
52 | $(SIZE) $(basename $@).nxe |
---|
53 | endef |
---|
54 | else |
---|
55 | define make-exe |
---|
56 | $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).nxe \ |
---|
57 | $(LINK_OBJS) $(LINK_LIBS) |
---|
58 | $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).srec |
---|
59 | # m68k-rtems-objdump -dxC $(basename $@).nxe > $(basename $@).dump |
---|
60 | sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \ |
---|
61 | $(PACKHEX) > $(basename $@).exe |
---|
62 | $(NM) -g -n $(basename $@).nxe > $(basename $@).num |
---|
63 | $(SIZE) $(basename $@).nxe |
---|
64 | endef |
---|
65 | endif |
---|
66 | |
---|
67 | # Miscellaneous additions go here |
---|