Merge branch 'master' into bernstein
[barvinok.git] / Makefile.am
blob3c82f6a572ecb3b5cca9c5156e9aeb75fb691a76
1 if HAVE_GINAC
2     MAYBE_BERNSTEIN = bernstein
3 endif
4 SUBDIRS = $(MAYBE_BERNSTEIN) . omega doc
6 AM_CPPFLAGS = -I$(srcdir)/bernstein/include
8 lib_LTLIBRARIES = libbarvinok.la
9 noinst_PROGRAMS = test barvinok_count randomtest barvinok_enumerate \
10                   barvinok_ehrhart \
11                   verif_ehrhart barvinok_enumerate_e \
12                   barvinok_series remove_redundant_equalities \
13                   barvinok_union \
14                   @bv_extra_programs@
15 EXTRA_PROGRAMS = piptest verify_lexsmaller polyhedron_sample 4coins lexmin
16 pkginclude_HEADERS = \
17     barvinok/NTL_QQ.h \
18     barvinok/barvinok.h \
19     barvinok/util.h \
20     barvinok/evalue.h \
21     barvinok/genfun.h \
22     barvinok/bernstein.h
23 LINK = $(CXXLINK)
25 if HAVE_GINAC
26     BERNSTEIN_CC = bernstein.cc
27 endif
28 libbarvinok_la_SOURCES = \
29     barvinok/evalue.h \
30     barvinok/genfun.h \
31     barvinok/util.h \
32     barvinok/barvinok.h \
33     NTL_QQ.cc \
34     evalue.c \
35     genfun.cc \
36     util.c \
37     bfcounter.cc \
38     bfcounter.h \
39     conversion.cc \
40     conversion.h \
41     decomposer.cc \
42     decomposer.h \
43     dpoly.cc \
44     dpoly.h \
45     genfun_constructor.cc \
46     genfun_constructor.h \
47     lattice_point.cc \
48     lattice_point.h \
49     reduce_domain.c \
50     reduce_domain.h \
51     reducer.cc \
52     reducer.h \
53     mat_util.cc \
54     mat_util.h \
55     barvinok.cc \
56     $(BERNSTEIN_CC)
57 EXTRA_libbarvinok_la_SOURCES = \
58     bernstein.cc \
59     piputil.h
60 if HAVE_GINAC
61     BERNSTEIN_LA = $(top_builddir)/bernstein/libbernstein.la
62 endif
63 libbarvinok_la_LIBADD = @LTLIBOBJS@ $(BERNSTEIN_LA)
64 libbarvinok_la_LDFLAGS = @BV_LDFLAGS@ -version-info @versioninfo@
65 LDADD = libbarvinok.la
67 test_SOURCES = test.c
68 barvinok_count_SOURCES = barvinok_count.c
69 barvinok_ehrhart_SOURCES = barvinok_ehrhart.cc
70 barvinok_series_SOURCES = barvinok_series.cc
71 barvinok_union_SOURCES = barvinok_union.cc
72 if HAVE_OMEGA
73 BEEO_SOURCES = omega/Exit.cc omega/convert.cc
74 else
75 BEEO_SOURCES = 
76 endif
77 barvinok_enumerate_e_SOURCES = \
78         barvinok_enumerate_e.cc \
79         scarf.cc \
80         $(BEEO_SOURCES)
81 barvinok_enumerate_e_CPPFLAGS = @OMEGA_CPPFLAGS@ @CPPFLAGS@
82 barvinok_enumerate_e_LDFLAGS = @OMEGA_LDFLAGS@ @LDFLAGS@
83 barvinok_enumerate_e_LDADD = @OMEGA_LIBS@ libbarvinok.la
84 verif_ehrhart_SOURCES = verif_ehrhart.c verify_main.cc verif_ehrhart.h
85 4coins_SOURCES = 4coins.cc scarf.cc
86 lexmin_SOURCES = lexmin.cc combine.c combine.h fdstream.cc fdstream.h
88 TESTFILES = $(shell find $(top_srcdir)/tests -type f ! -path '*CVS*')
90 EXTRA_DIST = \
91     README.Solaris \
92     ChangeLog \
93     $(TESTFILES) \
94     latte2polylib.pl \
95     NTL_5_3_2.patch \
96     doc/Internal.tex \
97     doc/Usage.tex \
98     doc/barvinok.bib \
99     doc/barvinok.gdf \
100     doc/barvinok.tex \
101     doc/chicago.bst \
102     doc/chicago.sty \
103     doc/mydefs.sty \
104     polymake/Makefile.in \
105     polymake/README \
106     polymake/autogen.sh \
107     polymake/configure.in \
108     polymake/lattice_points.cc
110 ACLOCAL_AMFLAGS = -I m4
112 install-data-local:
113         @test -z "$(pkgconfig_libdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfig_libdir)"
114         $(INSTALL_DATA) $(pkgconfig_libfile) "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
116 uninstall-local:
117         rm -f "$(DESTDIR)$(pkgconfig_libdir)/$(pkgconfig_libfile)"
119 dist-hook:
120         (cd $(distdir)/polymake; \
121             ./autogen.sh; rm -rf autogen.sh autom4te.cache)
122         (cd doc; make barvinok.pdf)
123         cp doc/barvinok.pdf $(distdir)/doc/
124         if test -f $(top_srcdir)/.git/HEAD; then \
125             echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID; \
126         else \
127             echo $(GIT_HEAD_ID) > $(distdir)/GIT_HEAD_ID; \
128         fi
130 if HAVE_PIPLIB
131 BEE_TESTDIRS = ehrhart_e ehrhart_e/piplib
132 else
133 BEE_TESTDIRS = ehrhart_e
134 endif
136 check-series:
137         @for i in $(top_srcdir)/tests/ehrhart/*; do \
138             if test -f $$i; then \
139                 echo $$i; \
140                 ./verif_ehrhart --series < $$i; \
141             fi \
142         done
143 check:
144         @for i in $(top_srcdir)/tests/ehrhart/*; do \
145             if test -f $$i; then \
146                 echo $$i; \
147                 ./verif_ehrhart < $$i; \
148             fi \
149         done
150         @for dir in $(BEE_TESTDIRS); do \
151             for options in '' '--pip' '--pip --omega'; do \
152                 for i in $(top_srcdir)/tests/$$dir/*; do \
153                     if test -f $$i; then \
154                         echo $$i $$options; \
155                         ./barvinok_enumerate_e --verify $$options < $$i; \
156                     fi \
157                 done \
158             done \
159         done
160         @for i in $(top_srcdir)/tests/*; do \
161             if test -f $$i; then \
162                 echo -n $$i; \
163                 ./test < $$i || echo -n " NOT"; \
164                 echo " ok"; \
165             fi \
166         done
167 if HAVE_GLPK
168         @for i in $(top_srcdir)/tests/lexmin/*; do \
169             if test -f $$i; then \
170                 echo $$i; \
171                 ./lexmin --verify < $$i; \
172             fi \
173         done
174 endif
176 version.h: @GIT_HEAD@
177         echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@