[contrib/haskell] move into binoculars-ng
[hkl.git] / hkl / Makefile.am
blob9b6d25808e74818d7e55402e23cbd85e99c81bda
1 ## Process this file with automake to produce Makefile.in
2 SUBDIRS = ccan . api2
4 AM_LDFLAGS = \
5         -no-undefined -version-info 5:0:0 \
6         $(GLIB_LIBS) \
7         $(GSL_LIBS)
8 AM_CFLAGS = \
9         -DG_LOG_DOMAIN=\"Hkl\" \
10         -I$(top_builddir) \
11         -I$(top_srcdir) \
12         -I$(top_srcdir)/third-party/ \
13         -ftrack-macro-expansion=0 \
14         $(GLIB_CFLAGS) \
15         $(GSL_CFLAGS)
17 hkl_c_sources = \
18         hkl-axis.c \
19         hkl-detector.c \
20         hkl-detector-factory.c \
21         hkl-factory.c \
22         hkl-geometry.c \
23         hkl-interval.c \
24         hkl-lattice.c \
25         hkl-macros.c \
26         hkl-matrix.c \
27         hkl-parameter.c \
28         hkl-pseudoaxis.c \
29         hkl-pseudoaxis-auto.c \
30         hkl-pseudoaxis-common.c \
31         hkl-pseudoaxis-common-eulerians.c \
32         hkl-pseudoaxis-common-hkl.c \
33         hkl-pseudoaxis-common-psi.c \
34         hkl-pseudoaxis-common-q.c \
35         hkl-pseudoaxis-common-readonly.c \
36         hkl-pseudoaxis-common-tth.c \
37         hkl-engine-2c.c \
38         hkl-engine-e4c.c \
39         hkl-engine-k4c.c \
40         hkl-engine-e6c.c \
41         hkl-engine-esrf-id01-psic.c \
42         hkl-engine-k6c.c \
43         hkl-engine-petra3-p08-lisa.c \
44         hkl-engine-petra3-p09-eh2.c \
45         hkl-engine-petra3-p23-4c.c \
46         hkl-engine-petra3-p23-6c.c \
47         hkl-engine-soleil-nanoscopium-robot.c \
48         hkl-engine-soleil-sirius-turret.c \
49         hkl-engine-soleil-sixs-med.c \
50         hkl-engine-zaxis.c \
51         hkl-quaternion.c \
52         hkl-sample.c \
53         hkl-source.c \
54         hkl-trajectory.c \
55         hkl-unit.c \
56         hkl-vector.c
58 hkl_public_h_sources = ../hkl.h
60 hkl_private_h_sources = \
61         hkl-axis-private.h \
62         hkl-detector-private.h \
63         hkl-factory-private.h \
64         hkl-geometry-private.h \
65         hkl-interval-private.h \
66         hkl-lattice-private.h \
67         hkl-macros-private.h \
68         hkl-matrix-private.h \
69         hkl-parameter-private.h \
70         hkl-pseudoaxis-private.h \
71         hkl-pseudoaxis-auto-private.h \
72         hkl-pseudoaxis-common-private.h \
73         hkl-pseudoaxis-common-eulerians-private.h \
74         hkl-pseudoaxis-common-hkl-private.h \
75         hkl-pseudoaxis-common-psi-private.h \
76         hkl-pseudoaxis-common-q-private.h \
77         hkl-pseudoaxis-common-readonly-private.h \
78         hkl-pseudoaxis-common-tth-private.h \
79         hkl-quaternion-private.h \
80         hkl-sample-private.h \
81         hkl-source-private.h \
82         hkl-trajectory-private.h \
83         hkl-unit-private.h \
84         hkl-vector-private.h
86 lib_LTLIBRARIES = libhkl.la
87 libhkl_la_SOURCES = $(hkl_c_sources) $(hkl_private_h_sources)
88 libhkl_la_LIBADD = ccan/libccan.la
89 libhkl_la_CFLAGS = \
90         $(AM_CFLAGS) \
91         -Wno-initializer-overrides \
92         -Wno-unused-result \
93         -fvisibility=hidden
95 # just compile the template diffractometer to be sure that it is valid
96 noinst_LTLIBRARIES = libdummy.la
97 libdummy_la_SOURCES = hkl-engine-template.c
99 # introspection
101 -include $(INTROSPECTION_MAKEFILE)
102 INTROSPECTION_GIRS =
103 INTROSPECTION_SCANNER_ARGS = \
104         --add-include-path=$(srcdir) \
105         --add-include-path=. \
106         --warn-all
107 INTROSPECTION_COMPILER_ARGS = \
108         --includedir=$(srcdir) \
109         --includedir=.
111 if HAVE_INTROSPECTION
113 libhkl_la_SOURCES += \
114         hkl-types.c \
115         hkl-types.h \
116         hkl-type-builtins.c \
117         hkl-type-builtins.h \
118         hkl-binding.c \
119         hkl-binding-private.h
121 introspection_files = \
122         ../hkl.h \
123         hkl-binding-private.h \
124         hkl-types.h \
125         hkl-vector.c \
126         hkl-matrix.c \
127         hkl-quaternion.c \
128         hkl-parameter.c \
129         hkl-axis.c \
130         hkl-geometry.c \
131         hkl-detector.c \
132         hkl-detector-factory.c \
133         hkl-lattice.c \
134         hkl-sample.c \
135         hkl-pseudoaxis.c \
136         hkl-factory.c \
137         hkl-binding.c \
138         hkl-types.c \
139         hkl-type-builtins.c \
140         hkl-type-builtins.h
142 AM_LDFLAGS += $(GOBJECT_LIBS)
143 AM_CFLAGS += $(GOBJECT_CFLAGS)
145 hkl-type-builtins.h: stamp-hkl-type-builtins.h
146         @true
147 stamp-hkl-type-builtins.h: $(hkl_public_h_sources) $(srcdir)/hkl-type-builtins.h.template
148         ( cd $(srcdir) && $(GLIB_MKENUMS) --template hkl-type-builtins.h.template \
149                 $(hkl_public_h_sources) ) >> xgen-gtbh \
150         && (cmp -s xgen-gtbh hkl-type-builtins.h || cp xgen-gtbh hkl-type-builtins.h ) \
151         && rm -f xgen-gtbh \
152         && echo timestamp > $(@F)
153 hkl-type-builtins.c: $(hkl_public_h_sources) $(srcdir)/hkl-type-builtins.c.template hkl-type-builtins.h
154         ( cd $(srcdir) && $(GLIB_MKENUMS) --template hkl-type-builtins.c.template \
155                 $(hkl_public_h_sources) ) > xgen-gtbc \
156         && cp xgen-gtbc hkl-type-builtins.c  \
157         && rm -f xgen-gtbc
159 Hkl-@VMAJ@.0.gir: $(INTROSPECTION_SCANNER) libhkl.la Makefile
161 Hkl_@VMAJ@_0_gir_NAMESPACE = Hkl
162 Hkl_@VMAJ@_0_gir_VERSION = @VMAJ@.0
163 Hkl_@VMAJ@_0_gir_LIBS = libhkl.la
164 Hkl_@VMAJ@_0_gir_FILES =  $(introspection_files)
165 Hkl_@VMAJ@_0_gir_PACKAGES = gobject-2.0
166 Hkl_@VMAJ@_0_gir_CFLAGS = $(INCLUDES) $(AM_CPPFLAGS) $(AM_CFLAGS)
167 Hkl_@VMAJ@_0_gir_EXPORT_PACKAGES = hkl-@VMAJ@.0
168 Hkl_@VMAJ@_0_gir_SCANNERFLAGS = --warn-all --c-include='hkl.h'
170 INTROSPECTION_GIRS += Hkl-@VMAJ@.0.gir
172 girdir = $(datadir)/gir-1.0
173 gir_DATA = $(INTROSPECTION_GIRS)
175 typelibsdir = $(libdir)/girepository-1.0
176 typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
178 EXTRA_DIST = \
179         hkl-type-builtins.h.template \
180         hkl-type-builtins.c.template
182 CLEANFILES = $(gir_DATA) $(typelibs_DATA) stamp-hkl-type-builtins.h hkl-type-builtins.h hkl-type-builtins.c
184 endif
186 # Support for GNU Flymake, in Emacs.
188 check-syntax: AM_CFLAGS += -fsyntax-only -pipe
189 check-syntax:
190         test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
192 # check for includes with iwyu
193 iwyu:
194         @list='$(libhkl_la_SOURCES)';\
195         for p in $$list; do\
196                 iwyu $(AM_CFLAGS) $$p; \
197         done;
199 .PHONY: check-syntax iwyu