## Process this file with automake to produce Makefile.in
##
## $Id: Makefile.am 1495 2012-08-27 04:06:43Z peter $
# Copyright (C) 2005, 2006 Jari Häkkinen
# Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
# Copyright (C) 2009, 2010, 2011, 2012 Peter Johansson
#
# This file is part of svndigest, http://dev.thep.lu.se/svndigest
#
# svndigest is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# svndigest is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with svndigest. If not, see .
# -I arg should be the same as arg in AC_CONFIG_MACRO_DIR in configure.ac
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = yat lib bin man test
lazycheck recheck: all
cd test && $(MAKE) $(AM_MAKEFLAGS) $@
clean-local:
rm -rf svndigest *~
.PHONY: recheck
## need to declare these variables here so they can be appended below
BUILT_SOURCES =
CLEANFILES =
CONFIG_STATUS_DEPENDENCIES =
DISTCLEANFILES =
EXTRA_DIST =
include $(top_srcdir)/svn_revision.am
include $(top_srcdir)/svn_revision_header.am
include $(top_srcdir)/svn_release_year.am
##############################################################
##
## Some rules useful for maintainer
##
include $(srcdir)/maintainer.am
# called within maintainer-check
## We do wanna run all tests here since test repository is not
## included in tarball, and thus some tests are skipped in distcheck.
MAINTAINER_CHECK_LOCAL = check
## syntax-check called within maintainer-check
MAINTAINER_CHECK_LOCAL += syntax-check
# extra check in release rule
RELEASE_LOCAL = check-svn_revision check-readme check-openssl
.PHONY: check-svn_revision check-openssl
FORCE:
check-openssl:
@openssl version > /dev/null || exit 1
check-svn_revision:
@$(SVNVERSION) | $(EGREP) '^[0-9]+$$' || \
{ echo incorrect svn revision - expected single unmodified revision 1>&2; \
exit 1; }
check-readme:
(ver_am=1.11\
&& $(GREP) "AM_INIT_AUTOMAKE.*$$ver_am" $(srcdir)/configure.ac \
&& $(GREP) "Automake $$ver_am" $(srcdir)/README.developer)>/dev/null || exit 1
(ver_ac=2.63\
&& $(GREP) "AC_PREREQ.*$$ver_ac" $(srcdir)/configure.ac \
&& $(GREP) "Autoconf $$ver_ac" $(srcdir)/README.developer)>/dev/null || exit 1
# run in end of release target
RELEASE_HOOK = build_support/Portfile.diff
macport_url = http://svn.macports.org/repository/macports/trunk/dports/devel/svndigest
build_support/Portfile.diff: build_support/Portfile FORCE
test -e build_support/macport \
|| svn co $(macport_url) build_support/macport
svn revert -R build_support/macport
svn update build_support/macport
cp build_support/Portfile build_support/macport/Portfile
svn diff build_support/macport/Portfile > $@
svn revert build_support/macport/Portfile
edit = $(SED) \
-e 's|@PACKAGE_URL[@]|$(PACKAGE_URL)|g' \
-e 's|@VERSION[@]|$(VERSION)|g'
build_support/Portfile: $(distdir).tar.gz Makefile build_support/Portfile.in check-openssl
@rm -f $@ $@.t
@openssl sha256 $(distdir).tar.gz > $(distdir).tar.gz.sha256
@openssl rmd160 $(distdir).tar.gz > $(distdir).tar.gz.rmd160
@sha256=`cut -f 2 -d ' ' $(distdir).tar.gz.sha256`;\
rmd160=`cut -f 2 -d ' ' $(distdir).tar.gz.rmd160`;\
$(edit) -e "s|@SHA256SUM[@]|$$sha256|g" \
-e "s|@RMD160SUM[@]|$$rmd160|g" \
'$(srcdir)/build_support/Portfile.in' > $@.t
@chmod a-w $@.t
@mv $@.t $@
@echo "creating $@"
STABLE_VERSION = $(SVNDIGEST_MAJOR_VERSION).$(SVNDIGEST_MINOR_VERSION)
STABLE_BRANCH = ^/branches/$(STABLE_VERSION)-stable
# create a tag from current stable branch; depends on check-version to
# ensure that version is macro.minor.micro (no pre suffix), that wc is
# pristine and updated.
svn-tag: check-version check-svn-diff
svn copy $(STABLE_BRANCH) ^/tags/$(VERSION) \
-m "tagging version $(VERSION)"
# create a stable-branch from trunk
svn-stable-branch: check-svn-diff all
svn copy ^/trunk $(STABLE_BRANCH) \
-m "New stable branch $(STABLE_VERSION)" \
&& svn co $(STABLE_BRANCH) ../svndigest-$(STABLE_VERSION).x \
&& bin/svndigest-copy-cache -v -t ../svndigest-$(STABLE_VERSION).x
syntax-check: assert-header-without-use \
assert-without-header \
errno-header-without-use
assert-header-without-use:
@files=`grep -l "^#include *" $(srcdir)/*/*.cc`;\
grep -L "assert *(" $$files | grep $(srcdir) && \
{ echo "$@: in files listed above"; exit 1; } || :;
assert-without-header:
@files=`grep -l "assert *(" $(srcdir)/*/*.cc`;\
grep -L "^#include *" $$files | grep $(srcdir) && \
{ echo "$@: in files listed above"; exit 1; } || :;
errno-header-without-use:
@files=`grep -l "^#include *" $(srcdir)/*/*.cc`;\
test -n "$$files" || exit 0;\
grep -LE "[^ \t\(=]errno" $$files | grep $(srcdir) && \
{ echo "$@: in files listed above"; exit 1; } || :;