Use shell's version of if to check if the firmware really exists in the

current directory to allow user rules to create the firmware (e.g. from a
uuencoded blob).  make's version of if is evaluated too early to catch this.

Found-by:	gallatin
This commit is contained in:
Max Laier 2006-02-18 01:38:44 +00:00
parent 08d7a88599
commit ff8e7669d6

View file

@ -137,13 +137,15 @@ CLEANFILES+= ${KMOD:S/$/.c/}
.for _firmw in ${FIRMWS}
${_firmw:C/\:.*$/.fwo/}: ${_firmw:C/\:.*$//}
@${ECHO} ${_firmw:C/\:.*$//} ${.ALLSRC:M*${_firmw:C/\:.*$//}}
.if !exists(${.CURDIR}/${_firmw:C/\:.*$//})
ln -s ${.ALLSRC:M*${_firmw:C/\:.*$//}} ${_firmw:C/\:.*$//}
${LD} -b binary ${LDFLAGS} -r -d -o ${.TARGET} ${_firmw:C/\:.*$//}
rm -f ${_firmw:C/\:.*$//}
.else
${LD} -b binary ${LDFLAGS} -r -d -o ${.TARGET} ${_firmw:C/\:.*$//}
.endif
@if [ -e ${.CURDIR}/${_firmw:C/\:.*$//} ]; then \
${LD} -b binary ${LDFLAGS} -r -d -o ${.TARGET} \
${_firmw:C/\:.*$//}; \
else \
ln -s ${.ALLSRC:M*${_firmw:C/\:.*$//}} ${_firmw:C/\:.*$//}; \
${LD} -b binary ${LDFLAGS} -r -d -o ${.TARGET} \
${_firmw:C/\:.*$//}; \
rm ${_firmw:C/\:.*$//}; \
fi
OBJS+= ${_firmw:C/\:.*$/.fwo/}
.endfor