Skip to content

Commit

Permalink
Makefile update, rewriting part no longer builds with recent LLVM
Browse files Browse the repository at this point in the history
  • Loading branch information
kalibera committed Apr 10, 2017
1 parent c265531 commit e2a4082
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@

# The support for rewriting using CLANG API no longer builds with LLVM
# because of incompatible changes in LLVM; it would have to be ported to
# newer versions if needed.

# The part that does just the analysis using LLVM bitcode is still working
# and on Ubuntu 16.04.2 only needs the LLVM installation that is part of Ubuntu

# ---------------------

HOST := $(shell hostname -s)

ifeq ($(HOST), prg)
#LLVM := /home/tomas/work/opt/clang+llvm-3.6.1-x86_64-linux-gnu
LLVM := /home/tomas/work/opt/clang+llvm-3.8.1-x86_64-linux-gnu-ubuntu-16.04
# Ubuntu 16.04.2
#LLVM := /usr
#CXX := g++-4.8
CXX := g++

Expand All @@ -18,7 +27,7 @@ else
# or provide these variables to make

ifeq ($(wildcard $(LLVM)),)
$(error Please customize your Makefile here. Please set the home directory for LLVM 3.6.1)
$(error Please customize your Makefile here. Please set the home directory for LLVM 3.8)
endif

CXX ?= g++
Expand All @@ -28,13 +37,14 @@ endif

LLVMC := $(LLVM)/bin/llvm-config

CPPFLAGS := $(shell $(LLVMC) --cppflags)
CXXFLAGS := $(shell $(LLVMC) --cxxflags) -O3 -g3 -MMD
CPPFLAGS := $(shell $(LLVMC) --cppflags) -I/usr/include/libcxxabi
CXXFLAGS := $(shell $(LLVMC) --cxxflags) -O3 -g3 -MMD -I/usr/include/libcxxabi -I/usr/include/llvm-3.8
#CXXFLAGS := $(shell $(LLVMC) --cxxflags) -O0 -g3 -MMD

# for GCC, which does not support this warning
CXXFLAGS := $(filter-out -Wcovered-switch-default, $(CXXFLAGS))

# clang libraries are only needed for the rewriting
CLANG_LIBS := \
-Wl,--start-group \
-lclangAST \
Expand All @@ -58,9 +68,10 @@ CLANG_LIBS := \
-lclangToolingCore \
-lclangTooling \
-Wl,--end-group

LDFLAGS := $(shell $(LLVMC) --ldflags)
LDLIBS := $(CLANG_LIBS) $(shell $(LLVMC) --libs --system-libs)
#LDLIBS := $(CLANG_LIBS) $(shell $(LLVMC) --libs --system-libs)
LDLIBS := $(shell $(LLVMC) --libs --system-libs)

LINK.o = $(LINK.cc) # link with C++ compiler by default

Expand All @@ -70,7 +81,10 @@ OBJECTS := $(SOURCES:.cpp=.o)

SOBJECTS := $(filter-out arewriter.o %sample.o %info.o, $(OBJECTS))

TOOLS := einfo tooling_sample arg_patterns_sample arewriter
TOOLS := einfo
# tooling_sample arg_patterns_sample arewriter
# do the rewriting
#TOOLS := einfo tooling_sample arg_patterns_sample arewriter

all: $(TOOLS)

Expand Down

0 comments on commit e2a4082

Please sign in to comment.