Skip to content

Commit

Permalink
initial release of CADET2
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusRabe committed Mar 7, 2017
0 parents commit c8cfbc1
Show file tree
Hide file tree
Showing 232 changed files with 313,470 additions and 0 deletions.
10 changes: 10 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Copyright (c) 2015-2017, Markus N. Rabe, 2015 Leander Tentrup
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the University of California, Berkeley, nor the name of the California Institute of Technology, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 changes: 31 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
TARGET = cadet
SRCDIR = ./src
LIBS = -lm -lstdc++
CC = cc
CFLAGS += -std=c11 -Wall -Wextra -pedantic
CPPFLAGS += -std=c++11 -Wall -Wextra -pedantic

.PHONY: default clean test

default: $(TARGET)

OBJECTS = $(patsubst %.c, %.o, $(wildcard $(SRCDIR)/*.c))
HEADERS = $(wildcard $(SRCDIR)/*.h)

%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -c $< -o $@

.PRECIOUS: $(TARGET) $(OBJECTS)

$(TARGET): $(OBJECTS)
$(CC) $(CFLAGS) $(OBJECTS) $(LIBS) -o $@

test: default
python scripts/tester.py --test

profile: default
$(CC) $(CFLAGS) -pg $(OBJECTS) $(LIBS) -o $(TARGET)

clean:
cd $(SRCDIR) && rm -f *.o *.h.gch *.plist
-rm -f $(TARGET)
59 changes: 59 additions & 0 deletions configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env bash

# clean up old artifacts (if any)
if [ -e "Makefile" ]; then
echo "Clean old artifacts"
make clean
fi

prefix=/usr/local
debugsym=false
satsolver="picosat"

for arg in "$@"; do
case "$arg" in
--prefix=*)
prefix=`echo $arg | sed 's/--prefix=//'`
;;

--enable-debug)
debugsym=true;;
--disable-debug)
debugsym=false;;

--satsolver=*)
satsolver=`echo $arg | sed 's/--satsolver=//'`
;;

--help)
echo 'usage: ./configure [options]'
echo 'options:'
echo ' --prefix=<path>: installation prefix'
echo ' --enable-debug: include debug symbols'
echo ' --disable-debug: do not include debug symbols (default)'
echo ' --satsolver=<value>: either picosat or minisat'
echo 'all invalid options are silently ignored'
exit 0
;;
esac
done

echo 'generating makefile ...'
echo "PREFIX = $prefix" > Makefile

if $debugsym; then
echo 'CFLAGS = -g -DDEBUG' >> Makefile
echo 'CPPFLAGS = -g -DDEBUG' >> Makefile
else
echo 'CFLAGS = -O3 -flto -DNDEBUG' >> Makefile
echo 'CPPFLAGS = -O3 -flto -DNDEBUG' >> Makefile
fi

if [ "$satsolver" = "minisat" ]; then
echo 'CFLAGS += -DUSE_MINISAT' >> Makefile
echo 'CPPFLAGS += -DUSE_MINISAT' >> Makefile
fi

cat Makefile.in >> Makefile
echo 'configuration complete, type make to build.'

Loading

0 comments on commit c8cfbc1

Please sign in to comment.