File: Makefile.am

package info (click to toggle)
hkl 5.0.0.2456-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 37,696 kB
  • sloc: ansic: 25,256; python: 4,325; haskell: 3,794; cpp: 976; makefile: 700; sh: 179; perl: 133; xml: 90; lisp: 54
file content (150 lines) | stat: -rw-r--r-- 4,911 bytes parent folder | download
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
## Process this file with automake to produce Makefile.in

ACLOCAL_AMFLAGS = -I m4
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection --enable-hkl3d

SUBDIRS = hkl
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:
	git clean -xdf
	git fetch
	git checkout next
	cd scripts && ./clean-all
	-git commit -a -m "pre-release"
	git checkout maint
	git merge -m "release" next
	./autogen.sh
	./configure $(AM_DISTCHECK_CONFIGURE_FLAGS)
	$(MAKE)
	$(MAKE) distcheck
	git tag v`./configure -V | head -n 1 | awk '{print $$3}'`
	git checkout next


## lcov part
.PHONY: lcov genlcov lcov-clean release
# 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]'\
				| 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]'\
				| 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