1 #******************************************************************************
3 # makedefs - Definitions common to all makefiles.
5 # Copyright (c) 2005,2006 Luminary Micro, Inc. All rights reserved.
7 # Software License Agreement
9 # Luminary Micro, Inc. (LMI) is supplying this software for use solely and
10 # exclusively on LMI's Stellaris Family of microcontroller products.
12 # The software is owned by LMI and/or its suppliers, and is protected under
13 # applicable copyright laws. All rights are reserved. Any use in violation
14 # of the foregoing restrictions may subject the user to criminal sanctions
15 # under applicable laws, as well as to civil liability for the breach of the
16 # terms and conditions of this license.
18 # THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
19 # OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
20 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
21 # LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
22 # CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
24 #******************************************************************************
26 #******************************************************************************
28 # The compiler to be used.
30 #******************************************************************************
35 #******************************************************************************
37 # The debugger to be used.
39 #******************************************************************************
44 #******************************************************************************
46 # Definitions for using GCC.
48 #******************************************************************************
49 ifeq (${COMPILER}, gcc)
52 # The command for calling the compiler.
54 CC=arm-stellaris-eabi-gcc
57 # The flags passed to the assembler.
64 # The flags passed to the compiler.
72 # The command for calling the library archiver.
74 AR=arm-stellaris-eabi-ar
77 # The command for calling the linker.
79 LD=arm-stellaris-eabi-ld
82 # The flags passed to the linker.
84 LDFLAGS= -Map gcc/out.map
87 # Get the location of libgcc.a from the GCC front-end.
89 LIBGCC=${shell ${CC} -mthumb -march=armv6t2 -print-libgcc-file-name}
92 # Get the location of libc.a from the GCC front-end.
94 LIBC=${shell ${CC} -mthumb -march=armv6t2 -print-file-name=libc.a}
97 # The command for extracting images from the linked executables.
99 OBJCOPY=arm-stellaris-eabi-objcopy
103 #******************************************************************************
105 # Tell the compiler to include debugging information if the DEBUG environment
108 #******************************************************************************
113 #******************************************************************************
115 # The rule for building the object file from each C source file.
117 #******************************************************************************
119 @if [ 'x${VERBOSE}' = x ]; \
123 echo ${CC} ${CFLAGS} -D${COMPILER} -o ${@} -c ${<}; \
125 @${CC} ${CFLAGS} -D${COMPILER} -o ${@} -c ${<}
126 ifeq (${COMPILER}, rvds)
127 @mv -f ${notdir ${@:.o=.d}} ${COMPILER}
130 #******************************************************************************
132 # The rule for building the object file from each assembly source file.
134 #******************************************************************************
136 @if [ 'x${VERBOSE}' = x ]; \
140 echo ${CC} ${AFLAGS} -D${COMPILER} -o ${@} -c ${<}; \
142 ifeq (${COMPILER}, rvds)
143 @${CC} ${AFLAGS} -D${COMPILER} -E ${<} > ${@:.o=_.S}
144 @${CC} ${AFLAGS} -o ${@} -c ${@:.o=_.S}
146 @${CC} ${AFLAGS} -D${COMPILER} --md -E ${<}
147 @sed 's,<stdout>,${@},g' ${notdir ${<:.S=.d}} > ${@:.o=.d}
148 @rm ${notdir ${<:.S=.d}}
150 ifeq (${COMPILER}, gcc)
151 @${CC} ${AFLAGS} -D${COMPILER} -o ${@} -c ${<}
154 #******************************************************************************
156 # The rule for creating an object library.
158 #******************************************************************************
160 @if [ 'x${VERBOSE}' = x ]; \
164 echo ${AR} -cr ${@} ${^}; \
168 #******************************************************************************
170 # The rule for linking the application.
172 #******************************************************************************
174 @if [ 'x${VERBOSE}' = x ]; \
178 ifeq (${COMPILER}, gcc)
179 @if [ 'x${VERBOSE}' != x ]; \
181 echo ${LD} -T ${SCATTER_${notdir ${@:.axf=}}} \
182 --entry ${ENTRY_${notdir ${@:.axf=}}} \
183 ${LDFLAGSgcc_${notdir ${@:.axf=}}} \
184 ${LDFLAGS} -o ${@} ${^} \
185 '${LIBC}' '${LIBGCC}'; \
187 @${LD} -T ${SCATTER_${notdir ${@:.axf=}}} \
188 --entry ${ENTRY_${notdir ${@:.axf=}}} \
189 ${LDFLAGSgcc_${notdir ${@:.axf=}}} \
190 ${LDFLAGS} -o ${@} ${^} \
191 '${LIBC}' '${LIBGCC}'
192 @${OBJCOPY} -O binary ${@} ${@:.axf=.bin}