Remove empty generated file upon gperf failure

Prior to this change the build could fail as follows, if gperf is not
available (or fails):

  - make(1) stops due to the gperf error, but an empty target file
    (cfns.h) is still created
  - the empty cfns.h is newer than the source cfns.gperf so it is not
    regenerated on subsequent builds
  - the gcc build fails (undefined reference to libc_name_p)

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
This commit is contained in:
Ed Maste 2014-12-15 14:25:42 +00:00
parent dd279f7aaa
commit a47f6b781a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=275804

View File

@ -30,7 +30,7 @@ LDADD= ${LIBBACKEND} ${LIBCPP} ${LIBDECNUMBER} ${LIBIBERTY}
# C++ parser
cfns.h: cfns.gperf
gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \
${.ALLSRC} > ${.TARGET}
${.ALLSRC} > ${.TARGET} || (rm -f ${.TARGET}; false)
CLEANFILES= cfns.h
DOBJS+= ${SRCS:N*.h:R:S/$/.o/g}