From bc2abcfdef445d4884b996c8f4806d1931b9ab1c Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 17 Jun 2016 16:46:58 +0000 Subject: [PATCH] Add clang-format under WITH_CLANG_EXTRAS. Reviewed by: dim Approved by: re (gjb) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6856 --- lib/clang/Makefile | 4 ++- lib/clang/libclangformat/Makefile | 20 ++++++++++++ lib/clang/libclangformat/Makefile.depend | 15 +++++++++ lib/clang/libclangtoolingcore/Makefile | 19 +++++++++++ lib/clang/libclangtoolingcore/Makefile.depend | 15 +++++++++ targets/pseudo/clang/Makefile.depend | 1 + tools/build/mk/OptionalObsoleteFiles.inc | 1 + usr.bin/clang/Makefile | 1 + usr.bin/clang/clang-format/Makefile | 23 +++++++++++++ usr.bin/clang/clang-format/Makefile.depend | 32 +++++++++++++++++++ 10 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 lib/clang/libclangformat/Makefile create mode 100644 lib/clang/libclangformat/Makefile.depend create mode 100644 lib/clang/libclangtoolingcore/Makefile create mode 100644 lib/clang/libclangtoolingcore/Makefile.depend create mode 100644 usr.bin/clang/clang-format/Makefile create mode 100644 usr.bin/clang/clang-format/Makefile.depend diff --git a/lib/clang/Makefile b/lib/clang/Makefile index 71e52024da26..a42a6daa9994 100644 --- a/lib/clang/Makefile +++ b/lib/clang/Makefile @@ -90,7 +90,9 @@ SUBDIR= libclanganalysis \ libllvmx86utils .if ${MK_CLANG_EXTRAS} != "no" -SUBDIR+=libllvmdebuginfodwarf \ +SUBDIR+=libclangformat \ + libclangtoolingcore \ + libllvmdebuginfodwarf \ libllvmdebuginfopdb \ libllvmlibdriver \ libllvmlto \ diff --git a/lib/clang/libclangformat/Makefile b/lib/clang/libclangformat/Makefile new file mode 100644 index 000000000000..6d82a58093b1 --- /dev/null +++ b/lib/clang/libclangformat/Makefile @@ -0,0 +1,20 @@ +# $FreeBSD$ + +.include + +LIB= clangformat + +SRCDIR= tools/clang/lib/Format + +SRCS= BreakableToken.cpp \ + ContinuationIndenter.cpp \ + Format.cpp \ + FormatToken.cpp \ + TokenAnnotator.cpp \ + UnwrappedLineFormatter.cpp \ + UnwrappedLineParser.cpp \ + WhitespaceManager.cpp + +TGHDRS= DiagnosticCommonKinds + +.include "../clang.lib.mk" diff --git a/lib/clang/libclangformat/Makefile.depend b/lib/clang/libclangformat/Makefile.depend new file mode 100644 index 000000000000..3e7f3f5e7165 --- /dev/null +++ b/lib/clang/libclangformat/Makefile.depend @@ -0,0 +1,15 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/libc++ \ + lib/msun \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/lib/clang/libclangtoolingcore/Makefile b/lib/clang/libclangtoolingcore/Makefile new file mode 100644 index 000000000000..5f7b5e3b1cc6 --- /dev/null +++ b/lib/clang/libclangtoolingcore/Makefile @@ -0,0 +1,19 @@ +# $FreeBSD$ + +.include + +LIB= clangtoolingcore + +SRCDIR= tools/clang/lib/Tooling/Core +CFLAGS+= -I${LLVM_SRCS}/tools +SRCS= Lookup.cpp \ + Replacement.cpp + +TGHDRS= AttrList \ + Attrs \ + CommentCommandList \ + DeclNodes \ + DiagnosticCommonKinds \ + StmtNodes + +.include "../clang.lib.mk" diff --git a/lib/clang/libclangtoolingcore/Makefile.depend b/lib/clang/libclangtoolingcore/Makefile.depend new file mode 100644 index 000000000000..3e7f3f5e7165 --- /dev/null +++ b/lib/clang/libclangtoolingcore/Makefile.depend @@ -0,0 +1,15 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/libc++ \ + lib/msun \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/targets/pseudo/clang/Makefile.depend b/targets/pseudo/clang/Makefile.depend index 10ee9216af6e..daf81899f437 100644 --- a/targets/pseudo/clang/Makefile.depend +++ b/targets/pseudo/clang/Makefile.depend @@ -21,6 +21,7 @@ DIRDEPS+= \ .if ${MK_CLANG_EXTRAS} == "yes" DIRDEPS+= \ usr.bin/clang/bugpoint \ + usr.bin/clang/clang-format \ usr.bin/clang/llc \ usr.bin/clang/lli \ usr.bin/clang/llvm-ar \ diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 8a56228d7bc4..5bda73c9a201 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -1237,6 +1237,7 @@ OLD_FILES+=usr/share/man/man1/llvm-tblgen.1.gz .if ${MK_CLANG_EXTRAS} == no OLD_FILES+=usr/bin/bugpoint +OLD_FILES+=usr/bin/clang-format OLD_FILES+=usr/bin/llc OLD_FILES+=usr/bin/lli OLD_FILES+=usr/bin/llvm-ar diff --git a/usr.bin/clang/Makefile b/usr.bin/clang/Makefile index 692b6c806590..5d4c514baa8f 100644 --- a/usr.bin/clang/Makefile +++ b/usr.bin/clang/Makefile @@ -7,6 +7,7 @@ SUBDIR= clang clang-tblgen llvm-tblgen .if !defined(TOOLS_PREFIX) .if ${MK_CLANG_EXTRAS} != "no" SUBDIR+=bugpoint \ + clang-format \ llc \ lli \ llvm-ar \ diff --git a/usr.bin/clang/clang-format/Makefile b/usr.bin/clang/clang-format/Makefile new file mode 100644 index 000000000000..86e0d8d34bf1 --- /dev/null +++ b/usr.bin/clang/clang-format/Makefile @@ -0,0 +1,23 @@ +# $FreeBSD$ + +MAN= +.include + +PROG_CXX=clang-format + +SRCDIR= tools/clang/tools/clang-format +SRCS= ClangFormat.cpp + +LIBDEPS=clangrewrite \ + clanglex \ + clangformat \ + clangbasic \ + clangast \ + clangtoolingcore \ + llvmmc \ + llvmcore \ + llvmsupport \ + +TGHDRS= DiagnosticCommonKinds + +.include "../clang.prog.mk" diff --git a/usr.bin/clang/clang-format/Makefile.depend b/usr.bin/clang/clang-format/Makefile.depend new file mode 100644 index 000000000000..6c4e251a3e77 --- /dev/null +++ b/usr.bin/clang/clang-format/Makefile.depend @@ -0,0 +1,32 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/clang/libclangast \ + lib/clang/libclangbasic \ + lib/clang/libclangformat \ + lib/clang/libclanglex \ + lib/clang/libclangrewrite \ + lib/clang/libclangtoolingcore \ + lib/clang/libllvmcore \ + lib/clang/libllvmmc \ + lib/clang/libllvmsupport \ + lib/libc \ + lib/libc++ \ + lib/libcompiler_rt \ + lib/libthr \ + lib/msun \ + lib/ncurses/ncursesw \ + usr.bin/clang/clang-tblgen.host \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif