2016-10-12 00:42:46 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
.sh:
|
|
|
|
cp -f ${.IMPSRC} ${.TARGET}
|
|
|
|
chmod a+x ${.TARGET}
|
|
|
|
|
|
|
|
.c:
|
2018-06-27 16:58:07 +00:00
|
|
|
${CC:N${CCACHE_BIN}} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
|
2016-10-12 00:42:46 +00:00
|
|
|
${CTFCONVERT_CMD}
|
|
|
|
|
|
|
|
.c.o:
|
|
|
|
${CC} ${STATIC_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
|
|
|
|
${CTFCONVERT_CMD}
|
|
|
|
|
2016-10-27 18:46:52 +00:00
|
|
|
.c.bco:
|
Add make rules to build LLVM IR from C/C++ sources.
As a foundation for future work with LLVM's Intermediate Representation (IR),
add new suffix rules that can be used to build .llo (text) or .bco (bitcode)
files from C or C++ sources. This compilation step uses the same CFLAGS, etc.,
as are used for building .o files, with the exception of optimization flags.
Many of the things we would like to do with IR (e.g., instrumentation) work
better with unoptimized code, so our approach is to build .c->.bco without
optimization and then apply the optimization in post-analysis,
post-instrumentation linking.
The overall result of these changes is:
* one can "make foo.llo" or "make foo.bco" wherever "make foo.o" was supported
* new make variables IR_CFLAGS and IR_CXXFLAGS are available to inspect the
flags that are used by Clang to generate the IR
These new rules are added unconditionally to our non-POSIX suffix rule set,
since we cannot inspect COMPILER_TYPE in sys.mk. Future changes that depend
on these rules (e.g., building IR versions of binaries from bsd.prog.mk)
should use COMPILER_TYPE to determine when we can expect IR rules to succeed.
Reviewed by: emaste, imp
Approved by: rwatson (mentor)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D4339
2016-10-20 15:14:21 +00:00
|
|
|
${CC} -emit-llvm ${IR_CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
|
|
|
|
|
2016-10-27 18:46:52 +00:00
|
|
|
.c.llo:
|
Add make rules to build LLVM IR from C/C++ sources.
As a foundation for future work with LLVM's Intermediate Representation (IR),
add new suffix rules that can be used to build .llo (text) or .bco (bitcode)
files from C or C++ sources. This compilation step uses the same CFLAGS, etc.,
as are used for building .o files, with the exception of optimization flags.
Many of the things we would like to do with IR (e.g., instrumentation) work
better with unoptimized code, so our approach is to build .c->.bco without
optimization and then apply the optimization in post-analysis,
post-instrumentation linking.
The overall result of these changes is:
* one can "make foo.llo" or "make foo.bco" wherever "make foo.o" was supported
* new make variables IR_CFLAGS and IR_CXXFLAGS are available to inspect the
flags that are used by Clang to generate the IR
These new rules are added unconditionally to our non-POSIX suffix rule set,
since we cannot inspect COMPILER_TYPE in sys.mk. Future changes that depend
on these rules (e.g., building IR versions of binaries from bsd.prog.mk)
should use COMPILER_TYPE to determine when we can expect IR rules to succeed.
Reviewed by: emaste, imp
Approved by: rwatson (mentor)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D4339
2016-10-20 15:14:21 +00:00
|
|
|
${CC} -emit-llvm ${IR_CFLAGS} -S ${.IMPSRC} -o ${.TARGET}
|
|
|
|
|
2016-10-12 00:42:46 +00:00
|
|
|
.cc .cpp .cxx .C:
|
2019-06-15 17:08:18 +00:00
|
|
|
${CXX:N${CCACHE_BIN}} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
|
2016-10-12 00:42:46 +00:00
|
|
|
|
|
|
|
.cc.o .cpp.o .cxx.o .C.o:
|
|
|
|
${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
|
|
|
|
|
2016-10-27 18:46:52 +00:00
|
|
|
.cc.bco .cpp.bco .cxx.bco .C.bco:
|
Add make rules to build LLVM IR from C/C++ sources.
As a foundation for future work with LLVM's Intermediate Representation (IR),
add new suffix rules that can be used to build .llo (text) or .bco (bitcode)
files from C or C++ sources. This compilation step uses the same CFLAGS, etc.,
as are used for building .o files, with the exception of optimization flags.
Many of the things we would like to do with IR (e.g., instrumentation) work
better with unoptimized code, so our approach is to build .c->.bco without
optimization and then apply the optimization in post-analysis,
post-instrumentation linking.
The overall result of these changes is:
* one can "make foo.llo" or "make foo.bco" wherever "make foo.o" was supported
* new make variables IR_CFLAGS and IR_CXXFLAGS are available to inspect the
flags that are used by Clang to generate the IR
These new rules are added unconditionally to our non-POSIX suffix rule set,
since we cannot inspect COMPILER_TYPE in sys.mk. Future changes that depend
on these rules (e.g., building IR versions of binaries from bsd.prog.mk)
should use COMPILER_TYPE to determine when we can expect IR rules to succeed.
Reviewed by: emaste, imp
Approved by: rwatson (mentor)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D4339
2016-10-20 15:14:21 +00:00
|
|
|
${CXX} -emit-llvm ${IR_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
|
|
|
|
|
2016-10-27 18:46:52 +00:00
|
|
|
.cc.llo .cpp.llo .cxx.llo .C.llo:
|
Add make rules to build LLVM IR from C/C++ sources.
As a foundation for future work with LLVM's Intermediate Representation (IR),
add new suffix rules that can be used to build .llo (text) or .bco (bitcode)
files from C or C++ sources. This compilation step uses the same CFLAGS, etc.,
as are used for building .o files, with the exception of optimization flags.
Many of the things we would like to do with IR (e.g., instrumentation) work
better with unoptimized code, so our approach is to build .c->.bco without
optimization and then apply the optimization in post-analysis,
post-instrumentation linking.
The overall result of these changes is:
* one can "make foo.llo" or "make foo.bco" wherever "make foo.o" was supported
* new make variables IR_CFLAGS and IR_CXXFLAGS are available to inspect the
flags that are used by Clang to generate the IR
These new rules are added unconditionally to our non-POSIX suffix rule set,
since we cannot inspect COMPILER_TYPE in sys.mk. Future changes that depend
on these rules (e.g., building IR versions of binaries from bsd.prog.mk)
should use COMPILER_TYPE to determine when we can expect IR rules to succeed.
Reviewed by: emaste, imp
Approved by: rwatson (mentor)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D4339
2016-10-20 15:14:21 +00:00
|
|
|
${CXX} -emit-llvm ${IR_CXXFLAGS} -S ${.IMPSRC} -o ${.TARGET}
|
|
|
|
|
2016-10-12 00:42:46 +00:00
|
|
|
.m.o:
|
|
|
|
${OBJC} ${OBJCFLAGS} -c ${.IMPSRC} -o ${.TARGET}
|
|
|
|
${CTFCONVERT_CMD}
|
|
|
|
|
|
|
|
.p.o:
|
|
|
|
${PC} ${PFLAGS} -c ${.IMPSRC} -o ${.TARGET}
|
|
|
|
${CTFCONVERT_CMD}
|
|
|
|
|
|
|
|
.e .r .F .f:
|
|
|
|
${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} \
|
|
|
|
-o ${.TARGET}
|
|
|
|
|
|
|
|
.e.o .r.o .F.o .f.o:
|
|
|
|
${FC} ${RFLAGS} ${EFLAGS} ${FFLAGS} -c ${.IMPSRC} -o ${.TARGET}
|
|
|
|
|
|
|
|
.S.o:
|
|
|
|
${CC:N${CCACHE_BIN}} ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
|
|
|
|
${CTFCONVERT_CMD}
|
|
|
|
|
|
|
|
.asm.o:
|
|
|
|
${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \
|
|
|
|
-o ${.TARGET}
|
|
|
|
${CTFCONVERT_CMD}
|
|
|
|
|
|
|
|
.s.o:
|
|
|
|
${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
|
|
|
|
${CTFCONVERT_CMD}
|
|
|
|
|
|
|
|
# XXX not -j safe
|
|
|
|
.y.o:
|
|
|
|
${YACC} ${YFLAGS} ${.IMPSRC}
|
|
|
|
${CC} ${CFLAGS} -c y.tab.c -o ${.TARGET}
|
|
|
|
rm -f y.tab.c
|
|
|
|
${CTFCONVERT_CMD}
|
|
|
|
|
|
|
|
.l.o:
|
|
|
|
${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c
|
|
|
|
${CC} ${CFLAGS} -c ${.PREFIX}.tmp.c -o ${.TARGET}
|
|
|
|
rm -f ${.PREFIX}.tmp.c
|
|
|
|
${CTFCONVERT_CMD}
|
|
|
|
|
|
|
|
# XXX not -j safe
|
|
|
|
.y.c:
|
|
|
|
${YACC} ${YFLAGS} ${.IMPSRC}
|
|
|
|
mv y.tab.c ${.TARGET}
|
|
|
|
|
|
|
|
.l.c:
|
|
|
|
${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.TARGET}
|
|
|
|
|
|
|
|
.s.out .c.out .o.out:
|
|
|
|
${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
|
|
|
|
${CTFCONVERT_CMD}
|
|
|
|
|
|
|
|
.f.out .F.out .r.out .e.out:
|
|
|
|
${FC} ${EFLAGS} ${RFLAGS} ${FFLAGS} ${LDFLAGS} ${.IMPSRC} \
|
|
|
|
${LDLIBS} -o ${.TARGET}
|
|
|
|
rm -f ${.PREFIX}.o
|
|
|
|
${CTFCONVERT_CMD}
|
|
|
|
|
|
|
|
# XXX not -j safe
|
|
|
|
.y.out:
|
|
|
|
${YACC} ${YFLAGS} ${.IMPSRC}
|
|
|
|
${CC} ${CFLAGS} ${LDFLAGS} y.tab.c ${LDLIBS} -ly -o ${.TARGET}
|
|
|
|
rm -f y.tab.c
|
|
|
|
${CTFCONVERT_CMD}
|
|
|
|
|
|
|
|
.l.out:
|
|
|
|
${LEX} -t ${LFLAGS} ${.IMPSRC} > ${.PREFIX}.tmp.c
|
|
|
|
${CC} ${CFLAGS} ${LDFLAGS} ${.PREFIX}.tmp.c ${LDLIBS} -ll -o ${.TARGET}
|
|
|
|
rm -f ${.PREFIX}.tmp.c
|
|
|
|
${CTFCONVERT_CMD}
|