#!/bin/sh
PREFIX=$HOME
-while [ $# -gt 0 ]; do
- case "$1" in
- --with-prefix=*)
- arg=`expr "x$1" : 'x[^=]*=\(.*\)'`
- PREFIX=$arg;;
- *)
- echo "Usage: ./clean-install [options]"
- echo " --with-prefix=/prefix/path Installs STP at the specified path"
- echo "configure failed"
- exit 1;;
- esac
-
- shift
-done
-
make configclean
-./scripts/configure --with-prefix=$PREFIX
+. scripts/configure
make clean
make install
# * LICENSE: Please view LICENSE file in the home dir of this Program
# ********************************************************************/
+-include $(TOP)/scripts/config.info
+
#OPTIMIZE = -g -pg # Debugging and gprof-style profiling
#OPTIMIZE = -g # Debugging
#OPTIMIZE = -O3 -fPIC # Maximum optimization
CFLAGS_BASE = $(OPTIMIZE)
# OPTION to compile CRYPTOMiniSAT version 2.x
-# CRYPTOMINISAT2 = true
-# CFLAGS_BASE = $(OPTIMIZE) -DCRYPTOMINISAT2
-# MTL = ../sat/cryptominisat2/mtl
-# SOLVER_INCLUDE = ../sat/cryptominisat2
+ifeq ($(SAT),cryptominisat2)
+ CRYPTOMINISAT2 = true
+ CFLAGS_BASE = $(OPTIMIZE) -DCRYPTOMINISAT2
+ MTL = $(TOP)/src/sat/cryptominisat2/mtl
+ SOLVER_INCLUDE = $(TOP)/src/sat/cryptominisat2
+endif
# OPTION to compile MiniSAT
-CORE = true
-CFLAGS_BASE = $(OPTIMIZE) -DCORE
-MTL = ../sat/mtl
-SOLVER_INCLUDE = ../sat/core
+ifeq ($(SAT),minisat)
+ CORE = true
+ CFLAGS_BASE = $(OPTIMIZE) -DCORE
+ MTL = $(TOP)/src/sat/mtl
+ SOLVER_INCLUDE = $(TOP)/src/sat/core
+endif
# OPTION to compile UNSOUND MiniSAT
-#UNSOUND = true
-#CFLAGS_BASE = $(OPTIMIZE) -DUNSOUND
-#MTL = ../sat/mtl
-#SOLVER_INCLUDE = ../sat/unsound
+ifeq ($(SAT),unsound)
+ UNSOUND = true
+ CFLAGS_BASE = $(OPTIMIZE) -DUNSOUND
+ MTL = $(TOP)/src/sat/mtl
+ SOLVER_INCLUDE = $(TOP)/src/sat/unsound
+endif
# OPTION to compile Simplifying MiniSAT
-# SIMP = true
-# CFLAGS_BASE = $(OPTIMIZE) -DSIMP
-# MTL = ../sat/mtl
-# SOLVER_INCLUDE = ../sat/simp
+ifeq ($(SAT),simp)
+ SIMP = true
+ CFLAGS_BASE = $(OPTIMIZE) -DSIMP
+ MTL = $(TOP)/src/sat/mtl
+ SOLVER_INCLUDE = $(TOP)/src/sat/simp
+endif
SHELL=/bin/bash
# scripts/Makefile.in. The version at the top level stp directory
# is automatically copied from there.
-include scripts/Makefile.common
--include scripts/config.info
+TOP=.
+include $(TOP)/scripts/Makefile.common
BIN_DIR=$(PREFIX)/bin
LIB_DIR=$(PREFIX)/lib
# LICENSE: Please view LICENSE file in the home dir of this Program
#********************************************************************
-# check for an option --with-prefix=/path/to/prefix and use that as the
-# prefix, otherwise use /usr/local
-PREFIX=/usr/local
+SAT=minisat
while [ $# -gt 0 ]; do
case "$1" in
arg=`expr "x$1" : 'x[^=]*=\(.*\)'`
CXX=$arg
echo "Using g++ instead of gcc";;
+ --with-minisat-core)
+ SAT=minisat;;
+ --with-minisat-unsound)
+ SAT=unsound;;
+ --with-minisat-simp)
+ SAT=simp;;
+ --with-cryptominisat2)
+ SAT=cryptominisat2;;
*)
- echo "Usage: configure [options]"
+ echo "Usage: $0 [options]"
echo " --with-prefix=/prefix/path Install STP at the specified path"
- echo "configure failed"
+ echo " --with-g++=/path/to/g++ Use g++ at the specified path"
+ echo " --with-minisat-core Use core MiniSAT solver (default)"
+ echo " --with-minisat-unsound Use unsound MiniSAT solver"
+ echo " --with-minisat-simp Use simplifying MiniSAT solver"
+ echo " --with-cryptominisat2 Use CRYPTOMiniSAT 2.x solver"
+ echo "$0 failed"
exit 1;;
esac
shift
done
+# check for an option --with-prefix=/path/to/prefix and use that as the
+# prefix, otherwise use /usr/local
+PREFIX=${PREFIX:-/usr/local}
echo "PREFIX=$PREFIX" > scripts/config.info
echo "Setting prefix to... $PREFIX"
export CXX="$CXX"
echo "Setting CXX to... $CXX"
fi
+echo "SAT=$SAT" >> scripts/config.info
+echo "Using SAT solver: $SAT"
if [ ! -d $PREFIX/include ]
then mkdir -p $PREFIX/include
-include ../../scripts/Makefile.common
+TOP = ../..
+include $(TOP)/scripts/Makefile.common
SRCS=$(wildcard *.cpp)
SRCS+=$(wildcard NodeFactory/*.cpp)
-include ../../scripts/Makefile.common
+TOP = ../..
+include $(TOP)/scripts/Makefile.common
SRCS = $(wildcard *.cpp)
OBJS = $(SRCS:.cpp=.o)
-include ../../scripts/Makefile.common
+TOP = ../..
+include $(TOP)/scripts/Makefile.common
SRCS = $(wildcard *.cpp)
OBJS = $(SRCS:.cpp=.o)
-include ../../scripts/Makefile.common
+TOP = ../..
+include $(TOP)/scripts/Makefile.common
SRCS = $(wildcard *.cpp)
OBJS = $(SRCS:.cpp=.o)
-include ../../scripts/Makefile.common
+TOP = ../..
+include $(TOP)/scripts/Makefile.common
SRCS = $(wildcard aig/*/*.c)
#SRCS += $(wildcard aig/cnf/*.c)
-include ../../../../scripts/Makefile.common
+TOP = ../../../..
+include $(TOP)/scripts/Makefile.common
SRCS = $(wildcard *.c)
OBJS = $(SRCS:.c=.o)
-include ../../scripts/Makefile.common
+TOP = ../..
+include $(TOP)/scripts/Makefile.common
SRCS = $(wildcard *.cpp)
OBJS = $(SRCS:.cpp=.o)
-include ../../scripts/Makefile.common
+TOP = ../..
+include $(TOP)/scripts/Makefile.common
SRCS=main.cpp versionString.cpp Globals.cpp
OBJS = $(SRCS:.cpp=.o)
-include ../../scripts/Makefile.common
+TOP = ../..
+include $(TOP)/scripts/Makefile.common
LEX=flex
YACC=bison -d -y --debug -v
-include ../../scripts/Makefile.common
+TOP = ../..
+include $(TOP)/scripts/Makefile.common
SRCS=$(wildcard *.cpp)
OBJS = $(SRCS:.cpp=.o)
-include ../../../scripts/Makefile.common
+TOP = ../../..
+include $(TOP)/scripts/Makefile.common
MTL = ../mtl
SOURCES = Solver.C
-include ../../../scripts/Makefile.common
+TOP = ../../..
+include $(TOP)/scripts/Makefile.common
MTL = mtl
MTRAND = MTRand
-include ../../../scripts/Makefile.common
+TOP = ../../..
+include $(TOP)/scripts/Makefile.common
MTL = mtl
MTRAND = MTRand
-include ../../../scripts/Makefile.common
+TOP = ../../..
+include $(TOP)/scripts/Makefile.common
MTL = ../mtl
SOURCES = SimpSolver.C ../core/Solver.C
-include ../../../scripts/Makefile.common
+TOP = ../../..
+include $(TOP)/scripts/Makefile.common
MTL = ../mtl
SOURCES = UnsoundSimpSolver.C ../core/Solver.C
-include ../../scripts/Makefile.common
+TOP = ../..
+include $(TOP)/scripts/Makefile.common
SRCS = $(wildcard *.cpp)
OBJS = $(SRCS:.cpp=.o)
-include ../../scripts/Makefile.common
+TOP = ../..
+include $(TOP)/scripts/Makefile.common
SRCS = $(wildcard *.cpp)
OBJS = $(SRCS:.cpp=.o)
# Tests that run under valgrind will return a non-zero error code on
# either leak, or use of unitialised values.
-include ../../scripts/Makefile.common
+TOP = ../..
+include $(TOP)/scripts/Makefile.common
CXXFLAGS= -DEXT_HASH_MAP $(CFLAGS) -I../../src/c_interface -L../../lib
LIBS= -lstp