[contrib] create a Lattice type with all the known type
[hkl.git] / hkl / Makefile.am
blobf162757627298f5ac65b24a268b2fc3c4cfb1c70
1 ## Process this file with automake to produce Makefile.in
2 SUBDIRS = ccan
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_srcdir) \
11         -I$(top_builddir) \
12         $(GLIB_CFLAGS) \
13         $(GSL_CFLAGS)
15 hkl_c_sources = \
16         hkl-axis.c \
17         hkl-detector.c \
18         hkl-detector-factory.c \
19         hkl-factory.c \
20         hkl-geometry.c \
21         hkl-interval.c \
22         hkl-lattice.c \
23         hkl-macros.c \
24         hkl-matrix.c \
25         hkl-parameter.c \
26         hkl-pseudoaxis.c \
27         hkl-pseudoaxis-auto.c \
28         hkl-pseudoaxis-common-eulerians.c \
29         hkl-pseudoaxis-common-hkl.c \
30         hkl-pseudoaxis-common-psi.c \
31         hkl-pseudoaxis-common-q.c \
32         hkl-engine-2c.c \
33         hkl-engine-e4c.c \
34         hkl-engine-k4c.c \
35         hkl-engine-e6c.c \
36         hkl-engine-k6c.c \
37         hkl-engine-petra3-p09-eh2.c \
38         hkl-engine-soleil-sirius-turret.c \
39         hkl-engine-soleil-sixs-med.c \
40         hkl-engine-zaxis.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-factory-private.h \
53         hkl-geometry-private.h \
54         hkl-interval-private.h \
55         hkl-lattice-private.h \
56         hkl-macros-private.h \
57         hkl-matrix-private.h \
58         hkl-parameter-private.h \
59         hkl-pseudoaxis-private.h \
60         hkl-pseudoaxis-auto-private.h \
61         hkl-pseudoaxis-common-eulerians-private.h \
62         hkl-pseudoaxis-common-hkl-private.h \
63         hkl-pseudoaxis-common-q-private.h \
64         hkl-pseudoaxis-common-psi-private.h \
65         hkl-quaternion-private.h \
66         hkl-sample-private.h \
67         hkl-source-private.h \
68         hkl-unit-private.h \
69         hkl-vector-private.h
71 lib_LTLIBRARIES = libhkl.la
72 libhkl_la_SOURCES = $(hkl_c_sources) $(hkl_private_h_sources)
73 libhkl_la_LIBADD = ccan/libccan.la
74 libhkl_la_CFLAGS = \
75         $(AM_CFLAGS) \
76         -Wno-initializer-overrides \
77         -Wno-unused-result # \ do not activate visibility yet.
78         -fvisibility=hidden
80 # just compile the template diffractometer to be sure that it is valid
81 noinst_LTLIBRARIES = libdummy.la
82 libdummy_la_SOURCES = hkl-engine-template.c
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-matrix.c \
111         hkl-parameter.c \
112         hkl-axis.c \
113         hkl-geometry.c \
114         hkl-detector.c \
115         hkl-detector-factory.c \
116         hkl-lattice.c \
117         hkl-sample.c \
118         hkl-pseudoaxis.c \
119         hkl-factory.c \
120         hkl-binding.c \
121         hkl-types.c \
122         hkl-type-builtins.c \
123         hkl-type-builtins.h
125 AM_LDFLAGS += $(GOBJECT_LIBS)
126 AM_CFLAGS += $(GOBJECT_CFLAGS)
128 hkl-type-builtins.h: stamp-hkl-type-builtins.h
129         @true
130 stamp-hkl-type-builtins.h: $(hkl_public_h_sources) $(srcdir)/hkl-type-builtins.h.template
131         ( cd $(srcdir) && $(GLIB_MKENUMS) --template hkl-type-builtins.h.template \
132                 $(hkl_public_h_sources) ) >> xgen-gtbh \
133         && (cmp -s xgen-gtbh hkl-type-builtins.h || cp xgen-gtbh hkl-type-builtins.h ) \
134         && rm -f xgen-gtbh \
135         && echo timestamp > $(@F)
136 hkl-type-builtins.c: $(hkl_public_h_sources) $(srcdir)/hkl-type-builtins.c.template hkl-type-builtins.h
137         ( cd $(srcdir) && $(GLIB_MKENUMS) --template hkl-type-builtins.c.template \
138                 $(hkl_public_h_sources) ) > xgen-gtbc \
139         && cp xgen-gtbc hkl-type-builtins.c  \
140         && rm -f xgen-gtbc
142 Hkl-@VMAJ@.0.gir: $(INTROSPECTION_SCANNER) libhkl.la Makefile
144 Hkl_@VMAJ@_0_gir_NAMESPACE = Hkl
145 Hkl_@VMAJ@_0_gir_VERSION = @VMAJ@.0
146 Hkl_@VMAJ@_0_gir_LIBS = libhkl.la
147 Hkl_@VMAJ@_0_gir_FILES =  $(introspection_files)
148 Hkl_@VMAJ@_0_gir_PACKAGES = gobject-2.0
149 Hkl_@VMAJ@_0_gir_CFLAGS = $(INCLUDES) $(AM_CPPFLAGS) $(AM_CFLAGS)
150 Hkl_@VMAJ@_0_gir_EXPORT_PACKAGES = hkl-@VMAJ@.0
151 Hkl_@VMAJ@_0_gir_SCANNERFLAGS = --warn-all --c-include='hkl.h'
153 INTROSPECTION_GIRS += Hkl-@VMAJ@.0.gir
155 girdir = $(datadir)/gir-1.0
156 gir_DATA = $(INTROSPECTION_GIRS)
158 typelibsdir = $(libdir)/girepository-1.0
159 typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
161 EXTRA_DIST = \
162         hkl-type-builtins.h.template \
163         hkl-type-builtins.c.template
165 CLEANFILES = $(gir_DATA) $(typelibs_DATA) stamp-hkl-type-builtins.h hkl-type-builtins.h hkl-type-builtins.c
167 endif
169 # Support for GNU Flymake, in Emacs.
171 check-syntax: AM_CFLAGS += -fsyntax-only -pipe
172 check-syntax:
173         test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
175 # check for includes with iwyu
176 iwyu:
177         @list='$(libhkl_la_SOURCES)';\
178         for p in $$list; do\
179                 iwyu $(AM_CFLAGS) $$p; \
180         done;
182 .PHONY: check-syntax iwyu