summaryrefslogtreecommitdiff
path: root/build/dist-changelog.am
blob: 4f6977d4e3043fb0fc1670190f3b0af279fb6567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
## Copyright (c) 2009  Daniel Elstner <daniel.kitta@gmail.com>
##
## This file is part of mm-common.
##
## mm-common 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 2 of the License,
## or (at your option) any later version.
##
## mm-common 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 mm-common.  If not, see <http://www.gnu.org/licenses/>.

if MAINTAINER_MODE
dist-hook: dist-changelog
else
dist-hook:
endif

.PHONY: dist-changelog

dist-changelog: $(top_srcdir)/.git/HEAD
	@if git --git-dir="$(top_srcdir)/.git" --work-tree="$(top_srcdir)" \
		log --date=short --pretty='format:%cd  %an  <%ae>%n%n%s%n%n%b%n' \
	  | sed	-e '/^[12]...-[01].-[0123].  [^<>]*  <[^<>]*>$$/,/^$$/ b' \
	 	-e '/[^	 ]/,/^[	 ]*$$/! d' \
		-e 's/^[	 ]*/	/' \
		-e 's/^[	 ]*$$//' >.ChangeLog.tmp; \
	then mv -f .ChangeLog.tmp "$(top_distdir)/ChangeLog"; \
	else rm -f .ChangeLog.tmp; exit 1; fi