genfun.cc: move coefficient computation to short_rat
[barvinok.git] / Makefile.am
blob20b91d3ef19f2925e4a4e68b3888ac5a69ebd622
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
7 AM_LDFLAGS = -Llib
9 lib_LTLIBRARIES = libbarvinok.la
10 noinst_PROGRAMS = test barvinok_count randomtest barvinok_enumerate \
11                   barvinok_ehrhart \
12                   barvinok_enumerate_e \
13                   remove_redundant_equalities \
14                   barvinok_union \
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         verify.h \
100         verify.c \
101         verif_ehrhart.h \
102         verif_ehrhart.c
103 barvinok_enumerate_e_SOURCES = \
104         verify.h \
105         verify.c \
106         barvinok_enumerate_e.cc \
107         $(BEEO_SOURCES)
108 barvinok_enumerate_e_CPPFLAGS = @OMEGA_CPPFLAGS@ $(AM_CPPFLAGS)
109 barvinok_enumerate_e_LDFLAGS = @OMEGA_LDFLAGS@ @LDFLAGS@
110 barvinok_enumerate_e_LDADD = @OMEGA_LIBS@ libbarvinok.la
111 4coins_SOURCES = 4coins.cc
112 if HAVE_CDDLIB
113 POLYSIGN = polysign_cddf.cc polysign_cdd.cc
114 endif
115 lexmin_SOURCES = \
116         lexmin.h \
117         lexmin.cc \
118         combine.c \
119         combine.h \
120         edomain.cc \
121         edomain.h \
122         evalue_util.cc \
123         evalue_util.h \
124         fdstream.cc \
125         fdstream.h \
126         $(POLYSIGN) \
127         polysign.c \
128         polysign_polylib.c \
129         polysign.h \
130         verify.h \
131         verify.c
132 EXTRA_lexmin_SOURCE = polysign_cddf.cc polysign_cdd.cc polysign.c
134 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
136 EXTRA_DIST = \
137     ChangeLog \
138     $(TESTFILES) \
139     latte2polylib.pl \
140     NTL_5_3_2.patch \
141     doc/Internal.tex \
142     doc/applications.tex \
143     doc/barvinok.tex \
144     doc/omega.tex \
145     doc/polymake.tex \
146     doc/reports.tex \
147     doc/barvinok.bib \
148     doc/barvinok.gdf \
149     doc/chicago.bst \
150     doc/chicago.sty \
151     doc/mydefs.sty \
152     polymake/Makefile.in \
153     polymake/README \
154     polymake/autogen.sh \
155     polymake/configure.in \
156     polymake/lattice_points.cc
158 ACLOCAL_AMFLAGS = -I m4
160 install-data-local:
161         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
162         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
164 uninstall-local:
165         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
167 dist-hook:
168         (cd $(distdir)/polymake; \
169             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
170         (cd doc; make barvinok.pdf)
171         cp doc/barvinok.pdf $(distdir)/doc/
172         if test -f $(top_srcdir)/.git/HEAD; then \
173             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
174         else \
175             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
176         fi
178 if HAVE_PIPLIB
179 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf ehrhart_e/piplib
180 else
181 BEE_TESTDIRS = ehrhart_e ehrhart_e/scarf
182 endif
184 check-series:
185         @for i in $(top_srcdir)/tests/ehrhart/*; do \
186             if test -f $$i; then \
187                 echo $$i; \
188                 ./barvinok_enumerate --verify --series < $$i; \
189             fi \
190         done
191 check:
192         @for i in $(top_srcdir)/tests/ehrhart/*; do \
193             if test -f $$i; then \
194                 echo $$i; \
195                 ./barvinok_enumerate --verify < $$i; \
196             fi \
197         done
198         @for dir in $(BEE_TESTDIRS); do \
199             for options in '' '--pip' '--pip --omega'; do \
200                 for i in $(top_srcdir)/tests/$$dir/*; do \
201                     if test -f $$i; then \
202                         echo $$i $$options; \
203                         ./barvinok_enumerate_e --verify $$options < $$i; \
204                     fi \
205                 done \
206             done \
207         done
208         @for i in $(top_srcdir)/tests/ehrhart_e/scarf/*; do \
209             if test -f $$i; then \
210                 echo $$i --scarf; \
211                 ./barvinok_enumerate_e --verify --scarf < $$i; \
212             fi \
213         done
214         @for i in $(top_srcdir)/tests/*; do \
215             for options in '' '--primal'; do \
216                 if test -f $$i; then \
217                     echo -n $$i $$options; \
218                     ./test $$options < $$i || echo -n " NOT"; \
219                     echo " ok"; \
220                 fi \
221             done \
222         done
223 if HAVE_GLPK
224         @for i in $(top_srcdir)/tests/lexmin/*; do \
225             if test -f $$i; then \
226                 echo $$i; \
227                 ./lexmin --verify < $$i; \
228             fi \
229         done
230 endif
232 version.h: @GIT_HEAD@
233         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@