extract out shared isl_set_check_range
[isl.git] / Makefile.am
blobc1c488bbf4a05cafdefc7d67f8c4b9bdd9979330
1 if HAVE_CLANG
2 MAYBE_INTERFACE = interface
3 FORCE:
4 interface/extract_interface: FORCE
5         $(MAKE) $(AM_MAKEFLAGS) -C interface extract_interface
6 endif
7 SUBDIRS = . $(MAYBE_INTERFACE) doc
8 DIST_SUBDIRS = $(MAYBE_INTERFACE) doc
10 ACLOCAL_AMFLAGS = -I m4
11 AUTOMAKE_OPTIONS = nostdinc subdir-objects
13 lib_LTLIBRARIES = libisl.la
14 noinst_PROGRAMS = isl_test isl_polyhedron_sample isl_pip \
15         isl_polyhedron_minimize isl_polytope_scan \
16         isl_polyhedron_detect_equalities isl_cat \
17         isl_closure isl_bound isl_schedule isl_codegen isl_test_int \
18         isl_flow isl_flow_cmp isl_schedule_cmp
19 TESTS = isl_test codegen_test.sh pip_test.sh bound_test.sh isl_test_int \
20         flow_test.sh schedule_test.sh
21 if HAVE_CPP_ISL_H
22   CPP_H = include/isl/cpp.h
23 if HAVE_CXX11
24   noinst_PROGRAMS += isl_test_cpp
25   TESTS += isl_test_cpp
26 endif
27 endif
28 if HAVE_CLANG
29 if HAVE_CXX11
30   noinst_PROGRAMS += isl_test_cpp-checked isl_test_cpp-checked-conversion
31   TESTS += isl_test_cpp-checked isl_test_cpp-checked-conversion
32 endif
33 if HAVE_PYTHON
34   TESTS += isl_test_python.py
35   isl_test_python.py: interface/isl.py libisl.la
36 endif
37 endif
38 TEST_EXTENSIONS = .py
39 AM_TESTS_ENVIRONMENT = \
40         export PYTHONPATH=interface; \
41         export LD_LIBRARY_PATH=.libs;
42 PY_LOG_COMPILER = $(PYTHON)
44 if IMATH_FOR_MP
46 MP_SRC = \
47         isl_imath.c \
48         isl_imath.h \
49         isl_int_imath.h \
50         imath_wrap/gmp_compat.h \
51         imath_wrap/imath.h \
52         imath_wrap/imrat.h \
53         imath_wrap/wrap.h \
54         imath_wrap/gmp_compat.c \
55         imath_wrap/imath.c \
56         imath_wrap/imrat.c
58 noinst_PROGRAMS += isl_test_imath
59 TESTS += isl_test_imath
61 if SMALL_INT_OPT
62 MP_SRC += isl_int_sioimath.h \
63         isl_int_sioimath.c \
64         isl_val_sioimath.c
65 else
66 MP_SRC += isl_val_imath.c
67 endif
69 MP_INCLUDE_H =
70 endif
72 if GMP_FOR_MP
73 if NEED_GET_MEMORY_FUNCTIONS
74 GET_MEMORY_FUNCTIONS=mp_get_memory_functions.c
75 endif
77 MP_SRC = \
78         $(GET_MEMORY_FUNCTIONS) \
79         isl_int_gmp.h \
80         isl_gmp.c \
81         isl_val_gmp.c
83 MP_INCLUDE_H = include/isl/val_gmp.h
84 endif
86 includes = -I. -I$(srcdir) -I$(srcdir)/include -Iinclude/
87 AM_CPPFLAGS = $(includes) @MP_CPPFLAGS@
88 AM_CFLAGS = @WARNING_FLAGS@ @MP_CFLAGS@
90 libisl_la_SOURCES = \
91         $(MP_SRC) \
92         isl_aff.c \
93         isl_aff_map.c \
94         isl_aff_private.h \
95         isl_affine_hull.c \
96         isl_arg.c \
97         isl_ast.c \
98         isl_ast_private.h \
99         isl_ast_build.c \
100         isl_ast_build_private.h \
101         isl_ast_build_expr.c \
102         isl_ast_build_expr.h \
103         isl_ast_codegen.c \
104         isl_ast_graft.c \
105         isl_ast_graft_private.h \
106         isl_basis_reduction.h \
107         basis_reduction_tab.c \
108         isl_bernstein.c \
109         isl_bernstein.h \
110         isl_blk.c \
111         isl_blk.h \
112         isl_bound.c \
113         isl_bound.h \
114         isl_box.c \
115         isl_coalesce.c \
116         isl_constraint.c \
117         isl_constraint_private.h \
118         isl_convex_hull.c \
119         isl_ctx.c \
120         isl_ctx_private.h \
121         isl_deprecated.c \
122         isl_dim_map.h \
123         isl_dim_map.c \
124         isl_equalities.c \
125         isl_equalities.h \
126         isl_factorization.c \
127         isl_factorization.h \
128         isl_farkas.c \
129         isl_ffs.c \
130         isl_flow.c \
131         isl_fold.c \
132         isl_hash.c \
133         isl_hash_private.h \
134         isl_id_to_ast_expr.c \
135         isl_id_to_id.c \
136         isl_id_to_pw_aff.c \
137         isl_ilp.c \
138         isl_ilp_private.h \
139         isl_input.c \
140         isl_int.h \
141         isl_local_private.h \
142         isl_local.h \
143         isl_local.c \
144         isl_local_space_private.h \
145         isl_local_space.c \
146         isl_lp.c \
147         isl_lp_private.h \
148         isl_map.c \
149         isl_map_list.c \
150         isl_map_simplify.c \
151         isl_map_subtract.c \
152         isl_map_private.h \
153         isl_map_to_basic_set.c \
154         isl_mat.c \
155         isl_mat_private.h \
156         isl_morph.c \
157         isl_morph.h \
158         isl_id.c \
159         isl_id_private.h \
160         isl_obj.c \
161         isl_options.c \
162         isl_options_private.h \
163         isl_output.c \
164         isl_output_private.h \
165         isl_point_private.h \
166         isl_point.c \
167         isl_polynomial_private.h \
168         isl_polynomial.c \
169         isl_printer_private.h \
170         isl_printer.c \
171         print.c \
172         isl_range.c \
173         isl_range.h \
174         isl_reordering.c \
175         isl_reordering.h \
176         isl_sample.h \
177         isl_sample.c \
178         isl_scan.c \
179         isl_scan.h \
180         isl_schedule.c \
181         isl_schedule_band.c \
182         isl_schedule_band.h \
183         isl_schedule_node.c \
184         isl_schedule_node_private.h \
185         isl_schedule_read.c \
186         isl_schedule_tree.c \
187         isl_schedule_tree.h \
188         isl_schedule_private.h \
189         isl_schedule_constraints.c \
190         isl_schedule_constraints.h \
191         isl_scheduler.c \
192         isl_set_list.c \
193         isl_sort.c \
194         isl_sort.h \
195         isl_space.c \
196         isl_space_private.h \
197         isl_stream.c \
198         isl_stream_private.h \
199         isl_seq.c \
200         isl_seq.h \
201         isl_stride.c \
202         isl_tab.c \
203         isl_tab.h \
204         isl_tab_pip.c \
205         isl_tarjan.c \
206         isl_tarjan.h \
207         isl_transitive_closure.c \
208         isl_union_map.c \
209         isl_union_map_private.h \
210         isl_union_set_private.h \
211         isl_val.c \
212         isl_val_private.h \
213         isl_vec_private.h \
214         isl_vec.c \
215         isl_version.c \
216         isl_vertices_private.h \
217         isl_vertices.c \
218         isl_yaml.h
219 libisl_la_LIBADD = @MP_LIBS@
220 libisl_la_LDFLAGS = -version-info @versioninfo@ \
221         @MP_LDFLAGS@
223 isl_test_LDFLAGS = @MP_LDFLAGS@
224 isl_test_LDADD = libisl.la @MP_LIBS@
226 isl_test_int_LDFLAGS = @MP_LDFLAGS@
227 isl_test_int_LDADD = libisl.la @MP_LIBS@
229 if IMATH_FOR_MP
230 isl_test_imath_LDFLAGS = @MP_LDFLAGS@
231 isl_test_imath_LDADD = libisl.la @MP_LIBS@
232 endif
234 isl_polyhedron_sample_LDADD = libisl.la
235 isl_polyhedron_sample_SOURCES = \
236         polyhedron_sample.c
238 isl_pip_LDFLAGS = @MP_LDFLAGS@
239 isl_pip_LDADD = libisl.la @MP_LIBS@
240 isl_pip_SOURCES = \
241         pip.c
243 isl_schedule_LDFLAGS = @MP_LDFLAGS@
244 isl_schedule_LDADD = libisl.la @MP_LIBS@
245 isl_schedule_SOURCES = \
246         schedule.c
248 isl_schedule_cmp_LDFLAGS = @MP_LDFLAGS@
249 isl_schedule_cmp_LDADD = libisl.la @MP_LIBS@
250 isl_schedule_cmp_SOURCES = \
251         schedule_cmp.c
253 isl_flow_LDFLAGS = @MP_LDFLAGS@
254 isl_flow_LDADD = libisl.la @MP_LIBS@
255 isl_flow_SOURCES = \
256         flow.c
258 isl_flow_cmp_LDFLAGS = @MP_LDFLAGS@
259 isl_flow_cmp_LDADD = libisl.la @MP_LIBS@
260 isl_flow_cmp_SOURCES = \
261         flow_cmp.c
263 isl_codegen_LDFLAGS = @MP_LDFLAGS@
264 isl_codegen_LDADD = libisl.la @MP_LIBS@
265 isl_codegen_SOURCES = \
266         codegen.c
268 isl_bound_LDFLAGS = @MP_LDFLAGS@
269 isl_bound_LDADD = libisl.la @MP_LIBS@
270 isl_bound_SOURCES = \
271         bound.c
273 isl_polyhedron_minimize_LDFLAGS = @MP_LDFLAGS@
274 isl_polyhedron_minimize_LDADD = libisl.la @MP_LIBS@
275 isl_polyhedron_minimize_SOURCES = \
276         polyhedron_minimize.c
278 isl_polytope_scan_LDADD = libisl.la
279 isl_polytope_scan_SOURCES = \
280         polytope_scan.c
282 isl_polyhedron_detect_equalities_LDADD = libisl.la
283 isl_polyhedron_detect_equalities_SOURCES = \
284         polyhedron_detect_equalities.c
286 isl_cat_LDADD = libisl.la
287 isl_cat_SOURCES = \
288         cat.c
290 isl_closure_LDADD = libisl.la
291 isl_closure_SOURCES = \
292         closure.c
294 isl_test_cpp_CXXFLAGS = @CXX11FLAGS@
295 isl_test_cpp_SOURCES = \
296         isl_test_cpp.cc \
297         include/isl/cpp.h
298 isl_test_cpp_LDFLAGS = @MP_LDFLAGS@
299 isl_test_cpp_LDADD = libisl.la @MP_LIBS@
301 isl_test_cpp_checked_CXXFLAGS = @CXX11FLAGS@
302 isl_test_cpp_checked_SOURCES = \
303         isl_test_cpp-checked.cc \
304         include/isl/cpp-checked.h
305 isl_test_cpp_checked_LDFLAGS = @MP_LDFLAGS@
306 isl_test_cpp_checked_LDADD = libisl.la @MP_LIBS@
308 isl_test_cpp_checked_conversion_CXXFLAGS = @CXX11FLAGS@
309 isl_test_cpp_checked_conversion_SOURCES = \
310         isl_test_cpp-checked-conversion.cc \
311         include/isl/cpp-checked-conversion.h
312 isl_test_cpp_checked_conversion_LDFLAGS = @MP_LDFLAGS@
313 isl_test_cpp_checked_conversion_LDADD = libisl.la @MP_LIBS@
315 # dummy library that captures the dependencies on all headers
316 # that are relevant for the bindings
317 noinst_LIBRARIES = libdep.a
318 libdep_a_SOURCES = all.c
320 if HAVE_CLANG
321 interface/isl.py: interface/extract_interface libdep.a python/isl.py.top
322         (cat $(srcdir)/python/isl.py.top && \
323                 interface/extract_interface$(EXEEXT) --language=python \
324                         $(includes) $(srcdir)/all.h) \
325                         > $@ || (rm $@ && false)
327 include/isl/cpp.h: interface/extract_interface libdep.a \
328                 cpp/cpp.h.top cpp/cpp.h.pre cpp/cpp.h.bot
329         $(MKDIR_P) "include/isl/cpp" && \
330         (cat $(srcdir)/cpp/cpp.h.top $(srcdir)/all.h \
331             $(srcdir)/cpp/cpp.h.pre && \
332                 interface/extract_interface$(EXEEXT) --language=cpp \
333                         $(includes) $(srcdir)/all.h && \
334                 cat $(srcdir)/cpp/cpp.h.bot) \
335                         > $@ || (rm $@ && false)
337 include/isl/cpp-checked.h: interface/extract_interface libdep.a \
338                 cpp/cpp-checked.h.top \
339                 cpp/cpp-checked.h.pre cpp/cpp-checked.h.bot
340         (cat $(srcdir)/cpp/cpp-checked.h.top $(srcdir)/all.h \
341             $(srcdir)/cpp/cpp-checked.h.pre && \
342                 interface/extract_interface$(EXEEXT) \
343                         --language=cpp-checked \
344                         $(includes) $(srcdir)/all.h && \
345                 cat $(srcdir)/cpp/cpp-checked.h.bot) \
346                         > $@ || (rm $@ && false)
348 include/isl/cpp-checked-conversion.h: interface/extract_interface libdep.a \
349                 cpp/cpp-checked-conversion.h.top \
350                 cpp/cpp-checked-conversion.h.bot
351         (cat $(srcdir)/cpp/cpp-checked-conversion.h.top && \
352                 interface/extract_interface$(EXEEXT) \
353                         --language=cpp-checked-conversion \
354                         $(includes) $(srcdir)/all.h && \
355                 cat $(srcdir)/cpp/cpp-checked-conversion.h.bot) \
356                         > $@ || (rm $@ && false)
357 endif
359 nodist_pkginclude_HEADERS = \
360         include/isl/stdint.h
361 pkginclude_HEADERS = \
362         $(CPP_H) \
363         $(MP_INCLUDE_H) \
364         include/isl/aff.h \
365         include/isl/aff_type.h \
366         include/isl/arg.h \
367         include/isl/ast.h \
368         include/isl/ast_type.h \
369         include/isl/ast_build.h \
370         include/isl/constraint.h \
371         include/isl/ctx.h \
372         include/isl/fixed_box.h \
373         include/isl/flow.h \
374         include/isl/id.h \
375         include/isl/id_type.h \
376         include/isl/id_to_ast_expr.h \
377         include/isl/id_to_id.h \
378         include/isl/id_to_pw_aff.h \
379         include/isl/ilp.h \
380         include/isl/hash.h \
381         include/isl/hmap.h \
382         include/isl/hmap_templ.c \
383         include/isl/list.h \
384         include/isl/local_space.h \
385         include/isl/lp.h \
386         include/isl/mat.h \
387         include/isl/map.h \
388         include/isl/map_to_basic_set.h \
389         include/isl/map_type.h \
390         include/isl/maybe.h \
391         include/isl/maybe_ast_expr.h \
392         include/isl/maybe_basic_set.h \
393         include/isl/maybe_id.h \
394         include/isl/maybe_pw_aff.h \
395         include/isl/maybe_templ.h \
396         include/isl/multi.h \
397         include/isl/obj.h \
398         include/isl/options.h \
399         include/isl/point.h \
400         include/isl/polynomial.h \
401         include/isl/polynomial_type.h \
402         include/isl/printer.h \
403         include/isl/printer_type.h \
404         include/isl/schedule.h \
405         include/isl/schedule_node.h \
406         include/isl/schedule_type.h \
407         include/isl/set.h \
408         include/isl/set_type.h \
409         include/isl/space.h \
410         include/isl/space_type.h \
411         include/isl/stream.h \
412         include/isl/stride_info.h \
413         include/isl/union_map.h \
414         include/isl/union_map_type.h \
415         include/isl/union_set.h \
416         include/isl/union_set_type.h \
417         include/isl/val.h \
418         include/isl/val_type.h \
419         include/isl/vec.h \
420         include/isl/version.h \
421         include/isl/vertices.h
423 if HAVE_CLANG
424     CPP_INTERFACES = \
425         include/isl/cpp.h \
426         include/isl/cpp-checked.h \
427         include/isl/cpp-checked-conversion.h
428 endif
429 BUILT_SOURCES = gitversion.h $(CPP_INTERFACES)
430 CLEANFILES = gitversion.h interface/isl.py $(CPP_INTERFACES)
432 DISTCLEANFILES = \
433         isl-uninstalled.sh \
434         isl-uninstalled.pc \
435         isl.pc \
436         isl.pc.in \
437         include/isl/stdint.h
439 EXTRA_DIST = \
440         LICENSE \
441         isl_config_post.h \
442         basis_reduction_templ.c \
443         bset_to_bmap.c \
444         bset_from_bmap.c \
445         check_type_range_templ.c \
446         extract_key.c \
447         isl_list_templ.c \
448         isl_list_templ.h \
449         isl_map_lexopt_templ.c \
450         isl_maybe_map.h \
451         isl_multi_macro.h \
452         isl_multi_explicit_domain.c \
453         isl_multi_pw_aff_explicit_domain.c \
454         isl_multi_union_pw_aff_explicit_domain.c \
455         isl_multi_no_explicit_domain.c \
456         isl_multi_templ.c \
457         isl_multi_templ.h \
458         isl_multi_align_templ.c \
459         isl_multi_align_set.c \
460         isl_multi_align_union_set.c \
461         isl_multi_apply_templ.c \
462         isl_multi_apply_set.c \
463         isl_multi_apply_union_set.c \
464         isl_multi_cmp.c \
465         isl_multi_coalesce.c \
466         isl_multi_dims.c \
467         isl_multi_domain_templ.c \
468         isl_multi_floor.c \
469         isl_multi_from_base_templ.c \
470         isl_multi_gist.c \
471         isl_multi_hash.c \
472         isl_multi_intersect.c \
473         isl_multi_identity_templ.c \
474         isl_multi_move_dims_templ.c \
475         isl_multi_product_templ.c \
476         isl_multi_splice_templ.c \
477         isl_multi_zero_templ.c \
478         print_templ.c \
479         print_templ_yaml.c \
480         isl_power_templ.c \
481         isl_pw_macro.h \
482         isl_pw_templ.c \
483         isl_pw_templ.h \
484         isl_pw_eval.c \
485         isl_pw_hash.c \
486         isl_pw_union_opt.c \
487         read_in_string_templ.c \
488         set_to_map.c \
489         set_from_map.c \
490         set_list_from_map_list_inl.c \
491         isl_tab_lexopt_templ.c \
492         isl_test_list_templ.c \
493         uset_to_umap.c \
494         uset_from_umap.c \
495         isl_union_macro.h \
496         isl_union_templ.c \
497         isl_union_single.c \
498         isl_union_multi.c \
499         isl_union_eval.c \
500         isl_union_neg.c \
501         libisl-gdb.py \
502         doc/CodingStyle \
503         doc/SubmittingPatches \
504         doc/implementation.tex \
505         doc/isl.bib \
506         doc/mypod2latex \
507         doc/manual.tex \
508         doc/reading.tex \
509         doc/user.pod \
510         imath/gmp_compat.c \
511         imath/gmp_compat.h \
512         imath/imath.c \
513         imath/imath.h \
514         imath/imrat.c \
515         imath/imrat.h \
516         all.h \
517         cpp \
518         python \
519         isl_test_cpp-generic.cc \
520         isl_test_python.py \
521         test_inputs
523 if HAVE_CLANG
524 dist-hook: interface/isl.py
525         cp interface/isl.py $(distdir)/interface/
526 else
527 dist-hook:
528 endif
529         echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID
530         (cd doc; make manual.pdf)
531         cp doc/manual.pdf $(distdir)/doc/
533 pkgconfigdir=$(pkgconfig_libdir)
534 pkgconfig_DATA = $(pkgconfig_libfile)
536 gitversion.h: @GIT_HEAD@
537         $(AM_V_GEN)echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@
539 install-data-local: $(srcdir)/libisl-gdb.py
540         @libisl=`sed -ne "/^library_names=/{s/.*='//;s/'$$//;s/ .*//;p;}" \
541                  $(builddir)/libisl.la`; \
542         case $$libisl in \
543         '') echo Cannot find isl library name. GDB bindings not installed.;; \
544         *) echo $(INSTALL_DATA) $(srcdir)/libisl-gdb.py \
545                 $(DESTDIR)$(libdir)/$$libisl-gdb.py; \
546         test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"; \
547         $(INSTALL_DATA) $(srcdir)/libisl-gdb.py \
548             $(DESTDIR)$(libdir)/$$libisl-gdb.py; \
549         esac
551 uninstall-local:
552         @libisl=`sed -ne "/^library_names=/{s/.*='//;s/'$$//;s/ .*//;p;}" \
553                  $(builddir)/libisl.la`; \
554         if test -n "$${libisl}"; then \
555                 rm -f $(DESTDIR)$(libdir)/$$libisl-gdb.py; \
556         fi