File: rules

package info (click to toggle)
mmorph 2.3.4-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 876 kB
  • ctags: 742
  • sloc: ansic: 5,009; yacc: 1,211; lex: 417; makefile: 306; sh: 60; sed: 34; csh: 26
file content (83 lines) | stat: -rwxr-xr-x 2,227 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
#! /usr/bin/make -f
# -*- Makefile -*-

# Written by Antti-Juhani Kaijanaho <ajk@debian.org>.  Use, distribute
# and modify as you please.

install_exec = install -m 755 -s
install_dir = install -m 755 -d
install_nonex = install -m 644
install_script = install -m 755
install_zipped = gzip -9vc
install_symlink = ln -s

package    = mmorph
rootdir    = debian/tmp
docdir     = $(rootdir)/usr/share/doc/$(package)
bindir     = $(rootdir)/usr/bin
mandir     = $(rootdir)/usr/share/man
man1dir    = $(mandir)/man1
man5dir    = $(mandir)/man5
exampledir = $(docdir)/examples

build:
	$(checkdir)
	./configure 
	$(MAKE) CFLAGS="-O2 -g -Wall" mmorph
#	Regression test.
	$(MAKE) test
	touch build

binary: binary-arch binary-indep

binary-indep:
	$(checkdir)

binary-arch: build
	$(checkdir)
	test root = "`whoami`"
#	Create the filesystem
	$(install_dir) $(rootdir)
	$(install_dir) $(rootdir)/DEBIAN
	$(install_dir) $(docdir)
	$(install_dir) $(bindir)
	$(install_dir) $(mandir)
	$(install_dir) $(man1dir)
	$(install_dir) $(man5dir)
	$(install_dir) $(exampledir)
#	Install copyright file.
	$(install_nonex) debian/copyright $(docdir)
#	Install the change logs.
	$(install_zipped) debian/changelog > $(docdir)/changelog.Debian.gz
	$(install_zipped) 00CHANGES > $(docdir)/changelog.gz
#	Install the binary.
#	$(install_exec) mixal $(bindir)
	$(MAKE) MTHOME=$(rootdir)/usr MANDIR=$(mandir) install
	strip $(bindir)/*
#	Install the manual page.
#	$(install_zipped) debian/mixal.1 > $(man1dir)/mixal.1.gz
	gzip -9v $(man1dir)/* $(man5dir)/*
#	Install the supporting documentation.
	$(install_nonex) 00README 00RELEASE_NOTES $(docdir)
#	$(install_nonex) debian/README.Debian $(docdir)
	$(install_nonex) mmorph_v2.tex $(docdir)
#	Install the examples.
	$(install_nonex) data/* $(exampledir)
#	Install/generate the control files.
	$(install_script) debian/prerm debian/postinst $(rootdir)/DEBIAN
	dpkg-shlibdeps $(bindir)/mmorph
	dpkg-gencontrol
#	Fix permissions.
	chown -R root.root $(rootdir)
	chmod -R g-ws $(rootdir)
#	Genearate the deb.
	dpkg --build $(rootdir) ..

define checkdir
	test -f mmorph_v2.tex -a -f debian/rules
endef

clean:
	-$(MAKE) clean
	-rm -rf mmorph
	-rm -rf debian/tmp debian/*~ debian/files debian/substvars build