diff --git a/Makefile.inc1 b/Makefile.inc1 index 773aea0796cf..bba32772cc97 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -813,16 +813,6 @@ _worldtmp: .PHONY ${OBJTREE}${.CURDIR}/world32/${.CURDIR}/lib/libc/.depend.${f}.* .endif .endfor -# 20170724 remove stale lib/clang/libllvm/Options.inc file, of which there are -# two different versions after r308421, one for llvm-lib, one for llvm-dlltool -.for d in ${OBJTREE} ${WORLDTMP} -.for f in ${d}${.CURDIR}/lib/clang/libllvm/Options.inc -.if exists(${f}) || exists(${f}.d) - @echo Removing stale generated ${f} files - @rm -f ${f} ${f}.d -.endif -.endfor -.endfor .for _dir in \ lib lib/casper usr legacy/bin legacy/usr mkdir -p ${WORLDTMP}/${_dir} diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile index e02af194ac60..357758d90237 100644 --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -1302,6 +1302,16 @@ llvm-dlltool/Options.inc: ${LLVM_SRCS}/lib/ToolDrivers/llvm-dlltool/Options.td TGHDRS+= llvm-dlltool/Options.inc CFLAGS.DlltoolDriver.cpp+= -I${.OBJDIR}/llvm-dlltool +beforebuild: +# 20170724 remove stale Options.inc file, of which there are two different +# versions after r308421, one for llvm-lib, one for llvm-dlltool +.for f in Options.inc +.if exists(${f}) || exists(${f}.d) + @echo Removing stale generated ${f} files + @rm -f ${f} ${f}.d +.endif +.endfor + # Note: some rules are superfluous, not every combination is valid. .for arch in \ AArch64/AArch64 ARM/ARM Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86