[hkl] remove a bunch of warnings.
[hkl.git] / Makefile.am
blob28984817912201c5f8826ac00df37f0876c22e33
1 ## Process this file with automake to produce Makefile.in
3 ACLOCAL_AMFLAGS = -I m4
4 AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection --enable-hkl3d
6 SUBDIRS = hkl
7 if HKL3D
8 SUBDIRS += hkl3d data
9 endif
10 if GUI
11 SUBDIRS += gui
12 endif
13 if HKL_DOC
14 SUBDIRS += Documentation
15 endif
16 SUBDIRS += tests
18 EXTRA_DIST = hkl.pc.in hkl3d.pc.in
20 installed_mainheaderdir = $(includedir)/hkl-@VMAJ@
21 dist_installed_mainheader_DATA = hkl.h
23 pkgconfigdir = $(libdir)/pkgconfig
24 pkgconfig_DATA = hkl.pc
26 if HKL3D
27 #for not do not install
28 noinst_DATA = hkl3d.pc
29 endif
31 ## lcov part
32 .PHONY: lcov genlcov lcov-clean
33 # use recursive makes in order to ignore errors during check
34 lcov:
35         -$(MAKE) $(AM_MAKEFLAGS) -k check
36         $(MAKE) $(AM_MAKEFLAGS) genlcov
38 # we have to massage the lcov.info file slightly to hide the effect of libtool
39 # placing the objects files in the .libs/ directory separate from the *.c
40 # we also have to delete tests/.libs/*.gcda
41 genlcov:
42         rm -f $(top_builddir)/test/hkl/.libs/*.gcda
43         $(LTP) --directory $(top_builddir) --capture --output-file hkl-lcov.info --test-name hkl-lcov --no-checksum --compat-libtool
44         LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory hkl-lcov --title "hkl Code Coverage" --legend --show-details hkl-lcov.info
46 lcov-clean:
47         -$(LTP) --directory $(top_builddir) -z
48         -rm -rf hkl-lcov.info hkl-lcov
49         -find -name '*.gcda' -print | xargs rm
50         -find -name '*.gcno' -print | xargs rm
52 distclean-local: lcov-clean
54 ## Generate the Changelog file for the distribution.
55 dist-hook:
56         @if test -d "$(srcdir)/.git"; \
57         then \
58                 echo Creating ChangeLog && \
59                 ( cd "$(top_srcdir)" && \
60                   echo '# Generated by Makefile. Do not edit.'; echo; \
61                   $(top_srcdir)/config/missing --run git log --stat ) > ChangeLog.tmp \
62                 && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
63                 || ( rm -f ChangeLog.tmp ; \
64                      echo Failed to generate ChangeLog >&2 ); \
65         else \
66                 echo A git clone is required to generate a ChangeLog >&2; \
67         fi
69 ## Update the ccan library
71 CCAN_PUBLIC_MODULES=darray
72 CCAN_PRIVATE_MODULES=array_size container_of autodata list
73 CCAN_LOCAL_REPO=/tmp/ccan
74 CCAN_LOCAL_EXTRACT=/tmp/ccan.tmp
75 CCAN_URL=git://git.ozlabs.org/~ccan/ccan
76 CCAN_CREATE_TREE=rm -rf $(CCAN_LOCAL_EXTRACT) && $(CCAN_LOCAL_REPO)/tools/create-ccan-tree -b automake $(CCAN_LOCAL_EXTRACT)
77 CCAN_DEST=$(top_srcdir)/hkl/
78 CCAN_TMP_DEST=/tmp/ccan.next
79 ccan-update:
80         @if test -d $(CCAN_LOCAL_REPO); \
81         then \
82                 cd $(CCAN_LOCAL_REPO) && git pull; \
83         else \
84                 git clone $(CCAN_URL) $(CCAN_LOCAL_REPO); \
85         fi
87         @echo Extracting all the modules
88         @$(CCAN_CREATE_TREE) $(CCAN_PUBLIC_MODULES) $(CCAN_PRIVATE_MODULES)
90         @rm -rf $(CCAN_TMP_DEST) && mkdir -p $(CCAN_TMP_DEST)
91         @rsync -av --exclude=Makefile.am $(CCAN_LOCAL_EXTRACT)/* $(CCAN_TMP_DEST)
92         @find $(CCAN_TMP_DEST)/ccan -maxdepth 2 -name '*.[ch]' | xargs sed -i -e 's,ccan/,hkl/ccan/,'
94         @$(CCAN_CREATE_TREE) $(CCAN_PUBLIC_MODULES)
96         @echo Generating the Makefile.am
97         @(\
98                 echo "AM_CFLAGS=-I\$$(top_srcdir)"; echo;\
99                 echo "noinst_LTLIBRARIES=libccan.la";\
100                 echo "libccan_la_SOURCES = \\";\
101                 (\
102                         cd $(CCAN_TMP_DEST)/ccan && find . -maxdepth 2 -name '*.[ch]'\
103                                 | sed -e 's,^./,\t,;$$!s,$$, \\,'; echo;\
104                 );\
105                 echo "ccanincludedir=\$$(includedir)/hkl-@""VMAJ@/hkl/ccan";\
106                 echo "nobase_ccaninclude_HEADERS= \\";\
107                 (\
108                         cd $(CCAN_LOCAL_EXTRACT)/ccan && find . -maxdepth 2 -name '*.[h]'\
109                                 | sed -e 's,^./,\t,;$$!s,$$, \\,';\
110                 );\
111         ) > $(CCAN_TMP_DEST)/ccan/Makefile.am
113         @echo purge the previous ccan directory
114         cd $(CCAN_DEST) && rm -rf licenses && find ccan -mindepth 1 -type d \! -name ".*" | xargs rm -rf
115         rsync -av $(CCAN_TMP_DEST)/* $(top_srcdir)/hkl