Merge branch 'master' of https://github.com/CVC4/CVC4
[cvc5.git] / Makefile
1 # -*-makefile-*-
2 #
3 # This makefile is the _source_ directory's makefile, and is static,
4 # not generated. Makefile.am is the automake makefile for the build
5 # top-level (its corresponding Makefile.in is here, too, but the
6 # corresponding Makefile is under builds/$arch/$buildid.
7 #
8 builddir = builds
9
10 .PHONY: all install examples install-examples
11 all install examples install-examples .DEFAULT:
12 @if test -d $(builddir); then \
13 echo cd $(builddir); \
14 cd $(builddir); \
15 echo $(MAKE) $@; \
16 $(MAKE) $@ || exit 1; \
17 $(MAKE) show-config; \
18 else \
19 echo; \
20 echo 'Run configure first, or type "make" in a configured build directory.'; \
21 echo; \
22 fi
23
24 distclean maintainerclean:
25 @if test -d $(builddir); then \
26 echo cd $(builddir); \
27 cd $(builddir); \
28 echo $(MAKE) $@; \
29 $(MAKE) $@ || exit 1; \
30 fi
31 test -z "$(builddir)" || rm -fr "$(builddir)"
32 rm -f config.reconfig
33
34 # synonyms for "check"
35 .PHONY: test
36 test: check
37
38 .PHONY: doc doc-internals
39 doc: doc-builds
40 doc-internals: doc-internals-builds
41
42 YEAR := $(shell date +%Y)
43 submission:
44 @if [ -d builds-smtcomp ]; then \
45 echo 'ERROR: remove the builds-smtcomp directory' >&2; \
46 exit 1; \
47 fi
48 @if test -d cvc4-smtcomp-$(YEAR) || test -e cvc4-smtcomp-$(YEAR).zip || \
49 test -d cvc4-smtcomp-main-$(YEAR) || test -e cvc4-smtcomp-main-$(YEAR).zip || \
50 test -d cvc4-smtcomp-application-$(YEAR) || test -e cvc4-smtcomp-application-$(YEAR).zip || \
51 test -d cvc4-smtcomp-parallel-$(YEAR) || test -e cvc4-smtcomp-parallel-$(YEAR).zip; then \
52 echo 'ERROR: remove cvc4-smtcomp*-$(YEAR) and corresponding zipfiles.' >&2; \
53 exit 1; \
54 fi
55 $(MAKE) submission-main
56 $(MAKE) submission-application
57 $(MAKE) submission-parallel
58 mkdir -p cvc4-smtcomp-$(YEAR)/bin
59 cp -p cvc4-smtcomp-main-$(YEAR)/bin/cvc4 cvc4-smtcomp-$(YEAR)/bin/cvc4-main
60 cp -p cvc4-smtcomp-main-$(YEAR)/bin/starexec_run_default cvc4-smtcomp-$(YEAR)/bin/starexec_run_default
61 cp -p cvc4-smtcomp-application-$(YEAR)/bin/cvc4 cvc4-smtcomp-$(YEAR)/bin/cvc4-application
62 cp -p cvc4-smtcomp-application-$(YEAR)/bin/starexec_run_default cvc4-smtcomp-$(YEAR)/bin/starexec_run_application
63 cp -p cvc4-smtcomp-parallel-$(YEAR)/bin/pcvc4 cvc4-smtcomp-$(YEAR)/bin/pcvc4
64 cp -p cvc4-smtcomp-parallel-$(YEAR)/bin/starexec_run_default cvc4-smtcomp-$(YEAR)/bin/starexec_run_parallel
65 cat cvc4-smtcomp-main-$(YEAR)/starexec_description.txt \
66 cvc4-smtcomp-application-$(YEAR)/starexec_description.txt \
67 cvc4-smtcomp-parallel-$(YEAR)/starexec_description.txt \
68 > cvc4-smtcomp-$(YEAR)/starexec_description.txt
69 perl -pi -e 's,\<cvc4\>,cvc4-main,g' cvc4-smtcomp-$(YEAR)/bin/starexec_run_default
70 perl -pi -e 's,\<cvc4\>,cvc4-application,g' cvc4-smtcomp-$(YEAR)/bin/starexec_run_application
71 cd cvc4-smtcomp-$(YEAR) && zip -r ../cvc4-smtcomp-$(YEAR).zip *
72 submission-main:
73 @if [ -d builds-smtcomp/main ]; then \
74 echo 'ERROR: remove the builds-smtcomp/main directory' >&2; \
75 exit 1; \
76 fi
77 @if [ -n "`ls src/parser/*/generated 2>/dev/null`" ]; then \
78 echo 'ERROR:' >&2; \
79 echo 'ERROR: Please make maintainer-clean first.' >&2; \
80 echo 'ERROR:' >&2; \
81 exit 1; \
82 fi
83 @if test -d cvc4-smtcomp-main-$(YEAR) || test -e cvc4-smtcomp-main-$(YEAR).zip; then \
84 echo 'ERROR:' >&2; \
85 echo 'ERROR: Please remove cvc4-smtcomp-main-$(YEAR) and cvc4-smtcomp-main-$(YEAR).zip first.' >&2; \
86 echo 'ERROR:' >&2; \
87 exit 1; \
88 fi
89 ./autogen.sh
90 mkdir -p builds-smtcomp/main
91 ( cd builds-smtcomp/main; \
92 ../../configure competition --disable-shared --enable-static-binary --with-cln --with-glpk --with-abc --without-readline --enable-gpl; \
93 $(MAKE) V=1; \
94 strip src/main/cvc4; \
95 $(MAKE) check )
96 # main track
97 mkdir -p cvc4-smtcomp-main-$(YEAR)/bin
98 cp -p builds-smtcomp/main/src/main/cvc4 cvc4-smtcomp-main-$(YEAR)/bin/cvc4
99 cp contrib/run-script-smtcomp2014 cvc4-smtcomp-main-$(YEAR)/bin/starexec_run_default
100 chmod 755 cvc4-smtcomp-main-$(YEAR)/bin/starexec_run_default
101 echo "CVC4 for SMT_COMP main track `builds-smtcomp/main/src/main/cvc4 --version | head -1 | sed 's,.*version ,,;s,-,_,g;s,[^a-zA-Z0-9. _],,g'`" > cvc4-smtcomp-main-$(YEAR)/starexec_description.txt
102 cd cvc4-smtcomp-main-$(YEAR) && zip -r ../cvc4-smtcomp-main-$(YEAR).zip *
103 submission-application:
104 # application track is a separate build because it has different preprocessor #defines
105 @if [ -d builds-smtcomp/application ]; then \
106 echo 'ERROR: remove the builds-smtcomp/main directory' >&2; \
107 exit 1; \
108 fi
109 @if [ -n "`ls src/parser/*/generated 2>/dev/null`" ]; then \
110 echo 'ERROR:' >&2; \
111 echo 'ERROR: Please make maintainer-clean first.' >&2; \
112 echo 'ERROR:' >&2; \
113 exit 1; \
114 fi
115 @if test -d cvc4-smtcomp-application-$(YEAR) || test -e cvc4-smtcomp-application-$(YEAR).zip; then \
116 echo 'ERROR:' >&2; \
117 echo 'ERROR: Please remove cvc4-smtcomp-application-$(YEAR) and cvc4-smtcomp-application-$(YEAR).zip first.' >&2; \
118 echo 'ERROR:' >&2; \
119 exit 1; \
120 fi
121 ./autogen.sh
122 mkdir -p builds-smtcomp/application
123 ( cd builds-smtcomp/application; \
124 ../../configure competition --disable-shared --enable-static-binary --with-cln --with-glpk --with-abc --without-readline --enable-gpl CXXFLAGS=-DCVC4_SMTCOMP_APPLICATION_TRACK CFLAGS=-DCVC4_SMTCOMP_APPLICATION_TRACK; \
125 $(MAKE) V=1; \
126 strip src/main/cvc4; \
127 $(MAKE) check )
128 # package the application track zipfile
129 mkdir -p cvc4-smtcomp-application-$(YEAR)/bin
130 cp -p builds-smtcomp/application/src/main/cvc4 cvc4-smtcomp-application-$(YEAR)/bin/cvc4
131 cp contrib/run-script-smtcomp2014-application cvc4-smtcomp-application-$(YEAR)/bin/starexec_run_default
132 chmod 755 cvc4-smtcomp-application-$(YEAR)/bin/starexec_run_default
133 echo "CVC4 for SMT_COMP application track `builds-smtcomp/application/src/main/cvc4 --version | head -1 | sed 's,.*version ,,;s,-,_,g;s,[^a-zA-Z0-9. _],,g'`" > cvc4-smtcomp-application-$(YEAR)/starexec_description.txt
134 cd cvc4-smtcomp-application-$(YEAR) && zip -r ../cvc4-smtcomp-application-$(YEAR).zip *
135 submission-parallel:
136 # parallel track can't be built with -cln, so it's a separate build
137 @if [ -d builds-smtcomp/parallel ]; then \
138 echo 'ERROR: remove the builds-smtcomp/main directory' >&2; \
139 exit 1; \
140 fi
141 @if [ -n "`ls src/parser/*/generated 2>/dev/null`" ]; then \
142 echo 'ERROR:' >&2; \
143 echo 'ERROR: Please make maintainer-clean first.' >&2; \
144 echo 'ERROR:' >&2; \
145 exit 1; \
146 fi
147 @if test -d cvc4-smtcomp-parallel-$(YEAR) || test -e cvc4-smtcomp-parallel-$(YEAR).zip; then \
148 echo 'ERROR:' >&2; \
149 echo 'ERROR: Please remove cvc4-smtcomp-parallel-$(YEAR) and cvc4-smtcomp-parallel-$(YEAR).zip first.' >&2; \
150 echo 'ERROR:' >&2; \
151 exit 1; \
152 fi
153 ./autogen.sh
154 mkdir -p builds-smtcomp/parallel
155 ( cd builds-smtcomp/parallel; \
156 ../../configure competition --disable-shared --enable-static-binary --with-gmp --with-portfolio --with-glpk --with-abc --without-readline --enable-gpl; \
157 $(MAKE) V=1; \
158 strip src/main/pcvc4; \
159 $(MAKE) check BINARY=pcvc4 CVC4_REGRESSION_ARGS=--fallback-sequential )
160 # package the parallel track zipfile
161 mkdir -p cvc4-smtcomp-parallel-$(YEAR)/bin
162 cp -p builds-smtcomp/parallel/src/main/pcvc4 cvc4-smtcomp-parallel-$(YEAR)/bin/pcvc4
163 ( echo '#!/bin/sh'; \
164 echo 'exec ./pcvc4 --threads 2 -L smt2 --no-checking --no-interactive "$@"' ) > cvc4-smtcomp-parallel-$(YEAR)/bin/starexec_run_default
165 chmod 755 cvc4-smtcomp-parallel-$(YEAR)/bin/starexec_run_default
166 echo "CVC4 for SMT_COMP parallel track `builds-smtcomp/parallel/src/main/pcvc4 --version | head -1 | sed 's,.*version ,,;s,-,_,g;s,[^a-zA-Z0-9. _],,g'`" > cvc4-smtcomp-parallel-$(YEAR)/starexec_description.txt
167 cd cvc4-smtcomp-parallel-$(YEAR) && zip -r ../cvc4-smtcomp-parallel-$(YEAR).zip *