[contrib][haskell] Hkl.Xrd.OneD
[hkl.git] / Makefile.am
blob577e37fc11622815a68e8af1d6f6b846e31038f3
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 SUBDIRS += tests
11 if GUI
12 SUBDIRS += gui
13 endif
14 if HKL_DOC
15 SUBDIRS += Documentation
16 endif
17 if CONTRIB
18 SUBDIRS += contrib
19 endif
21 EXTRA_DIST = hkl.pc.in hkl3d.pc.in
23 installed_mainheaderdir = $(includedir)/hkl-@VMAJ@
24 dist_installed_mainheader_DATA = hkl.h
26 pkgconfigdir = $(libdir)/pkgconfig
27 pkgconfig_DATA = hkl.pc
29 if HKL3D
30 #for not do not install
31 noinst_DATA = hkl3d.pc
32 endif
34 release:
35         git fetch
36         git checkout next
37         cd scripts && ./clean-all
38         git commit -a -m "pre-release"
39         git checkout maint
40         git merge -m "release" next
41         ./autogen.sh
42         $(MAKE) distcheck
43         git tag v`./configure -V | head -n 1 | awk '{print $$3}'`
44         git checkout next
47 ## lcov part
48 .PHONY: lcov genlcov lcov-clean release
49 # use recursive makes in order to ignore errors during check
50 lcov:
51         -$(MAKE) $(AM_MAKEFLAGS) -k check
52         $(MAKE) $(AM_MAKEFLAGS) genlcov
54 # we have to massage the lcov.info file slightly to hide the effect of libtool
55 # placing the objects files in the .libs/ directory separate from the *.c
56 # we also have to delete tests/.libs/*.gcda
57 genlcov:
58         rm -f $(top_builddir)/test/hkl/.libs/*.gcda
59         $(LTP) --directory $(top_builddir) --capture --output-file hkl-lcov.info --test-name hkl-lcov --no-checksum --compat-libtool
60         LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory hkl-lcov --title "hkl Code Coverage" --legend --show-details hkl-lcov.info
62 lcov-clean:
63         -$(LTP) --directory $(top_builddir) -z
64         -rm -rf hkl-lcov.info hkl-lcov
65         -find -name '*.gcda' -print | xargs rm
66         -find -name '*.gcno' -print | xargs rm
68 distclean-local: lcov-clean
70 ## Generate the Changelog file for the distribution.
71 dist-hook:
72         @if test -d "$(srcdir)/.git"; \
73         then \
74                 echo Creating ChangeLog && \
75                 ( cd "$(top_srcdir)" && \
76                   echo '# Generated by Makefile. Do not edit.'; echo; \
77                   $(top_srcdir)/config/missing --run git log --stat ) > ChangeLog.tmp \
78                 && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
79                 || ( rm -f ChangeLog.tmp ; \
80                      echo Failed to generate ChangeLog >&2 ); \
81         else \
82                 echo A git clone is required to generate a ChangeLog >&2; \
83         fi
85 ## Update the ccan library
87 CCAN_PUBLIC_MODULES=darray
88 CCAN_PRIVATE_MODULES=array_size container_of autodata list generator
89 CCAN_LOCAL_REPO=/tmp/ccan
90 CCAN_LOCAL_EXTRACT=/tmp/ccan.tmp
91 CCAN_URL=https://github.com/rustyrussell/ccan.git
92 CCAN_CREATE_TREE=rm -rf $(CCAN_LOCAL_EXTRACT) && cd $(CCAN_LOCAL_REPO) && tools/create-ccan-tree -b automake $(CCAN_LOCAL_EXTRACT)
93 CCAN_DEST=$(top_srcdir)/hkl/
94 CCAN_TMP_DEST=/tmp/ccan.next
95 ccan-update:
96         @if test -d $(CCAN_LOCAL_REPO); \
97         then \
98                 cd $(CCAN_LOCAL_REPO) && git pull; \
99         else \
100                 git clone $(CCAN_URL) $(CCAN_LOCAL_REPO); \
101         fi
103         @echo Extracting all the modules
104         @$(CCAN_CREATE_TREE) $(CCAN_PUBLIC_MODULES) $(CCAN_PRIVATE_MODULES)
106         @rm -rf $(CCAN_TMP_DEST) && mkdir -p $(CCAN_TMP_DEST)
107         @rsync -av --exclude=Makefile.am $(CCAN_LOCAL_EXTRACT)/* $(CCAN_TMP_DEST)
108         @find $(CCAN_TMP_DEST)/ccan -maxdepth 2 -name '*.[ch]' | xargs sed -i -e 's,ccan/,hkl/ccan/,'
109         @find $(CCAN_TMP_DEST)/ccan -maxdepth 2 -name '*.[ch]' | xargs sed -i -e 's,"config.h",<hkl/ccan/ccan_config.h>,'
110         @find $(CCAN_TMP_DEST)/ccan -maxdepth 2 -name '_info' | xargs rm -f
111         @find $(CCAN_TMP_DEST)/ccan -maxdepth 2 -name 'test' | xargs rm -rf
113         @$(CCAN_CREATE_TREE) $(CCAN_PUBLIC_MODULES)
115         @echo Generating the Makefile.am
116         @(\
117                 echo "AM_CFLAGS=-I\$$(top_srcdir)"; echo;\
118                 echo "noinst_PROGRAMS=configurator";\
119                 echo "BUILT_SOURCES=ccan_config.h";\
120                 echo "ccan_config.h: configurator";\
121                 (\
122                         echo -e "\t\$$(builddir)/configurator \$$(CC) \$$(CCAN_CFLAGS) > \$$@.tmp && mv \$$@.tmp \$$@";\
123                 );\
124                 echo "noinst_LTLIBRARIES=libccan.la";\
125                 echo "libccan_la_SOURCES = \\";\
126                 (\
127                         echo -e "\tccan_config.h \\";\
128                         cd $(CCAN_TMP_DEST)/ccan && find . -maxdepth 2 -name '*.[ch]'\
129                                 | sed -e 's,^./,\t,;$$!s,$$, \\,'; echo;\
130                 );\
131                 echo "ccanincludedir=\$$(includedir)/hkl-@""VMAJ@/hkl/ccan";\
132                 echo "nobase_ccaninclude_HEADERS= \\";\
133                 (\
134                         cd $(CCAN_LOCAL_EXTRACT)/ccan && find . -maxdepth 2 -name '*.[h]'\
135                                 | sed -e 's,^./,\t,;$$!s,$$, \\,';\
136                 );\
137                 echo "nodist_ccaninclude_HEADERS=ccan_config.h";\
138                 echo "EXTRA_DIST=configurator.c";\
139                 echo "CLEANFILES=configurator ccan_config.h";\
140         ) > $(CCAN_TMP_DEST)/ccan/Makefile.am
142         @echo Extracting the configurator
143         @rsync -av $(CCAN_LOCAL_REPO)/tools/configurator/configurator.c $(CCAN_TMP_DEST)/ccan
145         @echo purge the previous ccan directory
146         cd $(CCAN_DEST) && rm -rf licenses && find ccan -mindepth 1 -type d \! -name ".*" | xargs rm -rf
147         rsync -av $(CCAN_TMP_DEST)/* $(top_srcdir)/hkl