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