diff options
author | mlaier <mlaier@FreeBSD.org> | 2006-02-18 01:38:44 +0000 |
---|---|---|
committer | mlaier <mlaier@FreeBSD.org> | 2006-02-18 01:38:44 +0000 |
commit | 401be10f03a0b999eee8e646403af6b3d38b9c5b (patch) | |
tree | 034915efc7f7ad7a80ee298925d3ed49ce858a1e /sys/conf/kmod.mk | |
parent | ab027aeccd7d4839a82b5f1b0a372afe294c95e0 (diff) | |
download | FreeBSD-src-401be10f03a0b999eee8e646403af6b3d38b9c5b.zip FreeBSD-src-401be10f03a0b999eee8e646403af6b3d38b9c5b.tar.gz |
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
Diffstat (limited to 'sys/conf/kmod.mk')
-rw-r--r-- | sys/conf/kmod.mk | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 86eb0f8..67dcba4 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -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 |