1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
|
## Process this file with automake to produce Makefile.in
ACLOCAL_AMFLAGS = -I m4
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection --enable-hkl3d --enable-binoculars
SUBDIRS = . hkl third-party
if BINOCULARS
SUBDIRS += binoculars-ng
endif
if HKL3D
SUBDIRS += hkl3d data
endif
SUBDIRS += tests
if GUI
SUBDIRS += gui
endif
if HKL_DOC
SUBDIRS += Documentation
endif
if CONTRIB
SUBDIRS += contrib
endif
EXTRA_DIST = hkl.pc.in hkl3d.pc.in
installed_mainheaderdir = $(includedir)/hkl-@VMAJ@
dist_installed_mainheader_DATA = hkl.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = hkl.pc
if HKL3D
#for not do not install
noinst_DATA = hkl3d.pc
endif
release:
# cd scripts && ./clean-all
# -git commit -a -m "pre-release"
sed -i -e "s,dnl m4_undefine(\[v_rev\]),m4_undefine(\[v_rev\]),g" configure.ac
./autogen.sh
./configure $(AM_DISTCHECK_CONFIGURE_FLAGS)
$(MAKE) -j
$(MAKE) distcheck
git commit -a -m "released $(./configure -V | head -n 1 | awk '{print $$3}')"
git tag v`./configure -V | head -n 1 | awk '{print $$3}'`
sed -i -e "s,m4_undefine(\[v_rev\]),dnl m4_undefine(\[v_rev\]),g" configure.ac
git commit -a -m "post-release"
tag:
git tag v`./configure -V | head -n 1 | awk '{print $$3}'`
## lcov part
.PHONY: lcov genlcov lcov-clean release tag
# use recursive makes in order to ignore errors during check
lcov:
-$(MAKE) $(AM_MAKEFLAGS) -k check
$(MAKE) $(AM_MAKEFLAGS) genlcov
# we have to massage the lcov.info file slightly to hide the effect of libtool
# placing the objects files in the .libs/ directory separate from the *.c
# we also have to delete tests/.libs/*.gcda
genlcov:
rm -f $(top_builddir)/test/hkl/.libs/*.gcda
$(LTP) --directory $(top_builddir) --capture --output-file hkl-lcov.info --test-name hkl-lcov --no-checksum --compat-libtool
LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory hkl-lcov --title "hkl Code Coverage" --legend --show-details hkl-lcov.info
lcov-clean:
-$(LTP) --directory $(top_builddir) -z
-rm -rf hkl-lcov.info hkl-lcov
-find -name '*.gcda' -print | xargs rm
-find -name '*.gcno' -print | xargs rm
distclean-local: lcov-clean
## Generate the Changelog file for the distribution.
dist-hook:
@if test -d "$(srcdir)/.git"; \
then \
echo Creating ChangeLog && \
( cd "$(top_srcdir)" && \
echo '# Generated by Makefile. Do not edit.'; echo; \
$(top_srcdir)/config/missing --run git log --stat ) > ChangeLog.tmp \
&& mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
|| ( rm -f ChangeLog.tmp ; \
echo Failed to generate ChangeLog >&2 ); \
else \
echo A git clone is required to generate a ChangeLog >&2; \
fi
## Update the ccan library
CCAN_PUBLIC_MODULES=darray
CCAN_PRIVATE_MODULES=array_size container_of autodata list generator
CCAN_LOCAL_REPO=/tmp/ccan
CCAN_LOCAL_EXTRACT=/tmp/ccan.tmp
CCAN_URL=https://github.com/rustyrussell/ccan.git
CCAN_CREATE_TREE=rm -rf $(CCAN_LOCAL_EXTRACT) && cd $(CCAN_LOCAL_REPO) && tools/create-ccan-tree -b automake $(CCAN_LOCAL_EXTRACT)
CCAN_DEST=$(top_srcdir)/hkl/
CCAN_TMP_DEST=/tmp/ccan.next
ccan-update:
@if test -d $(CCAN_LOCAL_REPO); \
then \
cd $(CCAN_LOCAL_REPO) && git pull; \
else \
git clone $(CCAN_URL) $(CCAN_LOCAL_REPO); \
fi
@echo Extracting all the modules
@$(CCAN_CREATE_TREE) $(CCAN_PUBLIC_MODULES) $(CCAN_PRIVATE_MODULES)
@rm -rf $(CCAN_TMP_DEST) && mkdir -p $(CCAN_TMP_DEST)
@rsync -av --exclude=Makefile.am $(CCAN_LOCAL_EXTRACT)/* $(CCAN_TMP_DEST)
@find $(CCAN_TMP_DEST)/ccan -maxdepth 2 -name '*.[ch]' | xargs sed -i -e 's,ccan/,hkl/ccan/,'
@find $(CCAN_TMP_DEST)/ccan -maxdepth 2 -name '*.[ch]' | xargs sed -i -e 's,"config.h",<hkl/ccan/ccan_config.h>,'
@find $(CCAN_TMP_DEST)/ccan -maxdepth 2 -name '_info' | xargs rm -f
@find $(CCAN_TMP_DEST)/ccan -maxdepth 2 -name 'test' | xargs rm -rf
@$(CCAN_CREATE_TREE) $(CCAN_PUBLIC_MODULES)
@echo Generating the Makefile.am
@(\
echo "AM_CFLAGS=-I\$$(top_srcdir)"; echo;\
echo "noinst_PROGRAMS=configurator";\
echo "BUILT_SOURCES=ccan_config.h";\
echo "ccan_config.h: configurator";\
(\
echo -e "\t\$$(builddir)/configurator \$$(CC) \$$(CCAN_CFLAGS) > \$$@.tmp && mv \$$@.tmp \$$@";\
);\
echo "noinst_LTLIBRARIES=libccan.la";\
echo "libccan_la_SOURCES = \\";\
(\
echo -e "\tccan_config.h \\";\
cd $(CCAN_TMP_DEST)/ccan && find . -maxdepth 2 -name '*.[ch]'\
| sort\
| sed -e 's,^./,\t,;$$!s,$$, \\,'; echo;\
);\
echo "ccanincludedir=\$$(includedir)/hkl-@""VMAJ@/hkl/ccan";\
echo "nobase_ccaninclude_HEADERS= \\";\
(\
cd $(CCAN_LOCAL_EXTRACT)/ccan && find . -maxdepth 2 -name '*.[h]'\
| sort\
| sed -e 's,^./,\t,;$$!s,$$, \\,';\
);\
echo "nodist_ccaninclude_HEADERS=ccan_config.h";\
echo "EXTRA_DIST=configurator.c";\
echo "CLEANFILES=configurator ccan_config.h";\
) > $(CCAN_TMP_DEST)/ccan/Makefile.am
@echo Extracting the configurator
@rsync -av $(CCAN_LOCAL_REPO)/tools/configurator/configurator.c $(CCAN_TMP_DEST)/ccan
@echo purge the previous ccan directory
cd $(CCAN_DEST) && rm -rf licenses && find ccan -mindepth 1 -type d \! -name ".*" | xargs rm -rf
rsync -av $(CCAN_TMP_DEST)/* $(top_srcdir)/hkl
## Update the metalang99 library
METALANG99_LOCAL_REPO=/tmp/metalang99
METALANG99_URL=https://github.com/Hirrolot/metalang99
METALANG99_DEST=$(top_srcdir)/third-party
metalang99-update:
@if [ -d $(METALANG99_LOCAL_REPO) ]; \
then \
cd $(METALANG99_LOCAL_REPO) && git pull; \
else \
git clone $(METALANG99_URL) $(METALANG99_LOCAL_REPO); \
fi
@echo Extracting all the modules
@rsync -av $(METALANG99_LOCAL_REPO)/include/* $(METALANG99_DEST)
@echo Generating the Makefile.am
@(\
echo "EXTRA_DIST= \\";\
(\
cd $(METALANG99_DEST) && find . -name '*.[h]'\
| sort\
| sed -e 's,^./,\t,;$$!s,$$, \\,';\
);\
) > $(METALANG99_DEST)/Makefile.am
@echo Added all files to git
git add $(METALANG99_DEST)
## Update the datatype99 library
DATATYPE99_LOCAL_REPO=/tmp/datatype99
DATATYPE99_URL=https://github.com/Hirrolot/datatype99
DATATYPE99_DEST=$(top_srcdir)/third-party
datatype99-update:
@if [ -d $(DATATYPE99_LOCAL_REPO) ]; \
then \
cd $(DATATYPE99_LOCAL_REPO) && git pull; \
else \
git clone $(DATATYPE99_URL) $(DATATYPE99_LOCAL_REPO); \
fi
@echo Extracting all the modules
@rsync -av $(DATATYPE99_LOCAL_REPO)/*.h $(DATATYPE99_DEST)
@echo Generating the Makefile.am
@(\
echo "EXTRA_DIST= \\";\
(\
cd $(METALANG99_DEST) && find . -name '*.[h]'\
| sort\
| sed -e 's,^./,\t,;$$!s,$$, \\,';\
);\
) > $(METALANG99_DEST)/Makefile.am
@echo Added all files to git
git add $(METALANG99_DEST)
|