parse ast's makefile

CXX = g++
CFLAGS = -fno-rtti -std=c++11

LLVM_SRC_PATH = /home/lyy/llvm
LLVM_BUILD_PATH =/home/lyy/build

LLVM_BIN_PATH = $(LLVM_BUILD_PATH)/bin
#LLVM_CONFIG_COMMAND=$(shell llvm-config --cxxflags --ldflags \
#                      --libs $(LLVM_LIBS))
LLVM_CPP_FLAGS=`llvm-config --cxxflags`
LLVM_CONFIG_COMMAND = `llvm-config  --libs --system-libs`
CLANG_BUILD_FLAGS = -I$(LLVM_SRC_PATH)/tools/clang/include \
                                      -I$(LLVM_BUILD_PATH)/tools/clang/include

CLANGLIBS = \
  -lclangFrontendTool -lclangFrontend -lclangDriver \
  -lclangSerialization -lclangCodeGen -lclangParse \
  -lclangSema -lclangStaticAnalyzerFrontend \
  -lclangStaticAnalyzerCheckers -lclangStaticAnalyzerCore \
  -lclangAnalysis -lclangARCMigrate -lclangRewrite \
  -lclangEdit -lclangAST -lclangLex -lclangBasic

all: rewritersample

rewritersample: rewritersample.cpp
    $(CXX) rewritersample.cpp $(CFLAGS) -o rewritersample \
              -L/home/lyy/build/lib $(LLVM_CPP_FLAGS) $(LLVM_CONFIG_COMMAND) \
        $(CLANG_BUILD_FLAGS)   $(CLANGLIBS)

clean:
    rm -rf *.o *.ll rewritersample






new________________________________________________________________________________________________________________

CXX = g++
CFLAGS = -fno-rtti -std=c++11 -O0 -g

LLVM_SRC_PATH = /home/lyy/llvm
LLVM_BUILD_PATH =/home/lyy/build

LLVM_BIN_PATH = $(LLVM_BUILD_PATH)/bin
LLVM_CXX_FLAGS=`llvm-config --cxxflags`
LLVM_LD_FLAGS = `llvm-config  --ldflags --libs --system-libs`
LLVM_INCLUDE =-I$(LLVM_SRC_PATH)/include \
        -I$(LLVM_BUILD_PATH)/include
CLANG_INCLUDE = -I$(LLVM_SRC_PATH)/tools/clang/include \
            -I$(LLVM_BUILD_PATH)/tools/clang/include

CLANGLIBS = \
    -Wl,--start-group \
     -lclangAST\
     -lclangAnalysis \
    -lclangBasic \
    -lclangDriver \
    -lclangEdit \
    -lclangFrontend \
    -lclangFrontendTool \
    -lclangLex \
    -lclangParse \
    -lclangSema \
    -lclangEdit \
    -lclangASTMatchers \
    -lclangRewrite \
    -lclangRewriteFrontend \
    -lclangStaticAnalyzerFrontend \
    -lclangStaticAnalyzerCheckers \
    -lclangStaticAnalyzerCore \
    -lclangSerialization \
    -lclangToolingCore \
    -lclangTooling \
    -lWl,--end-group

all: rewritersample

rewritersample: rewritersample.cpp
    $(CXX) $(CXXFLAGS) $(LLVM_CXXFLAGS)  $^ \
    $(CLANG_LIBS) $(LLVM_LDFLAGS) -o $@

clean:
    rm -rf *.o *.ll rewritersample

你可能感兴趣的:(parse ast's makefile)