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
13 SUBDIRS += tests Documentation
15 EXTRA_DIST = hkl.pc.in hkl3d.pc.in
17 installed_mainheaderdir = $(includedir)/hkl-@VMAJ@
18 dist_installed_mainheader_DATA = hkl.h
20 pkgconfigdir = $(libdir)/pkgconfig
21 pkgconfig_DATA = hkl.pc
24 #for not do not install
25 noinst_DATA = hkl3d.pc
29 .PHONY: lcov genlcov lcov-clean
30 # use recursive makes in order to ignore errors during check
32 -$(MAKE) $(AM_MAKEFLAGS) -k check
33 $(MAKE) $(AM_MAKEFLAGS) genlcov
35 # we have to massage the lcov.info file slightly to hide the effect of libtool
36 # placing the objects files in the .libs/ directory separate from the *.c
37 # we also have to delete tests/.libs/*.gcda
39 rm -f $(top_builddir)/test/hkl/.libs/*.gcda
40 $(LTP) --directory $(top_builddir) --capture --output-file hkl-lcov.info --test-name hkl-lcov --no-checksum --compat-libtool
41 LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory hkl-lcov --title "hkl Code Coverage" --legend --show-details hkl-lcov.info
44 -$(LTP) --directory $(top_builddir) -z
45 -rm -rf hkl-lcov.info hkl-lcov
46 -find -name '*.gcda' -print | xargs rm
47 -find -name '*.gcno' -print | xargs rm
49 distclean-local: lcov-clean
51 ## Generate the Changelog file for the distribution.
53 @if test -d "$(srcdir)/.git"; \
55 echo Creating ChangeLog && \
56 ( cd "$(top_srcdir)" && \
57 echo '# Generated by Makefile. Do not edit.'; echo; \
58 $(top_srcdir)/config/missing --run git log --stat ) > ChangeLog.tmp \
59 && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
60 || ( rm -f ChangeLog.tmp ; \
61 echo Failed to generate ChangeLog >&2 ); \
63 echo A git clone is required to generate a ChangeLog >&2; \
66 ## Update the ccan library
68 CCAN_PUBLIC_MODULES=darray
69 CCAN_PRIVATE_MODULES=array_size container_of autodata list
70 CCAN_LOCAL_REPO=/tmp/ccan
71 CCAN_LOCAL_EXTRACT=/tmp/ccan.tmp
72 CCAN_URL=git://git.ozlabs.org/~ccan/ccan
73 CCAN_CREATE_TREE=rm -rf $(CCAN_LOCAL_EXTRACT) && $(CCAN_LOCAL_REPO)/tools/create-ccan-tree -b automake $(CCAN_LOCAL_EXTRACT)
74 CCAN_DEST=$(top_srcdir)/hkl/
75 CCAN_TMP_DEST=/tmp/ccan.next
77 @if test -d $(CCAN_LOCAL_REPO); \
79 cd $(CCAN_LOCAL_REPO) && git pull; \
81 git clone $(CCAN_URL) $(CCAN_LOCAL_REPO); \
84 @echo Extracting all the modules
85 @$(CCAN_CREATE_TREE) $(CCAN_PUBLIC_MODULES) $(CCAN_PRIVATE_MODULES)
87 @rm -rf $(CCAN_TMP_DEST) && mkdir -p $(CCAN_TMP_DEST)
88 @rsync -av --exclude=Makefile.am $(CCAN_LOCAL_EXTRACT)/* $(CCAN_TMP_DEST)
89 @find $(CCAN_TMP_DEST)/ccan -maxdepth 2 -name '*.[ch]' | xargs sed -i -e 's,ccan/,hkl/ccan/,'
91 @$(CCAN_CREATE_TREE) $(CCAN_PUBLIC_MODULES)
93 @echo Generating the Makefile.am
95 echo "AM_CFLAGS=-I\$$(top_srcdir)"; echo;\
96 echo "noinst_LTLIBRARIES=libccan.la";\
97 echo "libccan_la_SOURCES = \\";\
99 cd $(CCAN_TMP_DEST)/ccan && find . -maxdepth 2 -name '*.[ch]'\
100 | sed -e 's,^./,\t,;$$!s,$$, \\,'; echo;\
102 echo "ccanincludedir=\$$(includedir)/hkl-@""VMAJ@/hkl/ccan";\
103 echo "nobase_ccaninclude_HEADERS= \\";\
105 cd $(CCAN_LOCAL_EXTRACT)/ccan && find . -maxdepth 2 -name '*.[h]'\
106 | sed -e 's,^./,\t,;$$!s,$$, \\,';\
108 ) > $(CCAN_TMP_DEST)/ccan/Makefile.am
110 @echo purge the previous ccan directory
111 cd $(CCAN_DEST) && rm -rf licenses && find ccan -mindepth 1 -type d \! -name ".*" | xargs rm -rf
112 rsync -av $(CCAN_TMP_DEST)/* $(top_srcdir)/hkl