diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/clang/plugins/Makefile | 17 | ||||
-rwxr-xr-x | tools/clang/scripts/update.sh | 13 |
2 files changed, 21 insertions, 9 deletions
diff --git a/tools/clang/plugins/Makefile b/tools/clang/plugins/Makefile index 1aa1280..63cb9e6 100644 --- a/tools/clang/plugins/Makefile +++ b/tools/clang/plugins/Makefile @@ -2,19 +2,18 @@ # Makefile, you should execute the following commands to copy this directory # into a clang checkout: # -# cp -R <this directory> /path/to/clang/examples/chromeplugin -# cd /path/to/clang/examples/chromeplugin -# make -# -# You can't just link the directories, or specify clang as a full path for some -# reason. :( -# -# TODO(thakis): Improve the situation. +# cp -R <this directory> third_party/llvm-build/tools/clang/tools/chrome-plugin +# cd third_party/llvm-build/tools/clang/tools/chrome-plugin +# make CLANG_LEVEL := ../.. LIBRARYNAME = FindBadConstructs -LINK_LIBS_IN_SHARED = 1 +LINK_LIBS_IN_SHARED = 0 SHARED_LIBRARY = 1 include $(CLANG_LEVEL)/Makefile + +ifeq ($(OS),Darwin) + LDFLAGS=-Wl,-undefined,dynamic_lookup +endif diff --git a/tools/clang/scripts/update.sh b/tools/clang/scripts/update.sh index a47bedb..b8508ca 100755 --- a/tools/clang/scripts/update.sh +++ b/tools/clang/scripts/update.sh @@ -17,6 +17,8 @@ set -e # Echo all commands. set -x +# Build clang. + # Check out. svn co --force http://llvm.org/svn/llvm-project/llvm/trunk@$CLANG_REVISION $LLVM_DIR svn co --force http://llvm.org/svn/llvm-project/cfe/trunk@$CLANG_REVISION $CLANG_DIR @@ -31,3 +33,14 @@ cd $LLVM_DIR/../llvm-build # some grepping of /proc/cpuinfo on linux). make -j3 cd - + +# Build plugin. +# Copy it into the clang tree and use clang's build system to compile the +# plugin. +PLUGIN_SRC_DIR=$THIS_DIR/../plugins +PLUGIN_DST_DIR=$LLVM_DIR/../llvm-build/tools/clang/tools/chrome-plugin +rm -rf $PLUGIN_DST_DIR +cp -R $PLUGIN_SRC_DIR $PLUGIN_DST_DIR +cd $PLUGIN_DST_DIR +make -j3 +cd - |