aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 7da800cd64dacb6e9f1013a6241a3108266a7c32 (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
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
SUBDIRS = daemon modules man
INCDIRS = include samples
INCFILES = COPYING COPYRIGHT NEWS README TODO Makefile Makefile.rules \
	   .version *.diff

.PHONY: daemon all kernel clean install install_kernel mrproper
.PHONY: distclean backup

daemon:
	for i in $(SUBDIRS); do $(MAKE) -C $$i all; done 

kernel:
	if [ -d kernel ]; then $(MAKE) -C kernel all; fi

all:	daemon kernel

clean:
	for i in $(SUBDIRS) kernel; do \
		if [ -d $$i ]; then $(MAKE) -C $$i clean; fi; done 	

install:
	for i in $(SUBDIRS); do $(MAKE) -C $$i install; done 	

install_kernel:
	if [ -d kernel ]; then $(MAKE) -C kernel install; fi

mrproper distclean: clean
	find . -noleaf \( -name '*~' -o -name '#*' -o -name '*.orig' -o -name '*.rej' -o -name '*.old' \) -print0 | xargs -0 rm -f

TODAY := $(shell date +'%Y%m%d')

backup: mrproper
	cd .. ; tar cf - autofs | gzip -9 > autofs-bu-$(TODAY).tar.gz 

RELEASE := $(shell cat .version)

.PHONY: release newrelease

reldir:
	-rm -rf autofs-$(RELEASE) autofs-$(RELEASE).tar.gz
	mkdir autofs-$(RELEASE)
	cp -R $(SUBDIRS) $(INCDIRS) $(INCFILES) autofs-$(RELEASE)
	$(MAKE) -C autofs-$(RELEASE) distclean
	find autofs-$(RELEASE) -noleaf -name \*norel -print0 | xargs -0 rm -rf

release: reldir
	-rm -f .prerel .lastrel
	cp .version .lastrel
	tar cvvf - autofs-$(RELEASE) | gzip -9 > autofs-$(RELEASE).tar.gz

since:
	mv -f NEWS NEWS.old
	echo 'Since autofs-$(RELEASE):' > NEWS
	echo 'Since autofs-$(RELEASE):' | sed -e 's/./-/g' >> NEWS
	echo '' >> NEWS
	cat NEWS.old >> NEWS

newrelease: clean since
	echo `cut -d. -f1-2 < .version`.`expr \`cut -d. -f3 < .version\` + 1` \
		> .version

newminorrelease: clean since
	echo `cut -d. -f1 < .version`.`expr \`cut -d. -f2 < .version\` + 1`.0 \
		> .version

newmajorrelease: clean since
	echo `expr \`cut -d. -f1 < .version\` + 1`.0.0 > .version

-include Makefile.private