minimize as option of barvinok_maximize
[barvinok.git] / Makefile.am
blob09fa216650e88419f065f0cfa877534dc736df42
1 if HAVE_GINAC
2     MAYBE_BERNSTEIN = bernstein
3 endif
4 SUBDIRS = $(MAYBE_BERNSTEIN) lib . omega doc
6 AM_CPPFLAGS = -I$(srcdir)/bernstein/include -I$(srcdir)/lib @GINACLIB_CPPFLAGS@
7 AM_LDFLAGS = -Llib
9 lib_LTLIBRARIES = libbarvinok.la
10 bin_PROGRAMS = barvinok_count barvinok_enumerate barvinok_enumerate_e \
11                   barvinok_ehrhart
12 noinst_PROGRAMS = test randomtest \
13                   remove_redundant_equalities \
14                   barvinok_union barvinok_maximize \
15                   @bv_extra_programs@
16 EXTRA_PROGRAMS = piptest verify_lexsmaller polyhedron_sample 4coins lexmin \
17                  polytope_scan
18 pkginclude_HEADERS = \
19     barvinok/NTL_QQ.h \
20     barvinok/barvinok.h \
21     barvinok/util.h \
22     barvinok/evalue.h \
23     barvinok/genfun.h \
24     barvinok/options.h \
25     barvinok/polylib.h \
26     barvinok/sample.h \
27     barvinok/basis_reduction.h \
28     barvinok/bernstein.h
29 LINK = $(CXXLINK)
31 if HAVE_GINAC
32     BERNSTEIN_CC = bernstein.cc
33 endif
34 if HAVE_CDDLIB
35     BR_CDD = basis_reduction_cdd.cc initcdd.cc
36 endif
37 if HAVE_GLPK
38     BR_GLPK = basis_reduction_glpk.c
39 endif
40 libbarvinok_la_SOURCES = \
41     barvinok/evalue.h \
42     barvinok/genfun.h \
43     barvinok/util.h \
44     barvinok/barvinok.h \
45     NTL_QQ.cc \
46     basis_reduction.c \
47     evalue.c \
48     genfun.cc \
49     util.c \
50     version.c \
51     bfcounter.cc \
52     bfcounter.h \
53     conversion.cc \
54     conversion.h \
55     decomposer.cc \
56     decomposer.h \
57     dpoly.cc \
58     dpoly.h \
59     genfun_constructor.cc \
60     genfun_constructor.h \
61     lattice_point.cc \
62     lattice_point.h \
63     options.c \
64     reduce_domain.c \
65     reduce_domain.h \
66     reducer.cc \
67     reducer.h \
68     remove_equalities.h \
69     scarf.cc \
70     mat_util.cc \
71     mat_util.h \
72     barvinok.cc \
73     $(BERNSTEIN_CC) \
74     $(BR_CDD) \
75     $(BR_GLPK)
76 EXTRA_libbarvinok_la_SOURCES = \
77     bernstein.cc \
78     piputil.h \
79     initcdd.cc \
80     initcdd.h
81 if HAVE_GINAC
82     BERNSTEIN_LA = $(top_builddir)/bernstein/libbernstein.la
83 endif
84 libbarvinok_la_LIBADD = @LTLIBOBJS@ $(BERNSTEIN_LA) lib/libgnu.la
85 libbarvinok_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@
86 LDADD = libbarvinok.la
88 test_SOURCES = test.c
89 barvinok_count_SOURCES = barvinok_count.c
90 barvinok_ehrhart_SOURCES = barvinok_ehrhart.cc
91 barvinok_union_SOURCES = barvinok_union.cc
92 if HAVE_OMEGA
93 BEEO_SOURCES = omega/Exit.cc omega/convert.cc
94 else
95 BEEO_SOURCES = 
96 endif
97 barvinok_enumerate_SOURCES = \
98         barvinok_enumerate.cc \
99         fdstream.cc \
100         fdstream.h \
101         verify.h \
102         verify.c \
103         verif_ehrhart.h \
104         verif_ehrhart.c
105 barvinok_enumerate_e_SOURCES = \
106         barvinok_enumerate_e.cc \
107         verify.h \
108         verify.c \
109         verif_ehrhart.h \
110         verif_ehrhart.c \
111         $(BEEO_SOURCES)
112 barvinok_enumerate_e_CPPFLAGS = @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
113 barvinok_enumerate_e_LDFLAGS = @OMEGA_LDFLAGS@ @LDFLAGS@
114 barvinok_enumerate_e_LDADD = @OMEGA_LIBS@ libbarvinok.la
115 barvinok_maximize_SOURCES = maximize.cc
116 4coins_SOURCES = 4coins.cc
117 if HAVE_CDDLIB
118 POLYSIGN = polysign_cddf.cc polysign_cdd.cc
119 endif
120 lexmin_SOURCES = \
121         lexmin.h \
122         lexmin.cc \
123         combine.c \
124         combine.h \
125         edomain.cc \
126         edomain.h \
127         evalue_util.cc \
128         evalue_util.h \
129         fdstream.cc \
130         fdstream.h \
131         $(POLYSIGN) \
132         polysign.c \
133         polysign_polylib.c \
134         polysign.h \
135         verify.h \
136         verify.c
137 EXTRA_lexmin_SOURCE = polysign_cddf.cc polysign_cdd.cc polysign.c
139 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
141 EXTRA_DIST = \
142     ChangeLog \
143     $(TESTFILES) \
144     latte2polylib.pl \
145     NTL_5_3_2.patch \
146     doc/Internal.tex \
147     doc/applications.tex \
148     doc/barvinok.tex \
149     doc/omega.tex \
150     doc/polymake.tex \
151     doc/reports.tex \
152     doc/barvinok.bib \
153     doc/barvinok.gdf \
154     doc/chicago.bst \
155     doc/chicago.sty \
156     doc/mydefs.sty \
157     polymake/Makefile.in \
158     polymake/README \
159     polymake/autogen.sh \
160     polymake/configure.in \
161     polymake/lattice_points.cc
163 ACLOCAL_AMFLAGS = -I m4
165 install-data-local:
166         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
167         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
169 uninstall-local:
170         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
172 dist-hook:
173         (cd $(distdir)/polymake; \
174             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
175         (cd doc; make barvinok.pdf)
176         cp doc/barvinok.pdf $(distdir)/doc/
177         if test -f $(top_srcdir)/.git/HEAD; then \
178             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
179         else \
180             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
181         fi
183 if HAVE_PIPLIB
184 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
185 else
186 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf
187 endif
189 check: check-enumerate check-enumerate_e check-test check-lexmin
190 check-enumerate: barvinok_enumerate
191         @for i in $(top_srcdir)/tests/ehrhart/*; do \
192             if test -f $$i; then \
193                 echo $$i; \
194                 for options in '' '--series' '--series --primal'; do \
195                     for spec in 'random' 'bf' 'df'; do \
196                         opt="--specialization=$$spec $$options"; \
197                         echo "        $$opt"; \
198                         ./barvinok_enumerate --verify $$opt < $$i; \
199                     done \
200                 done \
201             fi \
202         done
203 check-enumerate_e: barvinok_enumerate_e
204         @for dir in $(BEE_TESTDIRS); do \
205             for i in $(top_srcdir)/tests/$$dir/*; do \
206                 if test -f $$i; then \
207                     for options in '' '--pip' '--pip --omega'; do \
208                         for spec in 'random' 'bf' 'df'; do \
209                             opt="--specialization=$$spec $$options"; \
210                             echo $$i $$opt; \
211                             ./barvinok_enumerate_e --verify $$opt < $$i; \
212                         done \
213                     done \
214                 fi \
215             done \
216         done
217         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
218             if test -f $$i; then \
219                 for spec in 'random' 'bf' 'df'; do \
220                     opt="--specialization=$$spec --scarf"; \
221                     echo $$i $$opt; \
222                     ./barvinok_enumerate_e --verify $$opt < $$i; \
223                 done \
224             fi \
225         done
226 check-test: test
227         @for i in $(top_srcdir)/tests/*; do \
228             if test -f $$i; then \
229                 for options in '--index=10' '--primal --index=10'; do \
230                     for spec in 'random' 'bf' 'df'; do \
231                         opt="--specialization=$$spec $$options"; \
232                         echo -n $$i $$opt; \
233                         ./test $$opt < $$i || echo -n " NOT"; \
234                         echo " ok"; \
235                     done \
236                 done \
237             fi \
238         done
239 if HAVE_GLPK
240 check-lexmin: lexmin
241         @for i in $(top_srcdir)/tests/lexmin/*; do \
242             if test -f $$i; then \
243                 for spec in 'random' 'bf' 'df'; do \
244                     opt="--specialization=$$spec"; \
245                     echo $$i $$opt; \
246                     ./lexmin --verify $$opt < $$i; \
247                 done \
248             fi \
249         done
250 else
251 check-lexmin:
252 endif
254 version.h: @GIT_HEAD@
255         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@