From a68ba36445c4a209dc5afc77ae3fe74ab34c9a2f Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Tue, 9 Oct 2012 02:11:26 -0700 Subject: [PATCH] Added install/uninstall to Makefile Signed-off-by: Leonardo de Moura --- Makefile.in | 29 +++++++++++++++++++++++++++++ README | 27 ++++++++++----------------- 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/Makefile.in b/Makefile.in index 89d272e2d..f3dcf7b70 100644 --- a/Makefile.in +++ b/Makefile.in @@ -19,6 +19,7 @@ LIBS=@LIBS@ ## -lrt is for timer_create and timer_settime LDFLAGS=@LDFLAGS@ -lpthread -fopenmp LDFLAGS_EXTRA= +PREFIX=@prefix@ ######################### Z3=z3 @@ -435,3 +436,31 @@ checkgmake: @ ./gmaketest --make=$(MAKE) || \ (echo "Z3 needs GNU-Make to be built"; exit 1) +################################ +# +# installation/uninstallation +# +################################ + +install: $(BIN_DIR)/$(Z3) $(BIN_DIR)/lib$(Z3).so $(BIN_DIR)/lib$(Z3).a + @mkdir -p $(PREFIX)/bin + @mkdir -p $(PREFIX)/lib + @mkdir -p $(PREFIX)/include + @cp $(BIN_DIR)/$(Z3) $(PREFIX)/bin + @cp $(BIN_DIR)/lib$(Z3).so $(PREFIX)/lib + @cp $(BIN_DIR)/lib$(Z3).a $(PREFIX)/lib + @cp lib/z3_api.h $(PREFIX)/include + @cp lib/z3.h $(PREFIX)/include + @cp lib/z3_v1.h $(PREFIX)/include + @cp lib/z3_macros.h $(PREFIX)/include + @cp c++/z3++.h $(PREFIX)/include + +uninstall: + @rm -f $(PREFIX)/bin/$(Z3) + @rm -f $(PREFIX)/lib/lib$(Z3).so + @rm -f $(PREFIX)/lib/lib$(Z3).a + @rm -f $(PREFIX)/include/z3_api.h + @rm -f $(PREFIX)/include/z3.h + @rm -f $(PREFIX)/include/z3_v1.h + @rm -f $(PREFIX)/include/z3_macros.h + @rm -f $(PREFIX)/include/z3++.h diff --git a/README b/README index 14cf735c5..696f8e0e8 100644 --- a/README +++ b/README @@ -19,33 +19,26 @@ Z3 can be built using Visual Studio Command Prompt, Visual Studio and make/gcc. msbuild z3-prover.sln All components will be located at /debug -1) Building Z3 using g++/make +2) Building Z3 using g++/make Your machine must also have the following commands to be able to build Z3: autoconf, sed, awk, dos2unix commands - -- Open a shell -- For building the z3 executable, execute - autoconf ./configure make + sudo make install -The z3 executable will be located at bin/external/ +It will install z3 executable at /usr/local/bin, libraries at /usr/local/lib, and include files at /usr/local/include. +Use the following commands to install in a different prefix (e.g., /usr). -- If you want a static library for Z3 + autoconf + ./configure --prefix=/usr + make + sudo make install - make a +To uninstall z3, use -- If you also want the z3 shared library, execute - - make so - - for libz3.so (on Linux) - - make dylib - - for libz3.dylib (on OSX) + sudo make uninstall Remark: the Z3 makefile imports the source file list from Visual Studio project files. To add new source files to the Z3 core, you must include them at: lib/lib.vcxproj