File: rules

package info (click to toggle)
ratfor 1.0-16
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 120 kB
  • ctags: 311
  • sloc: ansic: 1,802; makefile: 89
file content (99 lines) | stat: -rwxr-xr-x 3,695 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
#!/usr/bin/make -f
## This is the debian.rules file for the package
## ratfor, by Emilio C. Lopes <ecl@finpe.if.usp.br>.
## updated by Alan Bain <afrb2@cam.ac.uk>.

## updated based on f2c's files and hello package
package=ratfor

## The architecture
arch = $(shell dpkg --print-architecture)

INSTALL = /usr/bin/install
INSTALL_PROGRAM = $(INSTALL) -o root -g root -m 0755 

CFLAGS = -g -DF77 -DS_CHAR=\"signed char\"
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
   CFLAGS += -O0
else
   CFLAGS += -O2
endif

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
   INSTALL_PROGRAM += -s
endif



build:  
	$(checkdir)
## Builds the binary package.
	make -f Makefile CFLAGS="$(CFLAGS)"
	touch stamp-build

clean: $(checkdir)
## Undoes the effect of `make -f debian.rules build'.
	make -f Makefile clean
	rm -f stamp-build debian/files debian/substvars
	rm -rf debian/tmp

binary-indep:  checkroot build
	$(checkdir)

binary-arch: checkroot build 
	$(checkdir)
## Makes a binary package.
	test -f stamp-build || make -f debian/rules build
	rm -rf debian/tmp > /dev/null 2>&1
	install -d -o root -g root -m 755 debian/tmp
	chmod g-s debian/tmp
	install -d -o root -g root -m 755 debian/tmp/usr/bin
	$(INSTALL_PROGRAM) ratfor debian/tmp/usr/bin
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	strip --remove-section=.comment --remove-section=.note debian/tmp/usr/bin/ratfor 
endif

	install -d -o root -g root -m 755 debian/tmp/usr/share/man/man1
	install -o root -g root -m 644 ratfor.1 debian/tmp/usr/share/man/man1
	gzip -9nf debian/tmp/usr/share/man/man1/ratfor.1
	install -d -o root -g root -m 755 debian/tmp/usr/share/doc/$(package)
	install -o root -g root -m 644  BUGS\
	  debian/tmp/usr/share/doc/$(package)
## do package copyright
	install -d -o root -g root -m 755 debian/tmp/usr/share/doc/$(package)
	install -o root -g root -m 644  debian/copyright \
	debian/tmp/usr/share/doc/$(package)/copyright
	install -d -o root -g root -m 755 debian/tmp/usr/share/doc/$(package)/examples
	install -o root -g root -m 644 *.r \
	  debian/tmp/usr/share/doc/$(package)/examples
	gzip -9nf debian/tmp/usr/share/doc/$(package)/examples/*.r
	install -d -o root -g root -m 755 debian/tmp/DEBIAN

	install -c -m 0644 debian/changelog \
                              debian/tmp/usr/share/doc/$(package)/changelog.Debian 
	gzip -9n debian/tmp/usr/share/doc/$(package)/changelog.Debian
	dpkg-shlibdeps ./ratfor                                                
	dpkg-gencontrol -isp
	dh_md5sums --tmpdir=debian/tmp
	chown -R root.root debian/tmp                                           
	chmod -R go-ws debian/tmp
	dpkg --build debian/tmp ..

define checkdir                                                                 
	test -f rat4.c -a -f debian/rules                                 
endef                                                                           
                                                                               
## Below Here is Generic                                                        
                                                                                
binary: binary-indep binary-arch                                                
                                                                                
source diff:                                                                    
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false    
                                                                                
dist:  binary source diff changes                                               

checkroot:
	$(checkdir)
	test root = "`whoami`"
.PHONY: binary binary-arch binary-indep clean checkroot