summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 1ce7cd3853e6c9e9dc274c5b3a4869b5cd2185fb (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
70
71
# Simplified Makefile for devscripts

include Makefile.common

DESTDIR =

all: version doc make_scripts conf.default translated_manpages

version:
	rm -f version
	dpkg-parsechangelog -SVersion > version

conf.default: conf.default.in version
	rm -f $@ $@.tmp
	VERSION=`cat version` && sed -e "s/###VERSION###/$$VERSION/" $< \
	    > $@.tmp && mv $@.tmp $@

translated_manpages:
	$(MAKE) -C po4a/
	touch translated_manpages

clean_translated_manpages:
	# Update the POT/POs and remove the translated man pages
	$(MAKE) -C po4a/ clean
	rm -f translated_manpages

clean: clean_scripts clean_doc clean_translated_manpages
	rm -f version conf.default make_scripts

doc:
	$(MAKE) -C doc

online-test:
	$(MAKE) -C test/ online-test

test:
	$(MAKE) test_scripts
	$(MAKE) test_test

test-installed:
	$(MAKE) -C test/ $@

install: all install_scripts install_doc
	install -d "$(DESTDIR)$(PERLMOD_DIR)" \
	    "$(DESTDIR)$(DATA_DIR)" "$(DESTDIR)$(TEMPLATES_DIR)" \
	    "$(DESTDIR)$(DOCDIR)"
	for f in lib/*; do cp -a "$$f" "$(DESTDIR)$(PERLMOD_DIR)"; done
	install -m0644 conf.default "$(DESTDIR)$(DATA_DIR)"
	install -m0644 templates/README.mk-build-deps "$(DESTDIR)$(TEMPLATES_DIR)"
	install -m0644 README "$(DESTDIR)$(DOCDIR)"
	ln -sf edit-patch.1 "$(DESTDIR)$(MAN1DIR)/add-patch.1"

test_test:
	$(MAKE) -C test/ test

make_scripts: version
	$(MAKE) -C scripts/
	touch $@
clean_scripts: clean_translated_manpages
	$(MAKE) -C scripts/ clean
test_scripts:
	$(MAKE) -C scripts/ test
install_scripts:
	$(MAKE) -C scripts/ install DESTDIR=$(DESTDIR)

clean_doc: clean_translated_manpages
	$(MAKE) -C doc clean
install_doc:
	$(MAKE) -C doc install DESTDIR=$(DESTDIR)

.PHONY: online-test test test-installed