1 ###########################################################################
2 # Standard debian rules
5 fakeroot debian/rules clean
12 dpkg-buildpackage -us -uc -rfakeroot -I.git -I.gitignore -I.gitmodules
15 ###########################################################################
16 # Generate debian/changelog from git log
18 NAME := $(shell awk '/^Source:/{print $$2}' debian/control)
19 CLOGDIR := .git/changelogs
20 CHANGELOGS := $(shell lasttag=HEAD; \
21 (git tag -l 'v*'; echo) \
22 | while read tag; do \
23 echo $(CLOGDIR)/$${tag}$${tag:+-}$$lasttag; \
29 @mkdir -p "$(CLOGDIR)"
32 version="$@"; version="$${version#$(CLOGDIR)/}"; \
33 from="$${version%-*}"; version="$${version#*-}"; to="$$version"; \
34 if [ "$$from" == "$$to" ]; then from=""; fi; \
36 if [ "$$version" == "HEAD" ]; then \
37 version="`git describe --tag --match='v*' | sed -e 's/-/~/' -e 's/-/./g'`"; \
38 release="UNRELEASED"; \
40 version="$${version#v}"; \
41 echo "$(NAME) ($$version) $$release; urgency=low"; \
43 git log --pretty=oneline --abbrev-commit $$from$${from:+..}$$to \
44 | while read commit description; do \
45 echo " * [$$commit] $$description"; \
47 git log --format='%n -- %an <%ae> %cD%n' $$to'^!'; \
48 ) >$@ || (rm -f $@; false)
49 .PHONY: $(word 1,$(CHANGELOGS)) # The first changelog entry must be recreated on each call
51 debian/changelog: $(CHANGELOGS)
52 cat $^ > $@ || (rm -f $@; false)
55 rm -f debian/changelog
58 prepare:: debian/changelog
60 ###########################################################################
61 ###########################################################################
64 echo "version='`git describe --tag`'" >lib/00_version.sh
66 rm -f lib/00_version.sh
69 # The $(wildcard ...) return value is sorted and duplicates are
70 # removed from the list of dependencies. I need to mention
71 # lib/00_version.sh explicitly since it might not yet exist
72 mapsectorsh: mapsector lib/00_version.sh $(wildcard lib/[0-9][0-9]_*.sh)
78 echo "# $@ automatically generated from"; \
79 for script in $^; do \
82 sed -n -e '2,/^load$$/p' $<; \
83 for script in $^; do \
84 if [ "$$script" == "$<" ]; then continue; fi; \
85 echo "#### $$script"; \
90 sed -n -e '/^load$$/,$$p' $<; \
91 ) >$@ || (rm -f $@; false)
92 @sed -i -e 's/^load$$/####/' -eT -eh -eG -eH -eG -eH -eG -e'y/\n/#/' $@