source: trunk/Makefile.am

Last change on this file was 1525, checked in by Peter Johansson, 10 years ago

replace recursive Makefile with one single Makefile. Keeping multiple Makefile.ams which are included into main Makefile.am.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.2 KB
Line 
1## Process this file with automake to produce Makefile.in
2##
3## $Id: Makefile.am 1525 2012-10-01 06:31:07Z peter $
4
5# Copyright (C) 2005, 2006 Jari Häkkinen
6# Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
7# Copyright (C) 2009, 2010, 2011, 2012 Peter Johansson
8#
9# This file is part of svndigest, http://dev.thep.lu.se/svndigest
10#
11# svndigest is free software; you can redistribute it and/or modify it
12# under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 3 of the License, or
14# (at your option) any later version.
15#
16# svndigest is distributed in the hope that it will be useful, but
17# WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19# General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with svndigest. If not, see <http://www.gnu.org/licenses/>.
23
24# -I arg should be the same as arg in AC_CONFIG_MACRO_DIR in configure.ac
25ACLOCAL_AMFLAGS = -I m4
26
27## need to declare these variables here so they can be appended below
28BUILT_SOURCES =
29CLEANFILES =
30CONFIG_STATUS_DEPENDENCIES =
31DISTCLEANFILES =
32EXTRA_DIST =
33MAINTAINERCLEANFILES =
34
35AM_CPPFLAGS = $(SVNDIGEST_CPPFLAGS)
36AM_CXXFLAGS = $(SVNDIGEST_CXXFLAGS)
37AM_LDFLAGS = $(SVNDIGEST_LDFLAGS)
38
39noinst_HEADERS =
40noinst_LIBRARIES =
41
42clean-local:; rm -rf test/testSubDir Fetchdir
43
44include bin/Makefile.am
45include lib/Makefile.am
46include man/Makefile.am
47include test/Makefile.am
48include yat/Makefile.am
49
50include $(top_srcdir)/svn_revision.am
51include $(top_srcdir)/svn_revision_header.am
52
53include $(top_srcdir)/svn_release_year.am
54
55##############################################################
56##
57## Some rules useful for maintainer
58##
59
60include $(srcdir)/maintainer.am
61
62# called within maintainer-check
63## We do wanna run all tests here since test repository is not
64## included in tarball, and thus some tests are skipped in distcheck.
65MAINTAINER_CHECK_LOCAL = check
66## syntax-check called within maintainer-check
67MAINTAINER_CHECK_LOCAL += syntax-check
68# extra check in release rule
69RELEASE_LOCAL = check-svn_revision check-readme check-openssl
70
71.PHONY: check-svn_revision check-openssl
72
73FORCE:
74
75check-openssl:
76  @openssl version > /dev/null || exit 1
77
78check-svn_revision:
79  @$(SVNVERSION) | $(EGREP) '^[0-9]+$$' || \
80  { echo incorrect svn revision - expected single unmodified revision 1>&2; \
81    exit 1; }
82
83check-readme:
84  (ver_am=1.11\
85  && $(GREP) "AM_INIT_AUTOMAKE.*$$ver_am" $(srcdir)/configure.ac \
86  && $(GREP) "Automake $$ver_am" $(srcdir)/README.developer)>/dev/null || exit 1
87  (ver_ac=2.63\
88  && $(GREP) "AC_PREREQ.*$$ver_ac" $(srcdir)/configure.ac \
89  && $(GREP) "Autoconf $$ver_ac" $(srcdir)/README.developer)>/dev/null || exit 1
90
91
92
93# run in end of release target
94RELEASE_HOOK = build_support/Portfile.diff
95
96macport_url = http://svn.macports.org/repository/macports/trunk/dports/devel/svndigest
97
98build_support/Portfile.diff: build_support/Portfile FORCE
99  test -e build_support/macport \
100  || svn co $(macport_url) build_support/macport
101  svn revert -R build_support/macport
102  svn update build_support/macport
103  cp build_support/Portfile build_support/macport/Portfile
104  svn diff build_support/macport/Portfile > $@
105  svn revert build_support/macport/Portfile
106
107edit = $(SED) \
108  -e 's|@PACKAGE_URL[@]|$(PACKAGE_URL)|g' \
109  -e 's|@VERSION[@]|$(VERSION)|g'
110
111build_support/Portfile: $(distdir).tar.gz Makefile build_support/Portfile.in check-openssl
112  @rm -f $@ $@.t
113  @openssl sha256 $(distdir).tar.gz > $(distdir).tar.gz.sha256
114  @openssl rmd160 $(distdir).tar.gz > $(distdir).tar.gz.rmd160
115  @sha256=`cut -f 2 -d ' ' $(distdir).tar.gz.sha256`;\
116  rmd160=`cut -f 2 -d ' ' $(distdir).tar.gz.rmd160`;\
117  $(edit) -e "s|@SHA256SUM[@]|$$sha256|g" \
118  -e "s|@RMD160SUM[@]|$$rmd160|g" \
119  '$(srcdir)/build_support/Portfile.in' > $@.t
120  @chmod a-w $@.t
121  @mv $@.t $@
122  @echo "creating $@"
123
124STABLE_VERSION = $(SVNDIGEST_MAJOR_VERSION).$(SVNDIGEST_MINOR_VERSION)
125STABLE_BRANCH = ^/branches/$(STABLE_VERSION)-stable
126
127# create a tag from current stable branch; depends on check-version to
128# ensure that version is macro.minor.micro (no pre suffix), that wc is
129# pristine and updated.
130svn-tag: check-version check-svn-diff
131  svn copy $(STABLE_BRANCH) ^/tags/$(VERSION) \
132  -m "tagging version $(VERSION)"
133
134# create a stable-branch from trunk
135svn-stable-branch: check-svn-diff all
136  svn copy ^/trunk $(STABLE_BRANCH) \
137  -m "New stable branch $(STABLE_VERSION)" \
138  && svn co $(STABLE_BRANCH) ../svndigest-$(STABLE_VERSION).x \
139  && bin/svndigest-copy-cache -v -t ../svndigest-$(STABLE_VERSION).x
140
141syntax-check: assert-header-without-use \
142  assert-without-header \
143  errno-header-without-use
144
145assert-header-without-use:
146  @files=`grep -l "^#include *<cassert>" $(srcdir)/*/*.cc`;\
147  grep -L "assert *(" $$files | grep $(srcdir) && \
148  { echo "$@: in files listed above"; exit 1; } || :;
149
150assert-without-header:
151  @files=`grep -l "assert *(" $(srcdir)/*/*.cc`;\
152  grep -L "^#include *<cassert>" $$files | grep $(srcdir) && \
153  { echo "$@: in files listed above"; exit 1; } || :;
154
155errno-header-without-use:
156  @files=`grep -l "^#include *<cerrno>" $(srcdir)/*/*.cc`;\
157  test -n "$$files" || exit 0;\
158  grep -LE "[^ \t\(=]errno" $$files | grep $(srcdir) && \
159  { echo "$@: in files listed above"; exit 1; } || :;
Note: See TracBrowser for help on using the repository browser.