Merge branch '1.4.x'
[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 .PHONY: submission submission-main submission-application submission-parallel
44 submission:
45 @if [ -d builds-smtcomp ]; then \
46 echo 'ERROR:' >&2; \
47 echo 'ERROR: remove the builds-smtcomp directory' >&2; \
48 echo 'ERROR:' >&2; \
49 exit 1; \
50 fi
51 @if test -d cvc4-smtcomp-$(YEAR) || test -e cvc4-smtcomp-$(YEAR).zip || \
52 test -d cvc4-smtcomp-main-$(YEAR) || test -e cvc4-smtcomp-main-$(YEAR).zip || \
53 test -d cvc4-smtcomp-application-$(YEAR) || test -e cvc4-smtcomp-application-$(YEAR).zip || \
54 test -d cvc4-smtcomp-parallel-$(YEAR) || test -e cvc4-smtcomp-parallel-$(YEAR).zip; then \
55 echo 'ERROR:' >&2; \
56 echo 'ERROR: Please remove cvc4-smtcomp*-$(YEAR) and corresponding zipfiles.' >&2; \
57 echo 'ERROR:' >&2; \
58 exit 1; \
59 fi
60 $(MAKE) submission-main
61 $(MAKE) submission-application
62 $(MAKE) submission-parallel
63 mkdir -p cvc4-smtcomp-$(YEAR)/bin
64 cp -p cvc4-smtcomp-main-$(YEAR)/bin/cvc4 cvc4-smtcomp-$(YEAR)/bin/cvc4-main
65 cp -p cvc4-smtcomp-main-$(YEAR)/bin/starexec_run_default cvc4-smtcomp-$(YEAR)/bin/starexec_run_default
66 cp -p cvc4-smtcomp-application-$(YEAR)/bin/cvc4 cvc4-smtcomp-$(YEAR)/bin/cvc4-application
67 cp -p cvc4-smtcomp-application-$(YEAR)/bin/starexec_run_default cvc4-smtcomp-$(YEAR)/bin/starexec_run_application
68 cp -p cvc4-smtcomp-parallel-$(YEAR)/bin/pcvc4 cvc4-smtcomp-$(YEAR)/bin/pcvc4
69 #cp -p cvc4-smtcomp-parallel-$(YEAR)/bin/starexec_run_default cvc4-smtcomp-$(YEAR)/bin/starexec_run_parallel
70 cat cvc4-smtcomp-main-$(YEAR)/starexec_description.txt \
71 cvc4-smtcomp-application-$(YEAR)/starexec_description.txt \
72 cvc4-smtcomp-parallel-$(YEAR)/starexec_description.txt \
73 > cvc4-smtcomp-$(YEAR)/starexec_description.txt
74 perl -pi -e 's,/cvc4\b,/cvc4-main,g' cvc4-smtcomp-$(YEAR)/bin/starexec_run_default
75 perl -pi -e 's,/cvc4\b,/cvc4-application,g' cvc4-smtcomp-$(YEAR)/bin/starexec_run_application
76 cd cvc4-smtcomp-$(YEAR) && zip -r ../cvc4-smtcomp-$(YEAR).zip *
77 submission-main:
78 @if [ -d builds-smtcomp/main ]; then \
79 echo 'ERROR:' >&2; \
80 echo 'ERROR: Please remove the builds-smtcomp/main directory' >&2; \
81 echo 'ERROR:' >&2; \
82 exit 1; \
83 fi
84 @if [ -e contrib/run-script-smtcomp$(YEAR) ]; then :; else \
85 echo 'ERROR:' >&2; \
86 echo 'ERROR: Expected contrib/run-script-smtcomp$(YEAR) to exist!' >&2; \
87 echo 'ERROR:' >&2; \
88 exit 1; \
89 fi
90 @if test -d cvc4-smtcomp-main-$(YEAR) || test -e cvc4-smtcomp-main-$(YEAR).zip; then \
91 echo 'ERROR:' >&2; \
92 echo 'ERROR: Please remove cvc4-smtcomp-main-$(YEAR) and cvc4-smtcomp-main-$(YEAR).zip first.' >&2; \
93 echo 'ERROR:' >&2; \
94 exit 1; \
95 fi
96 ./autogen.sh
97 mkdir -p builds-smtcomp/main
98 ( cd builds-smtcomp/main; \
99 ../../configure competition --disable-thread-support --disable-shared --enable-static-binary --with-cln --with-glpk --with-abc --without-readline --enable-gpl; \
100 $(MAKE) V=1; \
101 strip src/main/cvc4; \
102 $(MAKE) check )
103 # main track
104 mkdir -p cvc4-smtcomp-main-$(YEAR)/bin
105 cp -p builds-smtcomp/main/src/main/cvc4 cvc4-smtcomp-main-$(YEAR)/bin/cvc4
106 cp contrib/run-script-smtcomp$(YEAR) cvc4-smtcomp-main-$(YEAR)/bin/starexec_run_default
107 chmod 755 cvc4-smtcomp-main-$(YEAR)/bin/starexec_run_default
108 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
109 cd cvc4-smtcomp-main-$(YEAR) && zip -r ../cvc4-smtcomp-main-$(YEAR).zip *
110 submission-application:
111 # application track is a separate build because it has different preprocessor #defines
112 @if [ -d builds-smtcomp/application ]; then \
113 echo 'ERROR:' >&2; \
114 echo 'ERROR: Please remove the builds-smtcomp/application directory' >&2; \
115 echo 'ERROR:' >&2; \
116 exit 1; \
117 fi
118 @if test -d cvc4-smtcomp-application-$(YEAR) || test -e cvc4-smtcomp-application-$(YEAR).zip; then \
119 echo 'ERROR:' >&2; \
120 echo 'ERROR: Please remove cvc4-smtcomp-application-$(YEAR) and cvc4-smtcomp-application-$(YEAR).zip first.' >&2; \
121 echo 'ERROR:' >&2; \
122 exit 1; \
123 fi
124 @if [ -e contrib/run-script-smtcomp$(YEAR)-application ]; then :; else \
125 echo 'ERROR:' >&2; \
126 echo 'ERROR: Expected contrib/run-script-smtcomp$(YEAR)-application to exist!' >&2; \
127 echo 'ERROR:' >&2; \
128 exit 1; \
129 fi
130 ./autogen.sh
131 mkdir -p builds-smtcomp/application
132 ( cd builds-smtcomp/application; \
133 ../../configure competition --disable-thread-support --disable-shared --enable-static-binary --with-cln --without-glpk --with-abc --without-readline --enable-gpl CXXFLAGS=-DCVC4_SMTCOMP_APPLICATION_TRACK CFLAGS=-DCVC4_SMTCOMP_APPLICATION_TRACK; \
134 $(MAKE) V=1; \
135 strip src/main/cvc4; \
136 $(MAKE) check )
137 # package the application track zipfile
138 mkdir -p cvc4-smtcomp-application-$(YEAR)/bin
139 cp -p builds-smtcomp/application/src/main/cvc4 cvc4-smtcomp-application-$(YEAR)/bin/cvc4
140 cp contrib/run-script-smtcomp$(YEAR)-application cvc4-smtcomp-application-$(YEAR)/bin/starexec_run_default
141 chmod 755 cvc4-smtcomp-application-$(YEAR)/bin/starexec_run_default
142 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
143 cd cvc4-smtcomp-application-$(YEAR) && zip -r ../cvc4-smtcomp-application-$(YEAR).zip *
144 submission-parallel:
145 # parallel track can't be built with -cln, so it's a separate build
146 @if [ -d builds-smtcomp/parallel ]; then \
147 echo 'ERROR:' >&2; \
148 echo 'ERROR: Please remove the builds-smtcomp/parallel directory' >&2; \
149 echo 'ERROR:' >&2; \
150 exit 1; \
151 fi
152 @if test -d cvc4-smtcomp-parallel-$(YEAR) || test -e cvc4-smtcomp-parallel-$(YEAR).zip; then \
153 echo 'ERROR:' >&2; \
154 echo 'ERROR: Please remove cvc4-smtcomp-parallel-$(YEAR) and cvc4-smtcomp-parallel-$(YEAR).zip first.' >&2; \
155 echo 'ERROR:' >&2; \
156 exit 1; \
157 fi
158 ./autogen.sh
159 mkdir -p builds-smtcomp/parallel
160 ( cd builds-smtcomp/parallel; \
161 ../../configure competition --disable-shared --enable-static-binary --with-gmp --with-portfolio --with-glpk --with-abc --without-readline --enable-gpl; \
162 $(MAKE) V=1; \
163 strip src/main/pcvc4; \
164 $(MAKE) check BINARY=pcvc4 CVC4_REGRESSION_ARGS=--fallback-sequential || true )
165 # package the parallel track zipfile
166 mkdir -p cvc4-smtcomp-parallel-$(YEAR)/bin
167 cp -p builds-smtcomp/parallel/src/main/pcvc4 cvc4-smtcomp-parallel-$(YEAR)/bin/pcvc4
168 ( echo '#!/bin/sh'; \
169 echo 'exec ./pcvc4 --threads 2 -L smt2 --no-checking --no-interactive --no-wait-to-join "$@"' ) > cvc4-smtcomp-parallel-$(YEAR)/bin/starexec_run_default
170 chmod 755 cvc4-smtcomp-parallel-$(YEAR)/bin/starexec_run_default
171 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
172 cd cvc4-smtcomp-parallel-$(YEAR) && zip -r ../cvc4-smtcomp-parallel-$(YEAR).zip *