From 11a6b764b085f28eb76b0ae8e993215cf3316d50 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Wed, 11 Jul 2012 13:10:46 +0200 Subject: [PATCH] Update Makefiles and README to use the default LLVM installation i.e. try to use llvm-config command. One can still override the path to this command in Makefile.config. --- Makefile | 14 +++++++++++--- Readme.txt | 10 ++++++++-- src/Makefile | 6 ++++-- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 9f9a321..6ad68ff 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,31 @@ -include config.local +ifneq ($(wildcard llvm/_build),) # Use our version of clang (even without installing) LLVM_BIN= $(CURDIR)/_install/bin LLVM_CONFIG := $(LLVM_BIN)/llvm-config export LLVM_CONFIG +compile_llvm_target = _install/lib/libclang.so +else +compile_llvm_target = skip_llvm +endif all: llvm src examples -.PHONY: llvm src examples +.PHONY: llvm src examples skip_llvm -llvm: _install/lib/libclang.so +llvm: $(compile_llvm_target) _install/lib/libclang.so: $(MAKE) -C llvm/_build install +skip_llvm: + @echo "LLVM compilation skipped" + src: llvm $(MAKE) -C src examples: src - $(MAKE) -C examples \ No newline at end of file + $(MAKE) -C examples diff --git a/Readme.txt b/Readme.txt index dd03b05..3d69f25 100644 --- a/Readme.txt +++ b/Readme.txt @@ -1,9 +1,15 @@ Thank you for downloading Boost Statechart viewer. -Source files are located in the directory src. For compilation create file Makefile.config in this directory and add there one line: +Source files are located in the directory src. To compile them, simpy +type + + make + +If you want to use different clang/llvm version, create a file called +Makefile.config in this directory and add there one line: LLVM_CONFIG := where you have your llvm bin files/llvm-config -This is necessary for compilation of the program. Compiler needs to be able to find LLVM and Clang header files. And now you can go to directory src and compile the whole application. +This program was tested with LLVM/Clang 2.8. Enjoy using it. diff --git a/src/Makefile b/src/Makefile index 42b4114..0c8f736 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,7 @@ -include ../Makefile.config - +-include ../Makefile.config + +LLVM_CONFIG ?= llvm-config + LLVM_FLAGS := $(shell $(LLVM_CONFIG) --cxxflags --ldflags --libs jit core) visualizer: visualizer.cpp stringoper.h iooper.h -- 2.39.2