1 | ## Process this file with automake to produce Makefile.in |
---|
2 | ## |
---|
3 | ## $Id: Makefile.am 1495 2012-08-27 04:06:43Z 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 |
---|
25 | ACLOCAL_AMFLAGS = -I m4 |
---|
26 | |
---|
27 | SUBDIRS = yat lib bin man test |
---|
28 | |
---|
29 | |
---|
30 | lazycheck recheck: all |
---|
31 | cd test && $(MAKE) $(AM_MAKEFLAGS) $@ |
---|
32 | |
---|
33 | clean-local: |
---|
34 | rm -rf svndigest *~ |
---|
35 | |
---|
36 | .PHONY: recheck |
---|
37 | |
---|
38 | ## need to declare these variables here so they can be appended below |
---|
39 | BUILT_SOURCES = |
---|
40 | CLEANFILES = |
---|
41 | CONFIG_STATUS_DEPENDENCIES = |
---|
42 | DISTCLEANFILES = |
---|
43 | EXTRA_DIST = |
---|
44 | |
---|
45 | include $(top_srcdir)/svn_revision.am |
---|
46 | include $(top_srcdir)/svn_revision_header.am |
---|
47 | |
---|
48 | include $(top_srcdir)/svn_release_year.am |
---|
49 | |
---|
50 | ############################################################## |
---|
51 | ## |
---|
52 | ## Some rules useful for maintainer |
---|
53 | ## |
---|
54 | |
---|
55 | include $(srcdir)/maintainer.am |
---|
56 | |
---|
57 | # called within maintainer-check |
---|
58 | ## We do wanna run all tests here since test repository is not |
---|
59 | ## included in tarball, and thus some tests are skipped in distcheck. |
---|
60 | MAINTAINER_CHECK_LOCAL = check |
---|
61 | ## syntax-check called within maintainer-check |
---|
62 | MAINTAINER_CHECK_LOCAL += syntax-check |
---|
63 | # extra check in release rule |
---|
64 | RELEASE_LOCAL = check-svn_revision check-readme check-openssl |
---|
65 | |
---|
66 | .PHONY: check-svn_revision check-openssl |
---|
67 | |
---|
68 | FORCE: |
---|
69 | |
---|
70 | check-openssl: |
---|
71 | @openssl version > /dev/null || exit 1 |
---|
72 | |
---|
73 | check-svn_revision: |
---|
74 | @$(SVNVERSION) | $(EGREP) '^[0-9]+$$' || \ |
---|
75 | { echo incorrect svn revision - expected single unmodified revision 1>&2; \ |
---|
76 | exit 1; } |
---|
77 | |
---|
78 | check-readme: |
---|
79 | (ver_am=1.11\ |
---|
80 | && $(GREP) "AM_INIT_AUTOMAKE.*$$ver_am" $(srcdir)/configure.ac \ |
---|
81 | && $(GREP) "Automake $$ver_am" $(srcdir)/README.developer)>/dev/null || exit 1 |
---|
82 | (ver_ac=2.63\ |
---|
83 | && $(GREP) "AC_PREREQ.*$$ver_ac" $(srcdir)/configure.ac \ |
---|
84 | && $(GREP) "Autoconf $$ver_ac" $(srcdir)/README.developer)>/dev/null || exit 1 |
---|
85 | |
---|
86 | |
---|
87 | |
---|
88 | # run in end of release target |
---|
89 | RELEASE_HOOK = build_support/Portfile.diff |
---|
90 | |
---|
91 | macport_url = http://svn.macports.org/repository/macports/trunk/dports/devel/svndigest |
---|
92 | |
---|
93 | build_support/Portfile.diff: build_support/Portfile FORCE |
---|
94 | test -e build_support/macport \ |
---|
95 | || svn co $(macport_url) build_support/macport |
---|
96 | svn revert -R build_support/macport |
---|
97 | svn update build_support/macport |
---|
98 | cp build_support/Portfile build_support/macport/Portfile |
---|
99 | svn diff build_support/macport/Portfile > $@ |
---|
100 | svn revert build_support/macport/Portfile |
---|
101 | |
---|
102 | edit = $(SED) \ |
---|
103 | -e 's|@PACKAGE_URL[@]|$(PACKAGE_URL)|g' \ |
---|
104 | -e 's|@VERSION[@]|$(VERSION)|g' |
---|
105 | |
---|
106 | build_support/Portfile: $(distdir).tar.gz Makefile build_support/Portfile.in check-openssl |
---|
107 | @rm -f $@ $@.t |
---|
108 | @openssl sha256 $(distdir).tar.gz > $(distdir).tar.gz.sha256 |
---|
109 | @openssl rmd160 $(distdir).tar.gz > $(distdir).tar.gz.rmd160 |
---|
110 | @sha256=`cut -f 2 -d ' ' $(distdir).tar.gz.sha256`;\ |
---|
111 | rmd160=`cut -f 2 -d ' ' $(distdir).tar.gz.rmd160`;\ |
---|
112 | $(edit) -e "s|@SHA256SUM[@]|$$sha256|g" \ |
---|
113 | -e "s|@RMD160SUM[@]|$$rmd160|g" \ |
---|
114 | '$(srcdir)/build_support/Portfile.in' > $@.t |
---|
115 | @chmod a-w $@.t |
---|
116 | @mv $@.t $@ |
---|
117 | @echo "creating $@" |
---|
118 | |
---|
119 | STABLE_VERSION = $(SVNDIGEST_MAJOR_VERSION).$(SVNDIGEST_MINOR_VERSION) |
---|
120 | STABLE_BRANCH = ^/branches/$(STABLE_VERSION)-stable |
---|
121 | |
---|
122 | # create a tag from current stable branch; depends on check-version to |
---|
123 | # ensure that version is macro.minor.micro (no pre suffix), that wc is |
---|
124 | # pristine and updated. |
---|
125 | svn-tag: check-version check-svn-diff |
---|
126 | svn copy $(STABLE_BRANCH) ^/tags/$(VERSION) \ |
---|
127 | -m "tagging version $(VERSION)" |
---|
128 | |
---|
129 | # create a stable-branch from trunk |
---|
130 | svn-stable-branch: check-svn-diff all |
---|
131 | svn copy ^/trunk $(STABLE_BRANCH) \ |
---|
132 | -m "New stable branch $(STABLE_VERSION)" \ |
---|
133 | && svn co $(STABLE_BRANCH) ../svndigest-$(STABLE_VERSION).x \ |
---|
134 | && bin/svndigest-copy-cache -v -t ../svndigest-$(STABLE_VERSION).x |
---|
135 | |
---|
136 | syntax-check: assert-header-without-use \ |
---|
137 | assert-without-header \ |
---|
138 | errno-header-without-use |
---|
139 | |
---|
140 | assert-header-without-use: |
---|
141 | @files=`grep -l "^#include *<cassert>" $(srcdir)/*/*.cc`;\ |
---|
142 | grep -L "assert *(" $$files | grep $(srcdir) && \ |
---|
143 | { echo "$@: in files listed above"; exit 1; } || :; |
---|
144 | |
---|
145 | assert-without-header: |
---|
146 | @files=`grep -l "assert *(" $(srcdir)/*/*.cc`;\ |
---|
147 | grep -L "^#include *<cassert>" $$files | grep $(srcdir) && \ |
---|
148 | { echo "$@: in files listed above"; exit 1; } || :; |
---|
149 | |
---|
150 | errno-header-without-use: |
---|
151 | @files=`grep -l "^#include *<cerrno>" $(srcdir)/*/*.cc`;\ |
---|
152 | test -n "$$files" || exit 0;\ |
---|
153 | grep -LE "[^ \t\(=]errno" $$files | grep $(srcdir) && \ |
---|
154 | { echo "$@: in files listed above"; exit 1; } || :; |
---|