Last active
July 26, 2016 07:45
-
-
Save tforgione/88c1d2d487fbc83684a66029bcc6308e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "cling/Interpreter/Interpreter.h" | |
int main(int argc, char** argv) { | |
const char* LLVMRESDIR = "/usr/local/"; //path to llvm resource directory | |
cling::Interpreter interp(argc, argv, LLVMRESDIR); | |
interp.declare("int p=0;"); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SOURCES = main.cpp | |
OBJECTS = $(SOURCES:.cpp=.o) | |
TARGET = main | |
LIBS = -L/opt/cling/lib \ | |
$(shell llvm-config --cxxflags --ldflags --libs all) \ | |
-lclingInterpreter -lclingUtils -lclangFrontend \ | |
-lclangSerialization -lclangParse -lclangSema -lclangAnalysis -lclangEdit \ | |
-lclangLex -lclangDriver -lclangCodeGen -lclangBasic -lclangAST \ | |
-lz -pthread -ldl -ltinfo | |
INCLUDES = -I/opt/cling/include/ | |
%.o: %.cpp | |
$(CXX) -std=c++14 -o $@ -c $< -Wall $(INCLUDES) | |
all: $(OBJECTS) | |
$(CXX) -std=c++14 -o $(TARGET) $(OBJECTS) $(LIBS) -Wall $(INCLUDES) | |
x: all | |
./$(TARGET) | |
clean: | |
rm -rf $(OBJECTS) | |
superclean: clean | |
rm -rf $(TARGET) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment