File: rules

package info (click to toggle)
clif 0.92-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 3,580 kB
  • ctags: 2,814
  • sloc: ansic: 31,040; yacc: 4,961; lex: 659; makefile: 390; sh: 60
file content (106 lines) | stat: -rwxr-xr-x 3,212 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
#!/usr/bin/make -f
# ssystem debian build rules
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.
# Heavily modified by Antti-Juhani Kaijanaho.

package := $(shell dpkg-parsechangelog | grep ^Source | cut -b9-)

#CC := $(shell if [ -x /usr/bin/egcc ]; then echo egcc; else echo cc; fi)
#    egcc seems to build broken binary now , so don't use it
CC=cc

install        := install -o root -g root
install_dir    := $(install) -m 0755 -d
install_exec   := $(install) -m 0755 -s
install_nonex  := $(install) -m 0644
install_script := $(install) -m 0755

rootdir        := $(shell pwd)/debian/tmp
bindir         := $(rootdir)/usr/bin
docdir         := $(rootdir)/usr/share/doc/$(package)
exampledir     := $(docdir)/examples
mandir         := $(rootdir)/usr/share/man
man1dir        := $(mandir)/man1
libdir         := $(rootdir)/usr/lib/$(package)

configure : debian/configure.stamp
debian/configure.stamp :
	./configure --prefix=/usr --sysconfdir=/etc
	touch $@

build: debian/build.stamp
debian/build.stamp : configure
	$(checkdir)
	make
#	make  CC=$(CC)
# doesn't work well
#	cd doc; latex2html guide_programmers
#  This one is a little better, but still not very good.
#	cd doc; latex2html guide_users
	cd doc; dvips -o guide_programmers.ps guide_programmers.dvi
	cd doc; dvips -o guide_users.ps guide_users.dvi
	cd doc; dvips -o cimcsp94.ps cimcsp94.dvi
	touch $@

clean:
	$(checkdir)
	-rm -f build debian/*.stamp
	-[ ! -f Makefile ] || make distclean  
	-rm -rf doc/guide_programmers doc/guide_users *.ps
	-cd doc;  rm -f cimcsp94.ps  guide_programmers.ps  guide_users.ps
	-rm -f `find . -name "*~"`
	-rm -rf debian/tmp debian/files* core debian/substvars

binary-indep: debian/binary-indep.stamp
debian/binary-indep.stamp: build
	touch $@

binary-arch: debian/binary-arch.stamp
debian/binary-arch.stamp: build
	$(checkdir)
	$(RM) -r $(rootdir)
# install man page
	$(install_dir) $(man1dir)
	$(install_nonex) doc/$(package).1 $(man1dir)
	gzip -9r $(mandir)
#install other docs
	$(install_dir) $(docdir)
	$(install_nonex) doc/*.ps doc/*.dvi $(docdir)
# install standard docs
	$(install_nonex) debian/changelog $(docdir)/changelog.Debian
	$(install_nonex) ChangeLog $(docdir)/changelog
	$(install_nonex) README TODO INSTALL running_notes $(docdir)
	gzip -9rf $(docdir)
# but don't gzip the copyright statement
#
	$(install_nonex) debian/copyright $(docdir)
# install examples
	$(install_dir) $(exampledir)
	cp -r tests example $(exampledir)
	chmod 644 $(exampledir)/tests/*
	chmod 755 $(exampledir)/tests/check-them
	chown root.root $(exampledir)/tests/*
# install binary
	$(install_dir) $(bindir)
	$(install_exec) clif $(bindir)
# install support files
	$(install_dir) $(libdir)
	$(install_nonex) small.hlp io.ci clif.ini $(libdir)
# install control files
	$(install_dir) $(rootdir)/DEBIAN
	$(install_script) debian/prerm debian/postinst $(rootdir)/DEBIAN
	dpkg-shlibdeps $(bindir)/*
	dpkg-gencontrol -isp
# clean permissions and build
	chmod -R g-s $(rootdir)
	dpkg --build $(rootdir) ..
	touch $@

define checkdir
	test -f debian/rules
endef

binary: binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean checkroot