rerun configure when llvm-config is updated
[pet.git] / Makefile.am
blob19135588ab30e3215eea25b20adb1b776fc3fb58
1 if BUNDLED_ISL
2     MAYBE_ISL = isl
3     ISL_LA = $(top_builddir)/isl/libisl.la
4 endif
6 SUBDIRS = $(MAYBE_ISL) .
7 DIST_SUBDIRS = $(MAYBE_ISL)
9 FORCE:
10 isl/libisl.la: FORCE
11         cd isl; $(MAKE) $(AM_MAKEFLAGS) libisl.la
13 ACLOCAL_AMFLAGS = -I m4
15 LIB_ISL = $(ISL_LA) @ISL_LIBS@
17 lib_LTLIBRARIES = libpet.la
18 bin_PROGRAMS = @extra_bin_programs@
19 noinst_PROGRAMS = @extra_noinst_programs@ pet_codegen pet_check_code
20 EXTRA_PROGRAMS = pet pet_scop_cmp
21 TESTS = @extra_tests@
22 EXTRA_TESTS = pet_test.sh codegen_test.sh
23 TEST_EXTENSIONS = .sh
25 include_HEADERS = include/pet.h
27 BUILT_SOURCES = \
28         gitversion.h
30 CLEANFILES = \
31         gitversion.h \
32         isl.py
34 DISTCLEANFILES = \
35         pet-uninstalled.sh \
36         pet-uninstalled.pc \
37         pet.pc \
38         pet.pc.in
40 EXTRA_DIST = \
41         interface/isl.py.top \
42         interface/pet.py \
43         tests
45 PET_INCLUDES = -I$(srcdir) -I$(srcdir)/include
47 AM_CFLAGS = $(PET_INCLUDES) @ISL_CFLAGS@
48 AM_CXXFLAGS = $(PET_INCLUDES) $(CLANG_CXXFLAGS) @ISL_CFLAGS@
49 AM_LDFLAGS = $(CLANG_LDFLAGS)
51 libpet_la_SOURCES = \
52         aff.h \
53         aff.c \
54         array.h \
55         array.c \
56         clang_compatibility.h \
57         clang.h \
58         clang.cc \
59         context.h \
60         context.c \
61         expr.h \
62         expr.c \
63         expr_access_type.h \
64         expr_arg.h \
65         expr_arg.c \
66         expr_plus.h \
67         expr_plus.cc \
68         filter.h \
69         filter.c \
70         id.h \
71         id.cc \
72         inlined_calls.h \
73         inlined_calls.cc \
74         inliner.h \
75         inliner.cc \
76         isl_id_to_pet_expr.h \
77         isl_id_to_pet_expr.c \
78         killed_locals.h \
79         killed_locals.cc \
80         loc.h \
81         loc.c \
82         maybe_pet_expr.h \
83         nest.h \
84         nest.c \
85         options.h \
86         options.c \
87         patch.h \
88         patch.c \
89         pet_expr_to_isl_pw_aff.h \
90         pet_expr_to_isl_pw_aff.c \
91         print.c \
92         print.h \
93         tree.h \
94         tree.c \
95         tree2scop.h \
96         tree2scop.c \
97         scan.h \
98         scan.cc \
99         scop.h \
100         scop.c \
101         scop_plus.h \
102         scop_plus.cc \
103         skip.h \
104         skip.c \
105         state.h \
106         substituter.h \
107         substituter.cc \
108         summary.h \
109         summary.c \
110         value_bounds.h \
111         value_bounds.c \
112         version.h \
113         version.cc \
114         pet.cc
115 libpet_la_LDFLAGS = -version-info @versioninfo@ $(AM_LDFLAGS) $(CLANG_RFLAG)
116 libpet_la_LIBADD = -lclangFrontend -lclangParse -lclangSema \
117         $(LIB_CLANG_EDIT) -lclangAnalysis \
118         -lclangAST -lclangLex -lclangBasic -lclangDriver -lclangSerialization \
119         $(CLANG_LIBS) $(CLANG_LDFLAGS) $(LIB_ISL)
121 pet_CFLAGS = $(AM_CFLAGS) @LIBYAML_CPPFLAGS@
122 pet_LDFLAGS = $(AM_LDFLAGS) @LIBYAML_LDFLAGS@
123 pet_SOURCES = \
124         dummy.cc \
125         emit.c \
126         scop_yaml.h \
127         main.c
128 pet_LDADD = libpet.la $(LIB_ISL) -lyaml
130 pet_scop_cmp_CFLAGS = $(AM_CFLAGS) @LIBYAML_CPPFLAGS@
131 pet_scop_cmp_LDFLAGS = @LIBYAML_LDFLAGS@
132 pet_scop_cmp_LDADD = libpet.la $(LIB_ISL) -lyaml
133 pet_scop_cmp_SOURCES = \
134         dummy.cc \
135         scop_yaml.h \
136         parse.c \
137         pet_scop_cmp.c
139 pet_codegen_CFLAGS = $(AM_CFLAGS)
140 pet_codegen_LDFLAGS =
141 pet_codegen_LDADD = libpet.la $(LIB_ISL)
142 pet_codegen_SOURCES = \
143         dummy.cc \
144         pet_codegen.c
146 pet_check_code_CFLAGS = $(AM_CFLAGS)
147 pet_check_code_LDFLAGS =
148 pet_check_code_LDADD = libpet.la $(LIB_ISL)
149 pet_check_code_SOURCES = \
150         dummy.cc \
151         pet_check_code.c
153 if HAVE_ISL_BUILDDIR
154 # dummy library that captures the dependencies on all headers
155 # that are relevant for the bindings
156 noinst_LIBRARIES = libdep.a
157 libdep_a_CPPFLAGS = $(DEFAULT_INCLUDES) @ISL_CFLAGS@
158 libdep_a_SOURCES = all.c
160 isl.py: libdep.a interface/isl.py.top
161         (cat $(srcdir)/interface/isl.py.top && \
162                 @ISL_BUILDDIR@/interface/extract_interface$(EXEEXT) \
163                         --language=python \
164                         $(DEFAULT_INCLUDES) @ISL_CFLAGS@ \
165                         "@ISL_SRCDIR@/all.h") \
166                         > $@ || (rm $@ && false)
167 endif
169 dist-hook: isl.py
170         cp $< $(distdir)/
171         echo @GIT_HEAD_VERSION@ > $(distdir)/GIT_HEAD_ID
173 gitversion.h: @GIT_HEAD@
174         $(AM_V_GEN)echo '#define GIT_HEAD_ID "'@GIT_HEAD_VERSION@'"' > $@