Merge branch 'maint' into next
[hkl.git] / hkl / Makefile.am
blob91ffdc4c549a1dcd61a30c822bc4c8a45c82640c
1 ## Process this file with automake to produce Makefile.in
2 SUBDIRS = ccan
4 AM_LDFLAGS = -no-undefined -version-info 5:0:0
5 AM_LDFLAGS += $(GSL_LIBS)
6 AM_CFLAGS = -I$(top_srcdir) \
7         -I$(top_builddir) \
8         $(GSL_CFLAGS)
9         -fvisibility=hiden
11 hkl_c_sources = \
12         hkl-error.c \
13         hkl-axis.c \
14         hkl-detector.c \
15         hkl-detector-factory.c \
16         hkl-factory.c \
17         hkl-geometry.c \
18         hkl-interval.c \
19         hkl-lattice.c \
20         hkl-macros.c \
21         hkl-matrix.c \
22         hkl-parameter.c \
23         hkl-pseudoaxis.c \
24         hkl-pseudoaxis-auto.c \
25         hkl-pseudoaxis-common-eulerians.c \
26         hkl-pseudoaxis-common-hkl.c \
27         hkl-pseudoaxis-common-psi.c \
28         hkl-pseudoaxis-common-q.c \
29         hkl-pseudoaxis-e4c-hkl.c \
30         hkl-pseudoaxis-e4c-psi.c \
31         hkl-pseudoaxis-e6c-hkl.c \
32         hkl-pseudoaxis-e6c-psi.c \
33         hkl-pseudoaxis-k4cv-hkl.c \
34         hkl-pseudoaxis-k4cv-psi.c \
35         hkl-pseudoaxis-k6c-hkl.c \
36         hkl-pseudoaxis-k6c-psi.c \
37         hkl-pseudoaxis-petra3-hkl.c \
38         hkl-pseudoaxis-soleil-sirius-turret.c \
39         hkl-pseudoaxis-soleil-sixs-med.c \
40         hkl-pseudoaxis-zaxis-hkl.c \
41         hkl-quaternion.c \
42         hkl-sample.c \
43         hkl-source.c \
44         hkl-unit.c \
45         hkl-vector.c
47 hkl_public_h_sources = ../hkl.h
49 hkl_private_h_sources = \
50         hkl-axis-private.h \
51         hkl-detector-private.h \
52         hkl-error-private.h \
53         hkl-factory-private.h \
54         hkl-geometry-private.h \
55         hkl-interval-private.h \
56         hkl-lattice-private.h \
57         hkl-macros-private.h \
58         hkl-matrix-private.h \
59         hkl-parameter-private.h \
60         hkl-pseudoaxis-private.h \
61         hkl-pseudoaxis-auto-private.h \
62         hkl-pseudoaxis-common-eulerians-private.h \
63         hkl-pseudoaxis-common-hkl-private.h \
64         hkl-pseudoaxis-common-q-private.h \
65         hkl-pseudoaxis-common-psi-private.h \
66         hkl-pseudoaxis-e4c-private.h \
67         hkl-pseudoaxis-e6c-private.h \
68         hkl-pseudoaxis-k4cv-private.h \
69         hkl-pseudoaxis-k6c-private.h \
70         hkl-pseudoaxis-zaxis-private.h \
71         hkl-pseudoaxis-soleil-sirius-turret-private.h \
72         hkl-pseudoaxis-soleil-sixs-med-private.h \
73         hkl-pseudoaxis-petra3-private.h \
74         hkl-quaternion-private.h \
75         hkl-sample-private.h \
76         hkl-source-private.h \
77         hkl-unit-private.h \
78         hkl-vector-private.h
80 lib_LTLIBRARIES = libhkl.la
81 libhkl_la_SOURCES = $(hkl_c_sources) $(hkl_private_h_sources)
82 libhkl_la_LIBADD = ccan/libccan.la
84 # introspection
86 -include $(INTROSPECTION_MAKEFILE)
87 INTROSPECTION_GIRS =
88 INTROSPECTION_SCANNER_ARGS = \
89         --add-include-path=$(srcdir) \
90         --add-include-path=. \
91         --warn-all
92 INTROSPECTION_COMPILER_ARGS = \
93         --includedir=$(srcdir) \
94         --includedir=.
96 if HAVE_INTROSPECTION
98 libhkl_la_SOURCES += \
99         hkl-types.c \
100         hkl-types.h \
101         hkl-type-builtins.c \
102         hkl-type-builtins.h \
103         hkl-binding.c \
104         hkl-binding-private.h
106 introspection_files = \
107         ../hkl.h \
108         hkl-binding-private.h \
109         hkl-types.h \
110         hkl-error.c \
111         hkl-matrix.c \
112         hkl-parameter.c \
113         hkl-axis.c \
114         hkl-geometry.c \
115         hkl-detector.c \
116         hkl-detector-factory.c \
117         hkl-lattice.c \
118         hkl-sample.c \
119         hkl-pseudoaxis.c \
120         hkl-factory.c \
121         hkl-binding.c \
122         hkl-types.c \
123         hkl-type-builtins.c \
124         hkl-type-builtins.h
126 AM_LDFLAGS += $(GOBJECT_LIBS)
127 AM_CFLAGS += $(GOBJECT_CFLAGS)
129 hkl-type-builtins.h: stamp-hkl-type-builtins.h
130         @true
131 stamp-hkl-type-builtins.h: $(hkl_public_h_sources) $(srcdir)/hkl-type-builtins.h.template
132         ( cd $(srcdir) && $(GLIB_MKENUMS) --template hkl-type-builtins.h.template \
133                 $(hkl_public_h_sources) ) >> xgen-gtbh \
134         && (cmp -s xgen-gtbh hkl-type-builtins.h || cp xgen-gtbh hkl-type-builtins.h ) \
135         && rm -f xgen-gtbh \
136         && echo timestamp > $(@F)
137 hkl-type-builtins.c: $(hkl_public_h_sources) $(srcdir)/hkl-type-builtins.c.template hkl-type-builtins.h
138         ( cd $(srcdir) && $(GLIB_MKENUMS) --template hkl-type-builtins.c.template \
139                 $(hkl_public_h_sources) ) > xgen-gtbc \
140         && cp xgen-gtbc hkl-type-builtins.c  \
141         && rm -f xgen-gtbc
143 Hkl-@VMAJ@.0.gir: $(INTROSPECTION_SCANNER) libhkl.la Makefile
145 Hkl_@VMAJ@_0_gir_NAMESPACE = Hkl
146 Hkl_@VMAJ@_0_gir_VERSION = @VMAJ@.0
147 Hkl_@VMAJ@_0_gir_LIBS = libhkl.la
148 Hkl_@VMAJ@_0_gir_FILES =  $(introspection_files)
149 Hkl_@VMAJ@_0_gir_PACKAGES = gobject-2.0
150 Hkl_@VMAJ@_0_gir_CFLAGS = $(INCLUDES) $(AM_CPPFLAGS) $(AM_CFLAGS)
151 Hkl_@VMAJ@_0_gir_EXPORT_PACKAGES = hkl-@VMAJ@.0
152 Hkl_@VMAJ@_0_gir_SCANNERFLAGS = --warn-all --c-include='hkl.h'
154 INTROSPECTION_GIRS += Hkl-@VMAJ@.0.gir
156 girdir = $(datadir)/gir-1.0
157 gir_DATA = $(INTROSPECTION_GIRS)
159 typelibsdir = $(libdir)/girepository-1.0
160 typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
162 EXTRA_DIST = \
163         hkl-type-builtins.h.template \
164         hkl-type-builtins.c.template
166 CLEANFILES = $(gir_DATA) $(typelibs_DATA) stamp-hkl-type-builtins.h hkl-type-builtins.h hkl-type-builtins.c
168 endif
170 # Support for GNU Flymake, in Emacs.
172 check-syntax: AM_CFLAGS += -fsyntax-only -pipe
173 check-syntax:
174         test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
176 # check for includes with iwyu
177 iwyu:
178         @list='$(libhkl_la_SOURCES)';\
179         for p in $$list; do\
180                 iwyu $(AM_CFLAGS) $$p; \
181         done;
183 .PHONY: check-syntax iwyu