fix merge of check_poly from verif_ehrhart.c and lexmin.cc
[barvinok.git] / Makefile.am
blob7cc70263ca39647667663b8f6d5b36e084bb8b08
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         evalue_convert.cc \
100         evalue_convert.h \
101         fdstream.cc \
102         fdstream.h \
103         verify.h \
104         verify.c \
105         verif_ehrhart.h \
106         verif_ehrhart.c
107 barvinok_enumerate_e_SOURCES = \
108         barvinok_enumerate_e.cc \
109         evalue_convert.cc \
110         evalue_convert.h \
111         verify.h \
112         verify.c \
113         verif_ehrhart.h \
114         verif_ehrhart.c \
115         $(BEEO_SOURCES)
116 barvinok_enumerate_e_CPPFLAGS = @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
117 barvinok_enumerate_e_LDFLAGS = @OMEGA_LDFLAGS@ @LDFLAGS@
118 barvinok_enumerate_e_LDADD = @OMEGA_LIBS@ libbarvinok.la
119 barvinok_maximize_SOURCES = \
120         evalue_convert.cc \
121         evalue_convert.h \
122         maximize.cc \
123         verify.h \
124         verify.c
125 4coins_SOURCES = 4coins.cc
126 if HAVE_CDDLIB
127 POLYSIGN = polysign_cddf.cc polysign_cdd.cc
128 endif
129 lexmin_SOURCES = \
130         lexmin.h \
131         lexmin.cc \
132         combine.c \
133         combine.h \
134         edomain.cc \
135         edomain.h \
136         evalue_util.cc \
137         evalue_util.h \
138         fdstream.cc \
139         fdstream.h \
140         $(POLYSIGN) \
141         polysign.c \
142         polysign_polylib.c \
143         polysign.h \
144         verify.h \
145         verify.c
146 EXTRA_lexmin_SOURCE = polysign_cddf.cc polysign_cdd.cc polysign.c
148 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
150 EXTRA_DIST = \
151     ChangeLog \
152     $(TESTFILES) \
153     latte2polylib.pl \
154     NTL_5_3_2.patch \
155     doc/Internal.tex \
156     doc/applications.tex \
157     doc/barvinok.tex \
158     doc/omega.tex \
159     doc/polymake.tex \
160     doc/reports.tex \
161     doc/barvinok.bib \
162     doc/barvinok.gdf \
163     doc/chicago.bst \
164     doc/chicago.sty \
165     doc/mydefs.sty \
166     polymake/Makefile.in \
167     polymake/README \
168     polymake/autogen.sh \
169     polymake/configure.in \
170     polymake/lattice_points.cc
172 ACLOCAL_AMFLAGS = -I m4
174 install-data-local:
175         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
176         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
178 uninstall-local:
179         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
181 dist-hook:
182         (cd $(distdir)/polymake; \
183             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
184         (cd doc; make barvinok.pdf)
185         cp doc/barvinok.pdf $(distdir)/doc/
186         if test -f $(top_srcdir)/.git/HEAD; then \
187             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
188         else \
189             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
190         fi
192 if HAVE_PIPLIB
193 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
194 else
195 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf
196 endif
198 check: check-enumerate check-enumerate_e check-test check-lexmin
199 check-enumerate: barvinok_enumerate
200         @for i in $(top_srcdir)/tests/ehrhart/*; do \
201             if test -f $$i; then \
202                 echo $$i; \
203                 for options in '' '--series' '--series --primal'; do \
204                     for spec in 'random' 'bf' 'df'; do \
205                         opt="--specialization=$$spec $$options"; \
206                         echo "        $$opt"; \
207                         ./barvinok_enumerate --verify $$opt < $$i; \
208                     done \
209                 done \
210             fi \
211         done
212 check-enumerate_e: barvinok_enumerate_e
213         @for dir in $(BEE_TESTDIRS); do \
214             for i in $(top_srcdir)/tests/$$dir/*; do \
215                 if test -f $$i; then \
216                     for options in '' '--pip' '--pip --omega'; do \
217                         for spec in 'random' 'bf' 'df'; do \
218                             opt="--specialization=$$spec $$options"; \
219                             echo $$i $$opt; \
220                             ./barvinok_enumerate_e --verify $$opt < $$i; \
221                         done \
222                     done \
223                 fi \
224             done \
225         done
226         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
227             if test -f $$i; then \
228                 for spec in 'random' 'bf' 'df'; do \
229                     opt="--specialization=$$spec --scarf"; \
230                     echo $$i $$opt; \
231                     ./barvinok_enumerate_e --verify $$opt < $$i; \
232                 done \
233             fi \
234         done
235 check-test: test
236         @for i in $(top_srcdir)/tests/*; do \
237             if test -f $$i; then \
238                 for options in '--index=10' '--primal --index=10'; do \
239                     for spec in 'random' 'bf' 'df'; do \
240                         opt="--specialization=$$spec $$options"; \
241                         echo -n $$i $$opt; \
242                         ./test $$opt < $$i || echo -n " NOT"; \
243                         echo " ok"; \
244                     done \
245                 done \
246             fi \
247         done
248 if HAVE_GLPK
249 check-lexmin: lexmin
250         @for i in $(top_srcdir)/tests/lexmin/*; do \
251             if test -f $$i; then \
252                 for spec in 'random' 'bf' 'df'; do \
253                     opt="--specialization=$$spec"; \
254                     echo $$i $$opt; \
255                     ./lexmin --verify $$opt < $$i; \
256                 done \
257             fi \
258         done
259 else
260 check-lexmin:
261 endif
263 version.h: @GIT_HEAD@
264         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@