File: Makefile

package info (click to toggle)
units-filter 3.9-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 768 kB
  • sloc: yacc: 721; makefile: 249; cpp: 223; python: 41; perl: 19; sh: 1
file content (44 lines) | stat: -rw-r--r-- 1,296 bytes parent folder | download | duplicates (2)
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
DESTDIR=

MANSOURCES = $(shell ls doc/source/*.rst)
DOCDIR = $(DESTDIR)/usr/share/doc/units-filter/html

all :   units-filter.1 units-filter.html
	gzip -9 -c units-filter.1 > units-filter.1.gz
	(cd src; ${MAKE} all)
test : all
	(cd src; ${MAKE} test)

clean :
	rm -f *~ *stamp *.gz
	(cd src; ${MAKE} clean)
	(cd doc; ${MAKE} clean)

install : all
	install -m 775 -d ${DESTDIR}/usr/bin
	install -m 775 -d ${DESTDIR}/usr/share/man/man1
	install -m 755 src/units-filter ${DESTDIR}/usr/bin
	install -m 644 units-filter.1.gz ${DESTDIR}/usr/share/man/man1
	install -m 775 -d $(DOCDIR)
	cp -a units-filter.html _static $(DOCDIR)
	# replace a few JS files by symlinks for a Debian build
	if grep -q Debian /etc/issue; then \
	  rm -f $(DOCDIR)/_static/jquery.js; \
	  ln -s /usr/share/javascript/jquery/jquery.js $(DOCDIR)/_static; \
	  rm -f $(DOCDIR)/_static/underscore.js; \
	  ln -s /usr/share/javascript/underscore/underscore.js $(DOCDIR)/_static; \
	fi

uninstall :
	rm -f ${DESTDIR}/usr/bin/units-filter
	rm -f ${DESTDIR}/usr/share/man/man1/units-filter.1.gz
	rm -rf $(DOCDIR)

units-filter.1: $(MANSOURCES) 
	make -C doc man
	cp doc/build/man/units-filter.1 .

units-filter.html:  $(MANSOURCES)
	make -C doc singlehtml
	cp doc/build/singlehtml/index.html $@
	cp -a doc/build/singlehtml/_static .