File: GNUmakefile

package info (click to toggle)
apt-cacher-ng 0.8.0-3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,768 kB
  • ctags: 1,640
  • sloc: cpp: 14,741; ansic: 462; perl: 376; sh: 357; makefile: 88
file content (97 lines) | stat: -rw-r--r-- 3,112 bytes parent folder | download | duplicates (3)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97

ifneq ($(DEBUG),)
	 CXXFLAGS += -g -O0 -DDEBUG
	 CMAKEOPTS += -DADDDEBUGSRC=1 --debug-trycompile --debug-output
endif

ifneq ($(NOLTO),)
	CMAKEOPTS += -DNOLTO=1
endif

export CXXFLAGS
export LDFLAGS

# pass down to cmake's Makefile, but all targets depend on config
default: all
apt-cacher-ng in.acng acngfs clean all: config
	@$(MAKE) -C build $@

config: build/.config-stamp

build/.config-stamp: build/.dir-stamp
	cd build && cmake $(CMAKEOPTS) ..
	@>$@

build/.dir-stamp:
	@test -d build || mkdir build
	@>$@

distclean:
	rm -rf build $(DBTMP) acsyscap.h *.o Makefile

doc: README
README: build/.dir-stamp doc/src/README.but doc/src/manpage.but doc/src/acngfs.but doc/src/textparm.but GNUmakefile
	@mkdir -p doc/html doc/man
	halibut --text=doc/README doc/src/textparm.but doc/src/README.but
	halibut --pdf=doc/apt-cacher-ng.pdf doc/src/README.but
	cd doc/html && halibut --html ../src/README.but
	cd doc/man && halibut --man ../src/manpage.but && halibut --man ../src/acngfs.but
	cp doc/README README

fixversion: VERSION
	mkdir -p build/tmp
	sed -e 's,^.*define.*ACVERSION.*,#define ACVERSION "$(VERSION)",' < include/config.h > build/tmp/hh
	cmp include/config.h build/tmp/hh || cp build/tmp/hh include/config.h

VERSION=$(shell cat VERSION)
TAGVERSION=$(subst rc,_rc,$(subst pre,_pre,$(VERSION)))
DISTNAME=apt-cacher-ng-$(VERSION)
DEBSRCNAME=apt-cacher-ng_$(shell echo $(VERSION) | sed -e "s,pre,~pre,;s,rc,~rc,;").orig.tar.xz

tarball: fixversion doc notdebianbranch nosametarball
	# diff-index is buggy and reports false positives... trying to work around
	git update-index --refresh || git commit -a
	git diff-index --quiet HEAD || git commit -a
	# alternative to --quiet HEAD
	#git diff-index --quiet --cached HEAD || git commit -a
	#git diff-files --quiet || git commit -a
	git archive --prefix $(DISTNAME)/ HEAD | xz -9 > ../$(DISTNAME).tar.xz
	test -e /etc/debian_version && ln -f ../$(DISTNAME).tar.xz ../$(DEBSRCNAME) || true
	test -e ../tarballs && ln -f ../$(DISTNAME).tar.xz ../tarballs/$(DEBSRCNAME) || true
	test -e ../build-area && ln -f ../$(DISTNAME).tar.xz ../build-area/$(DEBSRCNAME) || true

tarball-remove:
	rm -f ../$(DISTNAME).tar.xz ../tarballs/$(DEBSRCNAME) ../$(DEBSRCNAME) ../build-area/$(DEBSRCNAME)

release: noremainingwork tarball
	git tag upstream/$(TAGVERSION)

unrelease: tarball-remove
	git tag -d upstream/$(TAGVERSION)

pristine-commit:
	pristine-tar commit ../$(DISTNAME).tar.xz $(TAGVERSION)
	pristine-tar commit ../tarballs/$(DEBSRCNAME) $(TAGVERSION)

noremainingwork:
	test ! -e TODO.next # the quick reminder for the next release should be empty

notdebianbranch:
	test ! -f debian/rules # make sure it is not run from the wrong branch

nosametarball:
	test ! -f ../$(DISTNAME).tar.xz # make sure not to overwrite existing tarball
	test ! -f ../tarballs/$(DEBSRCNAME)

gendbs:
	$(MAKE) -C dbgen CONFDIR=../conf

doxy:
	doxygen Doxyfile
	see doc/dev/html/index.html

# execute them always and consider done afterwards
.PHONY: gendbs clean distclean config conf/gentoo_mirrors.gz

# the dependencies in THIS Makefile shall be processed as sequence
.NOTPARALLEL: