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