]>
Commit | Line | Data |
---|---|---|
0bc9cd90 | 1 | # Copyright (c) 2009 Red Hat, Inc. |
904a10ed | 2 | # |
0bc9cd90 SD |
3 | # Authors: Andrew Beekhof |
4 | # Steven Dake (sdake@redhat.com) | |
5 | # | |
95f17845 | 6 | # This software licensed under BSD license, the text of which follows: |
904a10ed | 7 | # |
95f17845 JC |
8 | # Redistribution and use in source and binary forms, with or without |
9 | # modification, are permitted provided that the following conditions are met: | |
904a10ed | 10 | # |
95f17845 JC |
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. | |
95f17845 | 31 | |
b5fc4494 FDN |
32 | SPEC = $(PACKAGE_NAME).spec |
33 | ||
34 | TARFILE = $(PACKAGE_NAME)-$(VERSION).tar.gz | |
35 | ||
ab9986cb | 36 | EXTRA_DIST = autogen.sh $(SPEC).in \ |
b2400314 FDN |
37 | build-aux/git-version-gen \ |
38 | build-aux/gitlog-to-changelog \ | |
39 | build-aux/release.mk \ | |
ab9986cb | 40 | .version |
b5fc4494 | 41 | |
0bc9cd90 | 42 | AUTOMAKE_OPTIONS = foreign |
95f17845 | 43 | |
76d18f96 FDN |
44 | ACLOCAL_AMFLAGS = -I m4 |
45 | ||
b5fc4494 | 46 | MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure depcomp \ |
90c2df58 | 47 | config.guess config.sub missing install-sh \ |
76d18f96 FDN |
48 | autoheader automake autoconf test_lense.sh \ |
49 | autoscan.log configure.scan ltmain.sh | |
95f17845 | 50 | |
bf3a0ad5 | 51 | dist_doc_DATA = LICENSE INSTALL README.recovery SECURITY TODO AUTHORS |
17658c56 | 52 | |
da483b81 | 53 | SUBDIRS = include common_lib lib exec tools test cts pkgconfig \ |
d8995ce3 | 54 | man init conf qdevices |
95f17845 | 55 | |
89905248 | 56 | coverity: |
135d2337 JF |
57 | rm -rf cov |
58 | make clean | |
59 | cov-build --dir=cov make | |
60 | cov-analyze --dir cov \ | |
61 | --concurrency \ | |
62 | -co BAD_FREE:allow_first_field:true \ | |
63 | --security \ | |
64 | --wait-for-license | |
65 | cov-format-errors --dir cov | |
66 | ||
67 | coverity-aggressive: | |
aca9ebc1 FDN |
68 | rm -rf cov |
69 | make clean | |
89905248 | 70 | cov-build --dir=cov make |
aca9ebc1 FDN |
71 | cov-analyze --dir cov \ |
72 | --concurrency \ | |
73 | --all \ | |
74 | --aggressiveness-level high \ | |
75 | --security \ | |
76 | --wait-for-license | |
89905248 SD |
77 | cov-format-errors --dir cov |
78 | ||
f6c40a85 | 79 | install-exec-local: |
b7ebf110 | 80 | $(INSTALL) -d $(DESTDIR)/${COROSYSCONFDIR}/service.d |
2135d91c | 81 | $(INSTALL) -d $(DESTDIR)/${COROSYSCONFDIR}/uidgid.d |
f6c40a85 | 82 | $(INSTALL) -d $(DESTDIR)/${localstatedir}/lib/corosync |
171fa9a1 | 83 | $(INSTALL) -d $(DESTDIR)/${localstatedir}/log/cluster |
f6c40a85 FDN |
84 | |
85 | uninstall-local: | |
b7ebf110 | 86 | rmdir $(DESTDIR)/${COROSYSCONFDIR}/service.d || :; |
2135d91c | 87 | rmdir $(DESTDIR)/${COROSYSCONFDIR}/uidgid.d || :; |
f6c40a85 | 88 | rmdir $(DESTDIR)/${localstatedir}/lib/corosync || :; |
171fa9a1 | 89 | rmdir $(DESTDIR)/${localstatedir}/log/cluster || :; |
f6c40a85 | 90 | |
9e21960b | 91 | if AUGTOOL |
b3a29520 AS |
92 | check_SCRIPTS = test_lense.sh |
93 | TESTS = $(check_SCRIPTS) | |
94 | ||
95 | test_lense.sh: | |
96 | echo "augparse -I $(srcdir)/conf/lenses/ $(srcdir)/conf/lenses/tests/test_corosync.aug" > $@ | |
97 | chmod +x $@ | |
98 | ||
9e21960b AS |
99 | endif |
100 | ||
0bc9cd90 | 101 | lint: |
75bc06d9 | 102 | for dir in lib exec tools test; do make -C $$dir lint; done |
95f17845 | 103 | |
8ed864dd | 104 | .PHONY: doxygen |
0bc9cd90 | 105 | doxygen: |
8ed864dd RB |
106 | @if [ "$(DOXYGEN)" = "" ] || [ "$(DOT)" = "" ] ; then \ |
107 | echo "*********************************************" ; \ | |
108 | echo "*** ***" ; \ | |
109 | echo "*** You must install doxygen and graphviz ***" ; \ | |
110 | echo "*** to generate the API documentation. ***" ; \ | |
111 | echo "*** ***" ; \ | |
112 | echo "*********************************************" ; \ | |
113 | exit 1 ; \ | |
114 | else \ | |
115 | mkdir -p doc/api && $(DOXYGEN) ; \ | |
116 | fi | |
95f17845 | 117 | |
0bc9cd90 | 118 | dist-clean-local: |
c8cdc2e2 | 119 | rm -f autoconf automake autoheader test_lense.sh |
95f17845 | 120 | |
0bc9cd90 | 121 | clean-generic: |
c8cdc2e2 | 122 | rm -rf doc/api $(SPEC) $(TARFILE) test_lense.sh |
b5fc4494 FDN |
123 | |
124 | ## make rpm/srpm section. | |
125 | ||
126 | $(SPEC): $(SPEC).in | |
127 | rm -f $@-t $@ | |
b8809eaf | 128 | date="$(shell LC_ALL=C date "+%a %b %d %Y")" && \ |
bafb69bf FDN |
129 | if [ -f .tarball-version ]; then \ |
130 | gitver="$(shell cat .tarball-version)" && \ | |
131 | rpmver=$$gitver && \ | |
132 | alphatag="" && \ | |
133 | dirty="" && \ | |
ae96f61a | 134 | numcomm=""; \ |
bafb69bf FDN |
135 | else \ |
136 | gitver="$(shell git describe --abbrev=4 --match='v*' HEAD 2>/dev/null)" && \ | |
137 | rpmver=`echo $$gitver | sed -e "s/^v//" -e "s/-.*//g"` && \ | |
138 | alphatag=`echo $$gitver | sed -e "s/.*-//" -e "s/^g//"` && \ | |
139 | vtag=`echo $$gitver | sed -e "s/-.*//g"` && \ | |
140 | numcomm=`git rev-list $$vtag..HEAD | wc -l` && \ | |
141 | git update-index --refresh > /dev/null 2>&1 || true && \ | |
142 | dirty=`git diff-index --name-only HEAD 2>/dev/null`; \ | |
143 | fi && \ | |
ae96f61a FDN |
144 | if [ "$$numcomm" = "0" ]; then numcomm=""; fi && \ |
145 | if [ -n "$$numcomm" ]; then numcomm="%global numcomm $$numcomm"; fi && \ | |
146 | if [ "$$alphatag" = "$$gitver" ]; then alphatag=""; fi && \ | |
147 | if [ -n "$$alphatag" ]; then alphatag="%global alphatag $$alphatag"; fi && \ | |
148 | if [ -n "$$dirty" ]; then dirty="%global dirty dirty"; fi && \ | |
149 | sed \ | |
150 | -e "s#@version@#$$rpmver#g" \ | |
151 | -e "s#@ALPHATAG@#$$alphatag#g" \ | |
152 | -e "s#@NUMCOMM@#$$numcomm#g" \ | |
153 | -e "s#@DIRTY@#$$dirty#g" \ | |
154 | -e "s#@date@#$$date#g" \ | |
155 | $< > $@-t; \ | |
b5fc4494 FDN |
156 | chmod a-w $@-t |
157 | mv $@-t $@ | |
158 | ||
159 | $(TARFILE): | |
160 | $(MAKE) dist | |
161 | ||
162 | RPMBUILDOPTS = --define "_sourcedir $(abs_builddir)" \ | |
163 | --define "_specdir $(abs_builddir)" \ | |
164 | --define "_builddir $(abs_builddir)" \ | |
165 | --define "_srcrpmdir $(abs_builddir)" \ | |
166 | --define "_rpmdir $(abs_builddir)" | |
167 | ||
168 | srpm: clean | |
169 | $(MAKE) $(SPEC) $(TARFILE) | |
522b94de | 170 | rpmbuild $(WITH_LIST) $(RPMBUILDOPTS) --nodeps -bs $(SPEC) |
b5fc4494 | 171 | |
fc3de6c8 | 172 | rpm: clean _version |
b5fc4494 | 173 | $(MAKE) $(SPEC) $(TARFILE) |
522b94de | 174 | rpmbuild $(WITH_LIST) $(RPMBUILDOPTS) -ba $(SPEC) |
b2400314 FDN |
175 | |
176 | # release/versioning | |
177 | BUILT_SOURCES = .version | |
178 | .version: | |
179 | echo $(VERSION) > $@-t && mv $@-t $@ | |
180 | ||
181 | dist-hook: gen-ChangeLog | |
182 | echo $(VERSION) > $(distdir)/.tarball-version | |
183 | ||
184 | gen_start_date = 2000-01-01 | |
fc3de6c8 | 185 | .PHONY: gen-ChangeLog _version |
b2400314 FDN |
186 | gen-ChangeLog: |
187 | if test -d .git; then \ | |
b8809eaf | 188 | LC_ALL=C $(top_srcdir)/build-aux/gitlog-to-changelog \ |
b2400314 FDN |
189 | --since=$(gen_start_date) > $(distdir)/cl-t; \ |
190 | rm -f $(distdir)/ChangeLog; \ | |
191 | mv $(distdir)/cl-t $(distdir)/ChangeLog; \ | |
192 | fi | |
fc3de6c8 SD |
193 | |
194 | _version: | |
195 | cd $(srcdir) && rm -rf autom4te.cache .version && autoreconf -i | |
196 | $(MAKE) $(AM_MAKEFLAGS) Makefile | |
76d18f96 FDN |
197 | |
198 | maintainer-clean-local: | |
199 | rm -rf m4 |