File: rules

package info (click to toggle)
pmake 1.39-2
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 1,204 kB
  • ctags: 1,355
  • sloc: ansic: 12,390; makefile: 87; sh: 59
file content (79 lines) | stat: -rwxr-xr-x 2,354 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
#!/usr/bin/make -f
# Build rules for pmake (1.39)
# Based on Ian Jackson's sample rules file for GNU hello
# Copyright 1994,1995 by Ian Jackson.
# Copyright 1997 by James Troup.
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself.  (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)

ARCH=$(shell dpkg --print-gnu-build-architecture)
CFLAGS="-O2  -g -Wall -D__COPYRIGHT\(x\)= -D__RCSID\(x\)= \
	-I. -DMACHINE=\\\"debian\\\" -DMACHINE_ARCH=\\\"${ARCH}\\\""

build:
	$(checkdir)
	$(MAKE) -f Makefile.boot CFLAGS=$(CFLAGS)
	touch build

clean:
	$(checkdir)
	$(MAKE) -f Makefile.boot clean
	-rm -rf build *~ debian/tmp debian/*~ debian/files* debian/substvar*

binary-indep:   checkroot build
	$(checkdir)

binary-arch:    checkroot build
	$(checkdir)
	-rm -rf debian/tmp/
	install -d -m 755 debian/tmp/DEBIAN/
	install -m 644 debian/control debian/tmp/DEBIAN/

	install -d -m 755 debian/tmp/usr/bin/
	install -s -m 755 bmake debian/tmp/usr/bin/pmake
	install -m 755 mkdep debian/tmp/usr/bin/

	install -d -m 755 debian/tmp/usr/man/man1/
	install -m 644 make.1 debian/tmp/usr/man/man1/pmake.1
	install -m 644 mkdep.1 debian/tmp/usr/man/man1/
	gzip -9v debian/tmp/usr/man/man1/*

	install -d -m 755 debian/tmp/usr/lib/mk/
	for file in mk/*; \
	do \
	  install -m 644 $$file debian/tmp/usr/lib/$$file; \
	done

	install -d -m 755 debian/tmp/usr/doc/pmake/
	groff -Tascii -M/usr/share/groff/tmac -ms PSD.doc/tutorial.ms > \
	      debian/tmp/usr/doc/pmake/tutorial.asc
	groff -Tps -M/usr/share/groff/tmac -ms PSD.doc/tutorial.ms > \
	      debian/tmp/usr/doc/pmake/tutorial.ps
	cp debian/changelog debian/tmp/usr/doc/pmake/changelog.Debian
	gzip -9v debian/tmp/usr/doc/pmake/*
	install -m 644 debian/copyright  debian/tmp/usr/doc/pmake/

	dpkg-shlibdeps debian/tmp/usr/bin/pmake
	dpkg-gencontrol 
	chown -R root.root debian/tmp/
	chmod -R go=rX debian/tmp/
	dpkg --build debian/tmp/ ..

define checkdir
	test -f make.c -a -f debian/rules
endef

# Below here is fairly generic really

binary:         binary-indep binary-arch

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

checkroot:
	$(checkdir)
	test root = "`whoami`"

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