source: umon/ports/beagleboneblack/Makefile @ 08a34d8

Last change on this file since 08a34d8 was 08a34d8, checked in by Ed Sutter <edsutterjr@…>, on Jun 29, 2015 at 10:23:41 PM

add support for RTEMS toolset, make this the default

  • Property mode set to 100644
File size: 4.4 KB
Line 
1###############################################################################
2#
3# Beaglebone Black makefile
4#
5#
6PLATFORM                = BEAGLEBONEBLACK
7TOPDIR                  = $(UMONTOP)
8TGTDIR                  = beagleboneblack
9CPUTYPE                 = arm
10FILETYPE                = elf
11TOOLSET                 = RTEMS
12
13ifeq ($(TOOLSET),RTEMS)
14#
15# Using tools built by RTEMS Source Builder:
16#
17ABIDIR          = $(HOME)/development/rtems/4.11/lib/gcc/arm-rtems4.11/4.9.2
18TOOL_PREFIX     = arm-rtems4.11
19else
20#
21# Using tools installed by "sudo apt-get install gcc-arm-none-eabi"...
22#
23ABIDIR          = /usr/lib/gcc/arm-none-eabi/4.8.2
24TOOL_PREFIX     = /usr/bin/arm-none-eabi
25endif
26
27LIBABIDIR       = -L $(ABIDIR)
28COMMON_AFLAGS   = -c -D PLATFORM_$(PLATFORM)=1 -D ASSEMBLY_ONLY
29CUSTOM_CFLAGS   = -mcpu=cortex-a8 -O2 -isystem $(ABIDIR)/include -Wno-char-subscripts
30
31
32###############################################################################
33#
34# Memory map configuration:
35# The following variables are used to establish the system's memory map.
36#
37BOOTROMBASE=0x402F0400
38BOOTROMLEN=0x00DA00
39BOOTRAMBASE=0x402FDE00
40BOOTRAMLEN=0x00DA00
41RAMTSTROMBASE=0x80100000
42RAMTSTROMLEN=0x100000
43ATAGSIZE=0x1000
44
45# These next two hard-coded values are used by the ramtst version of
46# uMon to allow it to know where these flash-based structures are located.
47MACADDRBASE=0x08000020
48ALTTFSDEVTBLBASE=0x08000040
49
50include $(TOPDIR)/make/common.make
51
52# Build each variable from a list of individual filenames...
53#
54LOCSSRC         = 
55CPUSSRC         = vectors_arm.S
56LOCCSRC         = cpuio.c etherdev.c
57COMCSRC         = arp.c cast.c cache.c chario.c cmdtbl.c \
58                          docmd.c dhcp_00.c dhcpboot.c dns.c edit.c env.c ethernet.c \
59                          flash.c gdb.c icmp.c if.c ledit_vt100.c monprof.c \
60                          fbi.c font.c mprintf.c memcmds.c malloc.c moncom.c memtrace.c \
61                          misccmds.c misc.c nand.c password.c redirect.c \
62                          reg_cache.c sbrk.c sd.c \
63                          start.c struct.c symtbl.c syslog.c tcpstuff.c tfs.c tfsapi.c \
64                          tfsclean1.c tfscli.c tfsloader.c tfslog.c tftp.c timestuff.c \
65                          tsi.c xmodem.c
66CPUCSRC         = ldatags.c except_arm.c misc_arm.c strace_arm.c
67IODEVSRC        = smsc911x.c uart16550.c fb_draw.c
68FLASHSRC        = s29gl512n_16x1.c
69
70
71include $(TOPDIR)/make/objects.make
72
73OBJS    =       $(LOCSOBJ) $(CPUSOBJ) $(LOCCOBJ) $(CPUCOBJ) $(COMCOBJ) \
74                        $(FLASHOBJ) $(IODEVOBJ)
75
76#########################################################################
77#
78# Targets...
79
80# boot:
81# The default target is "boot", a shortcut to $(BUILDDIR)/boot.$(FILETYPE).
82# This builds the bootflash image that can be used by 'newmon' to
83# load a new version onto an already running system.
84#
85boot:   $(BUILDDIR)/boot.$(FILETYPE)
86        @echo Boot version of uMon built under $(BUILDDIR) ...
87        @ls $(BUILDDIR)/boot*
88
89# ramtst:
90# A shortcut to $(BUILDDIR)/ramtst.$(FILETYPE).  This is a version of uMon
91# that resides strictly in RAM and is used for two main purposes:
92# 1. To test new monitor features prior to burning the boot flash.
93# 2. To be downloaded into the RAM space of a board that has no programmed
94#    boot flash.  This provides a running monitor that can then accept
95#    an incoming bootflash image using 'newmon'.
96#
97ramtst: $(BUILDDIR)/ramtst.$(FILETYPE)
98        @echo Ram-resident test version of uMon built under $(BUILDDIR) ...
99        @ls $(BUILDDIR)/ramtst*
100
101$(BUILDDIR)/boot.$(FILETYPE): $(BUILDDIR) $(OBJS) libz.a \
102                libg.a Makefile
103        $(CC) $(ASMFLAGS) -o rom_reset.o rom_reset.S
104        $(MAKE_MONBUILT)
105        sed -e s/ROMBASE/$(BOOTROMBASE)/ -e s/ROMLEN/$(BOOTROMLEN)/ \
106                -e s/DRAMBASE/$(BOOTRAMBASE)/ -e s/DRAMLEN/$(BOOTRAMLEN)/ -e s/ATAGSIZE/$(ATAGSIZE)/ \
107                $(PLATFORM)_$(@F:.$(FILETYPE)=.ldt) > $(PLATFORM)_$(@F:.$(FILETYPE)=.ld)
108        $(LINK) -e coldstart $(OBJS) monbuilt.o libz.a \
109                libg.a $(LIBABIDIR) $(LIBGCC)
110        $(MAKE_BINARY)
111        $(MAKE_GNUSYMS)
112
113$(BUILDDIR)/ramtst.$(FILETYPE): $(BUILDDIR) $(OBJS) libz.a \
114                libg.a Makefile
115        $(CC) $(ASMFLAGS) -o ram_reset.o ram_reset.S
116        $(MAKE_MONBUILT)
117        sed -e s/RAMTSTROMBASE/$(RAMTSTROMBASE)/ \
118                -e s/RAMTSTROMLEN/$(RAMTSTROMLEN)/ -e s/ATAGSIZE/$(ATAGSIZE)/ \
119                -e s/MACADDRBASE/$(MACADDRBASE)/ -e s/ALTTFSDEVTBLBASE/$(ALTTFSDEVTBLBASE)/ \
120                $(PLATFORM)_$(@F:.$(FILETYPE)=.ldt) > $(PLATFORM)_$(@F:.$(FILETYPE)=.ld)
121
122        $(LINK) -e coldstart $(OBJS) monbuilt.o libz.a libg.a $(LIBGCC)
123        $(MAKE_BINARY)
124        $(MAKE_GNUSYMS)
125
126include $(TOPDIR)/make/rules.make
127
128
129#########################################################################
130#
131# Miscellaneous...
132cscope_local:
133        ls rom_reset.S ram_reset.S >cscope.files
134        ls $(FLASHDIR)/s29gl512n_16x1.c >>cscope.files
135        ls $(FLASHDIR)/s29gl512n_16x1.h >>cscope.files
136
137help_local:
138
139varcheck:
Note: See TracBrowser for help on using the repository browser.