Use $() instead of ${} in Makefiles, unless an explicit shell thing is dsired.

This commit is contained in:
Solomon Peachy 2013-08-26 09:16:37 -04:00
parent b2766f1e2e
commit 14a4f311a7
1 changed files with 20 additions and 20 deletions

View File

@ -58,52 +58,52 @@ $(MCU).ld: libs/$(MCU).ld.in inc/$(MCU)_hw.h
# Cleaning up..
clean:
@$(E) " CLEAN "
$(Q)${RM} -f $(SRC_OBJS) libs/*.a libs/*.o src/*.a $(MCU).ld $(IMAGE).bin $(IMAGE).elf
$(Q)$(RM) -f $(SRC_OBJS) libs/*.a libs/*.o src/*.a $(MCU).ld $(IMAGE).bin $(IMAGE).elf
distclean: clean
@$(E) " DISTCLEAN"
$(Q)${RM} -f $(DEPFILE) $(VERSION_H)
$(Q)${RM} -f $(LIBS_OBJS) $(LIBRARIES)
$(Q)${RM} -Rf $(TOOLCHAIN_SRC_DIR)/.build
$(Q)if [ -r ${TOOLCHAIN_SRC_DIR}/Makefile ] ; then \
cd ${TOOLCHAIN_SRC_DIR} ; \
$(Q)$(RM) -f $(DEPFILE) $(VERSION_H)
$(Q)$(RM) -f $(LIBS_OBJS) $(LIBRARIES)
$(Q)$(RM) -Rf $(TOOLCHAIN_SRC_DIR)/.build
$(Q)if [ -r $(TOOLCHAIN_SRC_DIR)/Makefile ] ; then \
cd $(TOOLCHAIN_SRC_DIR) ; \
MAKELEVEL='' make clean ; \
MAKELEVEL='' make distclean ; \
fi
@${RM} -f .toolchain-$(MCU_CORE)
$(Q)${RM} -f tags TAGS
@$(RM) -f .toolchain-$(MCU_CORE)
$(Q)$(RM) -f tags TAGS
# Toolchain
.toolchain: .toolchain-$(MCU_CORE)
.toolchain-$(MCU_CORE):
$(Q)if [ ! -x ${CROSS_COMPILE}gcc ] ; then \
$(Q)if [ ! -x $(CROSS_COMPILE)gcc ] ; then \
( unset AS LD LDD CC CPP AR NM STRIP STRIPTOOL OBJCOPY OBJDUMP RANLIB LD_LIBRARY_PATH MAKELEVEL ; \
if [ -r ${TOOLCHAIN_CONFIG} ] ; then \
cp ${TOOLCHAIN_CONFIG} ${TOOLCHAIN_SRC_DIR}/.config ; \
if [ -r $(TOOLCHAIN_CONFIG) ] ; then \
cp $(TOOLCHAIN_CONFIG) $(TOOLCHAIN_SRC_DIR)/.config ; \
else \
${ECHO} "${TOOLCHAIN_CONFIG} missing! Exiting." ; \
$(ECHO) "$(TOOLCHAIN_CONFIG) missing! Exiting." ; \
exit 1 ;\
fi ; \
${RM} -Rf ${TOOLCHAIN_SRC_DIR}/.build ; \
cd ${TOOLCHAIN_SRC_DIR} ; \
$(RM) -Rf $(TOOLCHAIN_SRC_DIR)/.build ; \
cd $(TOOLCHAIN_SRC_DIR) ; \
./configure --enable-local && \
make && \
./ct-ng build ; \
cd - ) ; \
fi
@if [ ! -x ${CROSS_COMPILE}gcc ] ; then \
${ECHO} "Toolchain Build failed!" ; \
@if [ ! -x $(CROSS_COMPILE)gcc ] ; then \
$(ECHO) "Toolchain Build failed!" ; \
exit 1 ;\
fi
@touch .toolchain-$(MCU_CORE)
toolclean:
$(Q)if [ -d ${CROSS_DIR} ] ; then \
chmod -R +w ${CROSS_DIR} ; \
${RM} -fr ${CROSS_DIR} ; \
$(Q)if [ -d $(CROSS_DIR) ] ; then \
chmod -R +w $(CROSS_DIR) ; \
$(RM) -fr $(CROSS_DIR) ; \
fi
@${RM} -f .toolchain-$(MCU_CORE)
@$(RM) -f .toolchain-$(MCU_CORE)
tags:
find . -path '*crosstool*' -prune \