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