evalue.c: reorder_terms: fix typo
[barvinok.git] / Makefile.am
blob31bddde08e6e6bb24d8f790a7a18fb5efd6406b1
1 if HAVE_GINAC
2     MAYBE_BERNSTEIN = bernstein
3 endif
4 SUBDIRS = $(MAYBE_BERNSTEIN) lib . omega doc
6 lib/libgnu.la:
7         $(MAKE) $(AM_MAKEFLAGS) -C lib libgnu.la
8 bernstein/libbernstein.la:
9         $(MAKE) $(AM_MAKEFLAGS) -C bernstein libbernstein.la
11 AM_CPPFLAGS = -I$(srcdir)/bernstein/include -I$(srcdir)/lib @GINACLIB_CPPFLAGS@
12 AM_LDFLAGS = -Llib
14 lib_LTLIBRARIES = libbarvinok.la
15 bin_PROGRAMS = barvinok_count barvinok_enumerate barvinok_enumerate_e \
16                   barvinok_ehrhart
17 noinst_PROGRAMS = test testlib randomtest \
18                   remove_redundant_equalities \
19                   barvinok_union polytope_volume test_approx \
20                   barvinok_summate \
21                   @bv_extra_programs@
22 EXTRA_PROGRAMS = piptest verify_lexsmaller polyhedron_sample 4coins lexmin \
23                  polytope_scan barvinok_maximize
24 pkginclude_HEADERS = \
25     barvinok/NTL_QQ.h \
26     barvinok/barvinok.h \
27     barvinok/util.h \
28     barvinok/evalue.h \
29     barvinok/genfun.h \
30     barvinok/options.h \
31     barvinok/polylib.h \
32     barvinok/sample.h \
33     barvinok/basis_reduction.h \
34     barvinok/bernstein.h
35 nodist_pkginclude_HEADERS = \
36     barvinok/NTL.h \
37     barvinok/set.h
38 LINK = $(CXXLINK)
40 if HAVE_GINAC
41     BERNSTEIN_CC = bernstein.cc
42 endif
43 if HAVE_CDDLIB
44     BR_CDD = basis_reduction_cdd.cc initcdd.cc
45 endif
46 if HAVE_GLPK
47     BR_GLPK = basis_reduction_glpk.c
48 endif
49 libbarvinok_la_SOURCES = \
50     barvinok/evalue.h \
51     barvinok/genfun.h \
52     barvinok/util.h \
53     barvinok/barvinok.h \
54     NTL_QQ.cc \
55     basis_reduction.c \
56     evalue.c \
57     genfun.cc \
58     util.c \
59     version.c \
60     bernoulli.c \
61     bernoulli.h \
62     bfcounter.cc \
63     bfcounter.h \
64     conversion.cc \
65     conversion.h \
66     counter.cc \
67     counter.h \
68     decomposer.cc \
69     decomposer.h \
70     dpoly.cc \
71     dpoly.h \
72     genfun_constructor.cc \
73     genfun_constructor.h \
74     lattice_point.cc \
75     lattice_point.h \
76     options.c \
77     param_util.c \
78     param_util.h \
79     reduce_domain.c \
80     reduce_domain.h \
81     reducer.cc \
82     reducer.h \
83     remove_equalities.h \
84     scale.c \
85     scale.h \
86     scarf.cc \
87     tcounter.cc \
88     tcounter.h \
89     volume.c \
90     volume.h \
91     mat_util.cc \
92     mat_util.h \
93     barvinok.cc \
94     $(BERNSTEIN_CC) \
95     $(BR_CDD) \
96     $(BR_GLPK)
97 EXTRA_libbarvinok_la_SOURCES = \
98     basis_reduction_cdd.cc \
99     basis_reduction_glpk.c \
100     bernstein.cc \
101     piputil.h \
102     initcdd.cc \
103     initcdd.h
104 if HAVE_GINAC
105     BERNSTEIN_LA = $(top_builddir)/bernstein/libbernstein.la
106 endif
107 libbarvinok_la_LIBADD = @LTLIBOBJS@ $(BERNSTEIN_LA) lib/libgnu.la
108 libbarvinok_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@
109 LDADD = libbarvinok.la
111 test_SOURCES = test.c
112 testlib_SOURCES = \
113         evalue_read.c \
114         evalue_read.h \
115         testlib.cc
116 barvinok_count_SOURCES = barvinok_count.c
117 barvinok_ehrhart_SOURCES = barvinok_ehrhart.cc
118 barvinok_union_SOURCES = barvinok_union.cc
119 if HAVE_OMEGA
120 BEEO_SOURCES = omega/Exit.cc omega/convert.cc
121 else
122 BEEO_SOURCES = 
123 endif
124 if USE_FDSTREAM
125 FDSTREAM = fdstream.cc fdstream.h
126 endif
127 barvinok_enumerate_SOURCES = \
128         barvinok_enumerate.cc \
129         evalue_convert.cc \
130         evalue_convert.h \
131         $(FDSTREAM) \
132         verify.h \
133         verify.c \
134         verif_ehrhart.h \
135         verif_ehrhart.c
136 EXTRA_barvinok_enumerate_SOURCES = fdstream.cc fdstream.h
137 barvinok_enumerate_e_SOURCES = \
138         barvinok_enumerate_e.cc \
139         evalue_convert.cc \
140         evalue_convert.h \
141         $(FDSTREAM) \
142         verify.h \
143         verify.c \
144         verif_ehrhart.h \
145         verif_ehrhart.c \
146         $(BEEO_SOURCES)
147 EXTRA_barvinok_enumerate_e_SOURCES = fdstream.cc fdstream.h
148 barvinok_enumerate_e_CPPFLAGS = @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
149 barvinok_enumerate_e_LDFLAGS = @OMEGA_LDFLAGS@ @LDFLAGS@
150 barvinok_enumerate_e_LDADD = @OMEGA_LIBS@ libbarvinok.la
151 barvinok_maximize_SOURCES = \
152         evalue_convert.cc \
153         evalue_convert.h \
154         evalue_read.c \
155         evalue_read.h \
156         $(FDSTREAM) \
157         maximize.cc \
158         verify.h \
159         verify.c
160 EXTRA_barvinok_maximize_SOURCES = fdstream.cc fdstream.h
161 barvinok_summate_SOURCES = \
162         evalue_convert.cc \
163         evalue_convert.h \
164         evalue_read.c \
165         evalue_read.h \
166         $(FDSTREAM) \
167         summate.cc \
168         verify.h \
169         verify.c
170 EXTRA_barvinok_summate_SOURCES = fdstream.cc fdstream.h
171 4coins_SOURCES = 4coins.cc
172 if HAVE_CDDLIB
173 POLYSIGN = polysign_cddf.cc polysign_cdd.cc
174 endif
175 lexmin_SOURCES = \
176         lexmin.h \
177         lexmin.cc \
178         combine.c \
179         combine.h \
180         edomain.cc \
181         edomain.h \
182         evalue_util.cc \
183         evalue_util.h \
184         $(POLYSIGN) \
185         polysign.c \
186         polysign_polylib.c \
187         polysign.h \
188         verify.h \
189         verify.c
190 EXTRA_lexmin_SOURCES = polysign_cddf.cc polysign_cdd.cc polysign.c
191 test_approx_SOURCES = \
192         test_approx.c \
193         verify.h \
194         verify.c
196 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
198 EXTRA_DIST = \
199     ChangeLog \
200     $(TESTFILES) \
201     latte2polylib.pl \
202     NTL_5_3_2.patch \
203     basis_reduction_templ.c \
204     polysign_cdd_template.cc \
205     barvinok/NTL.h.broken \
206     barvinok/NTL.h.normal \
207     barvinok/set.h.broken \
208     barvinok/set.h.normal \
209     doc/Internal.tex \
210     doc/applications.tex \
211     doc/barvinok.tex \
212     doc/omega.tex \
213     doc/polymake.tex \
214     doc/reports.tex \
215     doc/barvinok.bib \
216     doc/barvinok.gdf \
217     doc/chicago.bst \
218     doc/chicago.sty \
219     doc/mydefs.sty \
220     polymake/Makefile.in \
221     polymake/README \
222     polymake/autogen.sh \
223     polymake/configure.in \
224     polymake/lattice_points.cc
226 ACLOCAL_AMFLAGS = -I m4
228 install-data-local:
229         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
230         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
232 uninstall-local:
233         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
235 dist-hook:
236         (cd $(distdir)/polymake; \
237             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
238         (cd doc; make barvinok.pdf)
239         cp doc/barvinok.pdf $(distdir)/doc/
240         if test -f $(top_srcdir)/.git/HEAD; then \
241             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
242         else \
243             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
244         fi
246 if HAVE_PIPLIB
247 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
248 else
249 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf
250 endif
252 check: check-testlib check-enumerate check-enumerate_e check-test \
253         check-lexmin check-approx check-evalue
254 check-testlib: testlib
255         ./testlib
256 check-approx: test_approx
257         @for i in $(top_srcdir)/tests/ehrhart/*; do \
258             if test -f $$i; then \
259                 echo $$i | ./test_approx -q -r 10 ; \
260             fi \
261         done
262 check-evalue: barvinok_maximize barvinok_summate
263         @for i in $(top_srcdir)/tests/evalue/*; do \
264             if test -f $$i; then \
265                 ./barvinok_maximize -T < $$i; \
266                 ./barvinok_summate -T < $$i; \
267             fi \
268         done
269 check-enumerate: barvinok_enumerate
270         @for i in $(top_srcdir)/tests/ehrhart/*; do \
271             if test -f $$i; then \
272                 echo $$i; \
273                 for options in '' '--series' '--series --primal'; do \
274                     for spec in 'random' 'bf' 'df'; do \
275                         opt="--specialization=$$spec $$options"; \
276                         echo "        $$opt"; \
277                         ./barvinok_enumerate --verify $$opt < $$i; \
278                     done \
279                 done \
280             fi \
281         done
282 check-enumerate_e: barvinok_enumerate_e
283         @for dir in $(BEE_TESTDIRS); do \
284             for i in $(top_srcdir)/tests/$$dir/*; do \
285                 if test -f $$i; then \
286                     for options in '' '--pip' '--pip --omega'; do \
287                         for spec in 'random' 'bf' 'df'; do \
288                             opt="--specialization=$$spec $$options"; \
289                             echo $$i $$opt; \
290                             ./barvinok_enumerate_e --verify $$opt < $$i; \
291                         done \
292                     done \
293                 fi \
294             done \
295         done
296         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
297             if test -f $$i; then \
298                 for spec in 'random' 'bf' 'df'; do \
299                     opt="--specialization=$$spec --scarf"; \
300                     echo $$i $$opt; \
301                     ./barvinok_enumerate_e --verify $$opt < $$i; \
302                 done \
303             fi \
304         done
305 check-test: test
306         @for i in $(top_srcdir)/tests/*; do \
307             if test -f $$i; then \
308                 for options in '--index=10' '--primal --index=10'; do \
309                     for spec in 'random' 'bf' 'df' 'todd'; do \
310                         opt="--specialization=$$spec $$options"; \
311                         echo -n $$i $$opt; \
312                         ./test $$opt < $$i || echo -n " NOT"; \
313                         echo " ok"; \
314                     done \
315                 done \
316             fi \
317         done
318 if HAVE_GLPK
319 check-lexmin: lexmin
320         @for i in $(top_srcdir)/tests/lexmin/*; do \
321             if test -f $$i; then \
322                 for spec in 'random' 'bf' 'df'; do \
323                     opt="--specialization=$$spec"; \
324                     echo $$i $$opt; \
325                     ./lexmin --verify $$opt < $$i; \
326                 done \
327             fi \
328         done
329 else
330 check-lexmin:
331 endif
333 version.h: @GIT_HEAD@
334         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@