Advertisement
Guest User

Untitled

a guest
May 31st, 2013
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.26 KB | None | 0 0
  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. AUTOMAKE_OPTIONS = foreign
  43.  
  44. ACLOCAL_AMFLAGS = -I m4
  45.  
  46. MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure depcomp \
  47. config.guess config.sub missing install-sh \
  48. autoheader automake autoconf test_lense.sh \
  49. autoscan.log configure.scan ltmain.sh
  50.  
  51. dist_doc_DATA = LICENSE INSTALL README.recovery SECURITY TODO AUTHORS
  52.  
  53. SUBDIRS = include common_lib lib exec tools test cts pkgconfig \
  54. man init conf qdevices
  55.  
  56. coverity:
  57. rm -rf cov
  58. make clean
  59. cov-build --dir=cov make
  60. cov-analyze --dir cov \
  61. --concurrency \
  62. --all \
  63. --aggressiveness-level high \
  64. --security \
  65. --wait-for-license
  66. cov-format-errors --dir cov
  67.  
  68. install-exec-local:
  69. $(INSTALL) -d $(DESTDIR)/${COROSYSCONFDIR}/service.d
  70. $(INSTALL) -d $(DESTDIR)/${COROSYSCONFDIR}/uidgid.d
  71. $(INSTALL) -d $(DESTDIR)/${localstatedir}/lib/corosync
  72. $(INSTALL) -d $(DESTDIR)/${localstatedir}/log/cluster
  73.  
  74. uninstall-local:
  75. rmdir $(DESTDIR)/${COROSYSCONFDIR}/service.d || :;
  76. rmdir $(DESTDIR)/${COROSYSCONFDIR}/uidgid.d || :;
  77. rmdir $(DESTDIR)/${localstatedir}/lib/corosync || :;
  78. rmdir $(DESTDIR)/${localstatedir}/log/cluster || :;
  79.  
  80. if AUGTOOL
  81. check_SCRIPTS = test_lense.sh
  82. TESTS = $(check_SCRIPTS)
  83.  
  84. test_lense.sh:
  85. echo "augparse -I $(srcdir)/conf/lenses/ $(srcdir)/conf/lenses/tests/test_corosync.aug" > $@
  86. chmod +x $@
  87.  
  88. endif
  89.  
  90. lint:
  91. for dir in lib exec tools test; do make -C $$dir lint; done
  92.  
  93. .PHONY: doxygen
  94. doxygen:
  95. @if [ "$(DOXYGEN)" = "" ] || [ "$(DOT)" = "" ] ; then \
  96. echo "*********************************************" ; \
  97. echo "*** ***" ; \
  98. echo "*** You must install doxygen and graphviz ***" ; \
  99. echo "*** to generate the API documentation. ***" ; \
  100. echo "*** ***" ; \
  101. echo "*********************************************" ; \
  102. exit 1 ; \
  103. else \
  104. mkdir -p doc/api && $(DOXYGEN) ; \
  105. fi
  106.  
  107. dist-clean-local:
  108. rm -f autoconf automake autoheader test_lense.sh
  109.  
  110. clean-generic:
  111. rm -rf doc/api $(SPEC) $(TARFILE) test_lense.sh
  112.  
  113. ## make rpm/srpm section.
  114.  
  115. $(SPEC): $(SPEC).in
  116. rm -f $@-t $@
  117. date="$(shell LC_ALL=C date "+%a %b %d %Y")" && \
  118. if [ -f .tarball-version ]; then \
  119. gitver="$(shell cat .tarball-version)" && \
  120. rpmver=$$gitver && \
  121. alphatag="" && \
  122. dirty="" && \
  123. numcomm=""; \
  124. else \
  125. gitver="$(shell git describe --abbrev=4 --match='v*' HEAD 2>/dev/null)" && \
  126. rpmver=`echo $$gitver | sed -e "s/^v//" -e "s/-.*//g"` && \
  127. alphatag=`echo $$gitver | sed -e "s/.*-//" -e "s/^g//"` && \
  128. vtag=`echo $$gitver | sed -e "s/-.*//g"` && \
  129. numcomm=`git rev-list $$vtag..HEAD | wc -l` && \
  130. git update-index --refresh > /dev/null 2>&1 || true && \
  131. dirty=`git diff-index --name-only HEAD 2>/dev/null`; \
  132. fi && \
  133. if [ "$$numcomm" = "0" ]; then numcomm=""; fi && \
  134. if [ -n "$$numcomm" ]; then numcomm="%global numcomm $$numcomm"; fi && \
  135. if [ "$$alphatag" = "$$gitver" ]; then alphatag=""; fi && \
  136. if [ -n "$$alphatag" ]; then alphatag="%global alphatag $$alphatag"; fi && \
  137. if [ -n "$$dirty" ]; then dirty="%global dirty dirty"; fi && \
  138. sed \
  139. -e "s#@version@#$$rpmver#g" \
  140. -e "s#@ALPHATAG@#$$alphatag#g" \
  141. -e "s#@NUMCOMM@#$$numcomm#g" \
  142. -e "s#@DIRTY@#$$dirty#g" \
  143. -e "s#@date@#$$date#g" \
  144. $< > $@-t; \
  145. chmod a-w $@-t
  146. mv $@-t $@
  147.  
  148. $(TARFILE):
  149. $(MAKE) dist
  150.  
  151. RPMBUILDOPTS = --define "_sourcedir $(abs_builddir)" \
  152. --define "_specdir $(abs_builddir)" \
  153. --define "_builddir $(abs_builddir)" \
  154. --define "_srcrpmdir $(abs_builddir)" \
  155. --define "_rpmdir $(abs_builddir)"
  156.  
  157. srpm: clean
  158. $(MAKE) $(SPEC) $(TARFILE)
  159. rpmbuild $(WITH_LIST) $(RPMBUILDOPTS) --nodeps -bs $(SPEC)
  160.  
  161. rpm: clean _version
  162. $(MAKE) $(SPEC) $(TARFILE)
  163. rpmbuild $(WITH_LIST) $(RPMBUILDOPTS) -ba $(SPEC)
  164.  
  165. # release/versioning
  166. BUILT_SOURCES = .version
  167. .version:
  168. echo $(VERSION) > $@-t && mv $@-t $@
  169.  
  170. dist-hook: gen-ChangeLog
  171. echo $(VERSION) > $(distdir)/.tarball-version
  172.  
  173. gen_start_date = 2000-01-01
  174. .PHONY: gen-ChangeLog _version
  175. gen-ChangeLog:
  176. if test -d .git; then \
  177. LC_ALL=C $(top_srcdir)/build-aux/gitlog-to-changelog \
  178. --since=$(gen_start_date) > $(distdir)/cl-t; \
  179. rm -f $(distdir)/ChangeLog; \
  180. mv $(distdir)/cl-t $(distdir)/ChangeLog; \
  181. fi
  182.  
  183. _version:
  184. cd $(srcdir) && rm -rf autom4te.cache .version && autoreconf -i
  185. $(MAKE) $(AM_MAKEFLAGS) Makefile
  186.  
  187. maintainer-clean-local:
  188. rm -rf m4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement