-
Notifications
You must be signed in to change notification settings - Fork 3
/
makedefs.mk
40 lines (35 loc) · 954 Bytes
/
makedefs.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#******************************************************************************
#
# makedefs - Definitions common to all makefiles.
#
#******************************************************************************
#
# Include the tool configuration.
#
# include ToolConfig.mk
#
# The rule for building the object file from each C source file.
#
${LIBS}/%.o: %.c
echo ${CC} ${CFLAGS} -o ${@} ${<}
@${CC} ${CFLAGS} -o ${@} ${<}
#
# The rule for building the object file from each assembly source file.
#
${LIBS}/%.o: %.S
echo ${AS} ${AFLAGS} -o ${@} -c ${<}
@${AS} ${AFLAGS} -o ${@} -c ${<}
#
# The rule for creating an object library.
#
${LIBS}/%.a:
echo ${AR} -cr ${@} ${^}
@${AR} -cr ${@} ${^}
#
# The rule for linking the application.
#
%.axf:
${LD} -T ${SCATTERgcc_${notdir ${@:.axf=}}} \
--entry ${ENTRY_${notdir ${@:.axf=}}} \
${LDFLAGS} -o ${@} $(filter %.o %.a, ${^})
@${OBJCOPY} -O binary ${@} ${@:.axf=.bin}