diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index dc282ac2a27..d3e4d7839cf 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -169,7 +169,9 @@ LDFLAGS+= -Wl,--version-script=${VERSION_MAP} .if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME) OBJS+= ${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/} -CLEANFILES+= ${OBJS} ${STATICOBJS} +BCOBJS+= ${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.bco/g} +LLOBJS+= ${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.llo/g} +CLEANFILES+= ${OBJS} ${BCOBJS} ${LLOBJS} ${STATICOBJS} .endif .if defined(LIB) && !empty(LIB) @@ -200,10 +202,6 @@ lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} .endif .if defined(LLVM_LINK) -BCOBJS= ${OBJS:.o=.bco} ${STATICOBJS:.o=.bco} -LLOBJS= ${OBJS:.o=.llo} ${STATICOBJS:.o=.llo} -CLEANFILES+= ${BCOBJS} ${LLOBJS} - lib${LIB_PRIVATE}${LIB}.bc: ${BCOBJS} ${LLVM_LINK} -o ${.TARGET} ${BCOBJS} diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 6c5b771176f..a3129a8cdca 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -87,6 +87,10 @@ PROGNAME?= ${PROG} OBJS+= ${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/g} +# LLVM bitcode / textual IR representations of the program +BCOBJS+=${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.bco/g} +LLOBJS+=${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.llo/g} + .if target(beforelinking) beforelinking: ${OBJS} ${PROG_FULL}: beforelinking @@ -117,7 +121,10 @@ SRCS= ${PROG}.c # - the name of the object gets put into the executable symbol table instead of # the name of a variable temporary object. # - it's useful to keep objects around for crunching. -OBJS+= ${PROG}.o +OBJS+= ${PROG}.o +BCOBJS+= ${PROG}.bc +LLOBJS+= ${PROG}.ll +CLEANFILES+= ${PROG}.o ${PROG}.bc ${PROG}.ll .if target(beforelinking) beforelinking: ${OBJS} @@ -148,10 +155,6 @@ ${PROGNAME}.debug: ${PROG_FULL} .endif .if defined(LLVM_LINK) -# LLVM bitcode / textual IR representations of the program -BCOBJS= ${OBJS:.o=.bco} -LLOBJS= ${OBJS:.o=.llo} - ${PROG_FULL}.bc: ${BCOBJS} ${LLVM_LINK} -o ${.TARGET} ${BCOBJS}