File: rules

package info (click to toggle)
prc-tools 0.5.0r-3.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 20,412 kB
  • ctags: 16,426
  • sloc: ansic: 35,388; makefile: 443; asm: 213; cpp: 194; perl: 59
file content (96 lines) | stat: -rwxr-xr-x 2,499 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
#!/usr/bin/make -f

package=prc-tools
#export DESTDIR=$(shell pwd)/debian/tmp
DESTDIR=debian/tmp
export INSTDIR=$(shell pwd)/debian/tmp/usr
ANAME=m68k-palmos-coff
GVER=2.7.2.2-kgpd-071097
MAN1=$(DESTDIR)/usr/man/man1

extra_files=/usr/info /usr/include /usr/sbin \
	/usr/lib/libiberty.a /usr/lib/libmmalloc.a /usr/lib/libreadline.a
m68k_libs=$(DESTDIR)/usr/lib/gcc-lib/$(ANAME)/$(GVER)/libgcc.a \
	$(DESTDIR)/usr/$(ANAME)/lib/lib*.a
man1=$(DESTDIR)/usr/man/man1
missing_manpages=$(patsubst %,$(man1)/$(ANAME)-%.1.gz, \
	gasp stubgen exportlist)

build:
	dh_testdir
	-mkdir othersources
	make gnuuntar DESTDIR=$(PWD)/$(DESTDIR)
	make patch DESTDIR=$(PWD)/$(DESTDIR)
	make gnutools DESTDIR=$(PWD)/$(DESTDIR)
	make all PILRC=pilrc DESTDIR=$(PWD)/$(DESTDIR)
	touch build

clean:
	dh_testdir
	-rm -f build
	-make clean
	dh_clean
	-rm -rf stamp.*
	-rm -rf othersources

#
# Move everything into place here so that $(wildcard) works correctly
# in the binary-arch target
#
post-build: build
	dh_testroot
	dh_testdir
	dh_installdirs usr/bin usr/man/man1 \
		$(patsubst %,usr/$(ANAME)/%,bin include lib)
	make install prefix=$(PWD)/$(DESTDIR)/usr \
		PREFIX=$(PWD)/$(DESTDIR)/usr DESTDIR=
	cp -a gdbpanel/gdbpanel.prc $(DESTDIR)/usr/$(ANAME)

#	Remove any files that exist in other packages
	-rm -rf $(patsubst %,$(DESTDIR)%,$(extra_files))

#	Manually include any extra man pages.
	cp -a man/txt2bitm.1 man/build-prc.1 $(DESTDIR)/usr/man/man1
	cp -a man/obj-res.1 $(DESTDIR)/usr/man/man1/$(ANAME)-obj-res.1
	for man in $(missing_manpages); do \
		ln -sf /usr/man/man7/undocumented.7.gz $$man; done

	dh_installdocs README README.reloc README.shared
	dh_installexamples example/*
	dh_installchangelogs

binary-arch: post-build
#	Cleanup any symlinks so they match policy
	perl -MFile::Find -le '$$,=" ";my ($$s,$$d); find sub {-l || return; \
		($$s=readlink)=~s!^/!!; \
		($$d=$$File::Find::name)=~s!debian/tmp/!!; \
		unlink && print $$s, $$d;}, "debian/tmp";' > debian/links
	dh_link

#	Strip the libraries/binaries. COFF files have to be stripped
#	seperately.
	for lib in $(wildcard $(m68k_libs)); do \
		$(DESTDIR)/usr/$(ANAME)/bin/strip --strip-debug $$lib; done
	dh_strip $(patsubst %,--exclude=%,$(wildcard $(m68k_libs)))

	dh_compress
	dh_fixperms
	dh_shlibdeps
	dh_gencontrol
	dh_makeshlibs
	dh_installdeb
	dh_md5sums
	dh_builddeb

binary-indep:

binary: binary-indep binary-arch

.PHONY: binary binary-arch binary-indep post-build clean

#
# X?emacs stuff
#
# Local Variables:
# mode: makefile
#