]> git.proxmox.com Git - mirror_corosync.git/blob - Makefile.am
votequorum: set wfa status only on startup
[mirror_corosync.git] / Makefile.am
1 # Copyright (c) 2009 Red Hat, Inc.
2 #
3 # Authors: Andrew Beekhof
4 # Steven Dake (sdake@redhat.com)
5 #
6 # This software licensed under BSD license, the text of which follows:
7 #
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions are met:
10 #
11 # - Redistributions of source code must retain the above copyright notice,
12 # this list of conditions and the following disclaimer.
13 # - Redistributions in binary form must reproduce the above copyright notice,
14 # this list of conditions and the following disclaimer in the documentation
15 # and/or other materials provided with the distribution.
16 # - Neither the name of the MontaVista Software, Inc. nor the names of its
17 # contributors may be used to endorse or promote products derived from this
18 # software without specific prior written permission.
19 #
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 # THE POSSIBILITY OF SUCH DAMAGE.
31
32 SPEC = $(PACKAGE_NAME).spec
33
34 TARFILE = $(PACKAGE_NAME)-$(VERSION).tar.gz
35
36 EXTRA_DIST = autogen.sh $(SPEC).in \
37 build-aux/git-version-gen \
38 build-aux/gitlog-to-changelog \
39 build-aux/release.mk \
40 .version
41
42 ACLOCAL_AMFLAGS = -I m4
43
44 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure depcomp \
45 config.guess config.sub missing install-sh \
46 autoheader automake autoconf test_lense.sh \
47 autoscan.log configure.scan ltmain.sh test-driver
48
49 dist_doc_DATA = LICENSE INSTALL README.recovery AUTHORS
50
51 SUBDIRS = include common_lib lib exec tools test pkgconfig \
52 man init conf vqsim
53
54 coverity:
55 rm -rf cov
56 make clean
57 cov-build --dir=cov make
58 cov-analyze --dir cov \
59 --concurrency \
60 -co BAD_FREE:allow_first_field:true \
61 --security \
62 --wait-for-license
63 cov-format-errors --dir cov
64
65 coverity-aggressive:
66 rm -rf cov
67 make clean
68 cov-build --dir=cov make
69 cov-analyze --dir cov \
70 --concurrency \
71 --all \
72 --aggressiveness-level high \
73 --security \
74 --wait-for-license
75 cov-format-errors --dir cov
76
77 install-exec-local:
78 $(INSTALL) -d $(DESTDIR)/${COROSYSCONFDIR}/service.d
79 $(INSTALL) -d $(DESTDIR)/${COROSYSCONFDIR}/uidgid.d
80 $(INSTALL) -d $(DESTDIR)/${localstatedir}/lib/corosync
81 $(INSTALL) -d $(DESTDIR)/${localstatedir}/log/cluster
82
83 uninstall-local:
84 rmdir $(DESTDIR)/${COROSYSCONFDIR}/service.d || :;
85 rmdir $(DESTDIR)/${COROSYSCONFDIR}/uidgid.d || :;
86 rmdir $(DESTDIR)/${localstatedir}/lib/corosync || :;
87 rmdir $(DESTDIR)/${localstatedir}/log/cluster || :;
88
89 if AUGTOOL
90 check_SCRIPTS = test_lense.sh
91 TESTS = $(check_SCRIPTS)
92
93 test_lense.sh:
94 echo "augparse -I $(srcdir)/conf/lenses/ $(srcdir)/conf/lenses/tests/test_corosync.aug" > $@
95 chmod +x $@
96
97 endif
98
99 lint:
100 for dir in lib exec tools test; do make -C $$dir lint; done
101
102 .PHONY: doxygen
103 doxygen:
104 @if [ "$(DOXYGEN)" = "" ] || [ "$(DOT)" = "" ] ; then \
105 echo "*********************************************" ; \
106 echo "*** ***" ; \
107 echo "*** You must install doxygen and graphviz ***" ; \
108 echo "*** to generate the API documentation. ***" ; \
109 echo "*** ***" ; \
110 echo "*********************************************" ; \
111 exit 1 ; \
112 else \
113 mkdir -p doc/api && $(DOXYGEN) ; \
114 fi
115
116 dist-clean-local:
117 rm -f autoconf automake autoheader test_lense.sh
118
119 clean-generic:
120 rm -rf doc/api $(SPEC) $(TARFILE) test_lense.sh
121
122 ## make rpm/srpm section.
123
124 $(SPEC): $(SPEC).in
125 rm -f $@-t $@
126 date="$(shell LC_ALL=C date "+%a %b %d %Y")" && \
127 if [ -f .tarball-version ]; then \
128 gitver="$(shell cat .tarball-version)" && \
129 rpmver=$$gitver && \
130 alphatag="" && \
131 dirty="" && \
132 numcomm=""; \
133 else \
134 gitver="$(shell git describe --abbrev=4 --match='v*' HEAD 2>/dev/null)" && \
135 rpmver=`echo $$gitver | $(SED) -e "s/^v//" -e "s/-.*//g"` && \
136 alphatag=`echo $$gitver | $(SED) -e "s/.*-//" -e "s/^g//"` && \
137 vtag=`echo $$gitver | $(SED) -e "s/-.*//g"` && \
138 numcomm=`git rev-list $$vtag..HEAD | wc -l` && \
139 git update-index --refresh > /dev/null 2>&1 || true && \
140 dirty=`git diff-index --name-only HEAD 2>/dev/null`; \
141 fi && \
142 if [ "$$numcomm" = "0" ]; then numcomm=""; fi && \
143 if [ -n "$$numcomm" ]; then numcomm="%global numcomm $$numcomm"; fi && \
144 if [ "$$alphatag" = "$$gitver" ]; then alphatag=""; fi && \
145 if [ -n "$$alphatag" ]; then alphatag="%global alphatag $$alphatag"; fi && \
146 if [ -n "$$dirty" ]; then dirty="%global dirty dirty"; fi && \
147 $(SED) \
148 -e "s#@version@#$$rpmver#g" \
149 -e "s#@ALPHATAG@#$$alphatag#g" \
150 -e "s#@NUMCOMM@#$$numcomm#g" \
151 -e "s#@DIRTY@#$$dirty#g" \
152 -e "s#@date@#$$date#g" \
153 $< > $@-t; \
154 chmod a-w $@-t
155 mv $@-t $@
156
157 $(TARFILE):
158 $(MAKE) dist
159
160 RPMBUILDOPTS = --define "_sourcedir $(abs_builddir)" \
161 --define "_specdir $(abs_builddir)" \
162 --define "_builddir $(abs_builddir)" \
163 --define "_srcrpmdir $(abs_builddir)" \
164 --define "_rpmdir $(abs_builddir)"
165
166 srpm: clean
167 $(MAKE) $(SPEC) $(TARFILE)
168 rpmbuild $(WITH_LIST) $(RPMBUILDOPTS) --nodeps -bs $(SPEC)
169
170 rpm: clean _version
171 $(MAKE) $(SPEC) $(TARFILE)
172 rpmbuild $(WITH_LIST) $(RPMBUILDOPTS) -ba $(SPEC)
173
174 # release/versioning
175 BUILT_SOURCES = .version
176 .version:
177 echo $(VERSION) > $@-t && mv $@-t $@
178
179 dist-hook: gen-ChangeLog
180 echo $(VERSION) > $(distdir)/.tarball-version
181
182 gen_start_date = 2000-01-01
183 .PHONY: gen-ChangeLog _version
184 gen-ChangeLog:
185 if test -d .git; then \
186 LC_ALL=C $(top_srcdir)/build-aux/gitlog-to-changelog \
187 --since=$(gen_start_date) > $(distdir)/cl-t; \
188 rm -f $(distdir)/ChangeLog; \
189 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
190 fi
191
192 _version:
193 cd $(srcdir) && rm -rf autom4te.cache .version && autoreconf -i
194 $(MAKE) $(AM_MAKEFLAGS) Makefile
195
196 maintainer-clean-local:
197 rm -rf m4