Skip to content

Commit

Permalink
makefile updates
Browse files Browse the repository at this point in the history
uniform handling of size command
  • Loading branch information
pwittich committed May 10, 2019
1 parent edab2a7 commit 9cf3364
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
5 changes: 4 additions & 1 deletion makedefs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ ${COMPILER}${SUFFIX}/%.a:
@${AR} -cr ${@} ${^}

#
# The rule for linking the application.
# The rule for linking the application. Also includes a SZ command
#
${COMPILER}${SUFFIX}/%.axf:
@if [ 'x${SCATTERgcc_${notdir ${@:.axf=}}}' = x ]; \
Expand All @@ -234,18 +234,21 @@ ${COMPILER}${SUFFIX}/%.axf:
if [ 'x${VERBOSE}' = x ]; \
then \
echo " LD ${@} ${LNK_SCP}"; \
echo " SZ ${@}"; \
else \
echo ${LD} -T $${ldname} \
--entry ${ENTRY_${notdir ${@:.axf=}}} \
${LDFLAGSgcc_${notdir ${@:.axf=}}} \
${LDFLAGS} -o ${@} $(filter %.o %.a, ${^}) \
'${LIBM}' '${LIBC}' '${LIBGCC}'; \
echo ${SIZE} ${@} ; \
fi; \
${LD} -T $${ldname} \
--entry ${ENTRY_${notdir ${@:.axf=}}} \
${LDFLAGSgcc_${notdir ${@:.axf=}}} \
${LDFLAGS} -o ${@} $(filter %.o %.a, ${^}) \
'${LIBM}' '${LIBC}' '${LIBGCC}'
@${OBJCOPY} -O binary ${@} ${@:.axf=.bin}
@${SIZE} ${@}
endif

4 changes: 2 additions & 2 deletions projects/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ DIRS=blinky uart_echo project0 project2 #i2c-sensors

all:
@for d in ${DIRS}; do \
make -C $$d ;\
${MAKE} -s -C $$d ;\
done

clean:
@for d in ${DIRS}; do \
make -C $$d clean ;\
${MAKE} -s -C $$d clean ;\
done
3 changes: 0 additions & 3 deletions projects/project0/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ IPATH+=${ROOT}
#
all: ${COMPILER}
all: ${COMPILER}/project0.axf
all: size

#
# The rule to clean out all the build products.
Expand All @@ -70,8 +69,6 @@ ${COMPILER}:
@mkdir -p ${COMPILER}


size: ${COMPILER}/project0.axf
${SIZE} $<


#
Expand Down
4 changes: 0 additions & 4 deletions projects/project2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ IPATH+=${FREERTOS_PLUS_ROOT}/FreeRTOS-Plus-CLI
#
all: ${COMPILER}
all: ${COMPILER}/project2.axf
all: size

#
# The rule to clean out all the build products.
Expand All @@ -65,9 +64,6 @@ ${COMPILER}:
@mkdir -p ${COMPILER}


size: ${COMPILER}/project2.axf
${SIZE} $<

#
# Rules for building the project
#p
Expand Down

0 comments on commit 9cf3364

Please sign in to comment.