File: Makefile

package info (click to toggle)
arename 4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,112 kB
  • sloc: perl: 640; sh: 585; makefile: 147
file content (161 lines) | stat: -rw-r--r-- 5,999 bytes parent folder | download
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# default installation location:
#   binaries: /usr/local/bin
#   module  : /usr/local/lib/site_perl
prefix="/usr/local"
libpath="lib/site_perl"
fakeroot="/usr/bin/fakeroot"
critic=""
maxwidth="14"

PERL ?= /usr/bin/perl

all:
	@printf 'Makefile targets intended for users:\n'
	@printf '  all            this text\n'
	@printf '  install        install both scripts and the module\n'
	@printf '  install-doc    install all documentation\n'
	@printf '  uninstall      remove both scripts and the module again\n'
	@printf '  uninstall-doc  remove the documentation\n'
	@printf '\nAll other targets are not for you. Stay away!\n'

test-help:
	@printf '\nMakefile targets intended for testers:\n'
	@printf 'DO NOT USE THESE UNLESS YOU READ THE '\''TESTINGS'\'' FILE!\n'
	@printf '  test           run the important parts of the test suite\n'
	@printf '  test-all       run every part of the test suite\n'
	@printf '  test-code      Check coding style using perlcritic\n'
	@printf '  test-doc       Check the pod syntax using podchecker\n'
	@printf '  test-install   Check the installation process\n'
	@printf '  test-suite     Run the ./tests/*.t test suite\n'
	@printf '  test-output    Run the ./tests/optest-perl script\n'
	@printf '  prepare-test-data\n'
	@printf '                 create audio data for the test suite\n'
	@printf '  test-help      this text\n'
	@printf '\n  Use '\''prove'\'' to run tests individually.\n'

dev-help: all test-help
	@printf '\nMakefile targets intended for developers:\n'
	@printf 'DO NOT USE THESE UNLESS YOU KNOW WHAT YOU ARE DOING!\n'
	@printf '  doc            generate arename.1 and arename.html\n'
	@printf '  dev-help       this text\n'
	@printf '  clean          clean up working tree\n'
	@printf '  distclean      same as clean, but removes .tars, too\n'
	@printf '  genperlscripts generate arename from arename.in\n'

genperlscripts:
	@$(PERL) ./bin/gps

doc: genperlscripts
	@./bin/gendoc.sh arename
	@./bin/gendoc.sh ataglist

clean:
	@[ ! -e arename.in ] && { printf 'DO NOT CALL THIS!\n' ; exit 1 ; } || true
	rm -f arename.html arename.1 ataglist.html ataglist.1 *.tmp .*~ *~ bin/*~ tests/*~ arename ataglist
	rm -f optest.pl
	rm -f */*.pm */*/*.pm */*/*/*.pm
	rm -Rf tests/data

distclean: clean
	rm -f *.tar.gz
	rm -f TAGS tags

install:
	@./bin/install.sh x arename       "$(prefix)/bin"                        $(maxwidth)
	@./bin/install.sh x ataglist      "$(prefix)/bin"                        $(maxwidth)
	@./bin/install.sh n modules/ARename.pm "$(prefix)/$(libpath)/"           $(maxwidth)
	@find modules/ARename -name "*.pm" -exec sh -c 's=$$1; d=$${1%/*}; d=$${d#modules/}; ./bin/install.sh n "$$s" "$(prefix)/$(libpath)/$$d/" $(maxwidth)' {} {} \;

install-doc:
	@./bin/install.sh n README        "$(prefix)/share/doc/arename"          $(maxwidth)
	@./bin/install.sh n UPGRADING     "$(prefix)/share/doc/arename"          $(maxwidth)
	@./bin/install.sh n REPORTING_BUGS "$(prefix)/share/doc/arename"         $(maxwidth)
	@./bin/install.sh n LICENCE       "$(prefix)/share/doc/arename"          $(maxwidth)
	@./bin/install.sh n CHANGES       "$(prefix)/share/doc/arename"          $(maxwidth)
	@./bin/install.sh n asdump        "$(prefix)/share/doc/arename"          $(maxwidth)
	@./bin/install.sh n arename.html  "$(prefix)/share/doc/arename"          $(maxwidth)
	@./bin/install.sh n arename.1     "$(prefix)/share/man/man1"             $(maxwidth)
	@./bin/install.sh n ataglist.html "$(prefix)/share/doc/arename"          $(maxwidth)
	@./bin/install.sh n ataglist.1    "$(prefix)/share/man/man1"             $(maxwidth)
	@./bin/install.sh n _arename      "$(prefix)/share/doc/arename/examples" $(maxwidth)

uninstall:
	@./bin/uninstall.sh f "$(prefix)/bin/arename"
	@./bin/uninstall.sh f "$(prefix)/bin/ataglist"
	@./bin/uninstall.sh f "$(prefix)/$(libpath)/ARename.pm"
	@./bin/uninstall.sh d "$(prefix)/$(libpath)/ARename"

uninstall-doc:
	@./bin/uninstall.sh d "$(prefix)/share/doc/arename"
	@./bin/uninstall.sh f "$(prefix)/share/man/man1/arename.1"
	@./bin/uninstall.sh f "$(prefix)/share/man/man1/ataglist.1"

test: test-check test-doc test-output test-suite

test-all: test-check test-install test-code test-doc test-output test-suite
	@printf '\nTested: '\''%s'\''\n\n' "$$(perl -Imodules ./arename -V)"

test-check:
	@[ ! -e tests/data/input.wav ] && { \
	  printf '\n  -- No data; Please read the TESTING file! --\n\n' ; \
	  exit 1 ; \
	} || true

test-install: doc
	@( \
	 if [ ! -x "$(fakeroot)" ] ; then \
	  printf 'fakeroot binary (%s) not found. Skipping installation test (see TESTING).\n' "$(fakeroot)" ;\
	  exit 0; \
	 fi ; \
	 "$(fakeroot)" /bin/sh ./tests/inst_t.sh ; \
	)

test-code:
	@CRITIC="$(critic)" sh ./bin/test-code.sh

test-doc:
	@( \
	 [ -e "arename.in" ] && PODFILE=arename.in || PODFILE=arename ; \
	 printf 'Checking pod syntax in "%s"...\n\n' "$$PODFILE" ; \
	 podchecker -warnings "$$PODFILE" || { \
	  printf '\n podchecker returned errors, please check!\n\n' ; \
	  exit 1 ; \
	 } ; \
	 if podchecker -warnings "$$PODFILE" 2>&1 | grep '^\*\*\* WARNING' > /dev/null 2>&1; then \
	  printf '\n podchecker returned warnings, please check!\n\n' ;\
	  exit 1 ; \
	 fi ; \
	 printf '\nPod syntax in "%s" passed all tests - okay.\n\n' "$$PODFILE" ; \
	)

test-output: genperlscripts
	perl tests/optest-perl
	@printf '\n\n  -!- Output routines appear to behaving properly.\n\n'

test-suite: test-check
	prove -Imodules -v tests/*.t

coverage:
	cover -delete
	PERL5OPT='-MDevel::Cover=-ignore,.,-select,ARename.pm,+select,ARename/.+\.pm' $(MAKE) test-all
	cover

prepare-test-data:
	./bin/gentestsdata.sh

release: clean
	@./bin/dist.sh -r

prerelease: clean
	@./bin/dist.sh -p

snapshot: clean
	@./bin/dist.sh -s

tags:
	ctags --language-force=perl arename.in ARename.pm.in ataglist.in
	ctags -e --language-force=perl arename.in ARename.pm.in ataglist.in

happiness: genperlscripts prepare-test-data tags doc test-all

.PHONY: happiness coverage install install-doc distclean clean all doc test-check tags