File: rules

package info (click to toggle)
libgc4 4.12-4.13alpha1-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 1,320 kB
  • ctags: 3,801
  • sloc: ansic: 17,012; cpp: 575; makefile: 331; asm: 264; sh: 11
file content (141 lines) | stat: -rwxr-xr-x 4,306 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/usr/bin/make -f
# debian/rules file - for the Boehm GC
# Copyright 1994,1995 by Ian Jackson
# Copyright 1998 by Rob Browning

SHELL=/bin/bash

libname  := libgc

pwd      := $(shell pwd)

srcname  := $(shell dpkg-parsechangelog | grep Source:)
srcname  := $(shell echo ${srcname} | perl -pe 's/^Source:\s+//o')
libmajor := $(shell echo ${srcname} | perl -ne 'm/\d+$$/o; print $$&')

version   := $(shell dpkg-parsechangelog | grep Version:)
version   := $(shell echo ${version} | perl -pe 's/^Version:\s+//o')
upstream  := $(shell echo ${version} | perl -pe 's/-[^-]*$$//o')
deb_rev   := $(shell echo ${version} | perl -pe 's/.*-//o')

shlibpkgname := ${libname}${libmajor}
shlibminpkg  := ${upstream}-1

# the architecture of the package
arch      := $(shell dpkg --print-architecture)

# The Debian target name of the package
target    := ${arch}-debian-linux-gnu

check-auto-parse:
	@echo "     srcname:" ${srcname}
	@echo "    libmajor:" ${libmajor}
	@echo "     version:" ${version}
	@echo "    upstream:" ${upstream}
	@echo "     deb_rev:" ${deb_rev}
	@echo "shlibpkgname:" ${shlibpkgname}
	@echo " shlibminpkg:" ${shlibminpkg}

build:
	${checkdir}
	make clean # required before building shared lib.
	make CC=gcc DEBIAN_SONAME=${libname}.so.${libmajor} \
              DEBIAN_CFLAGS="-g -O2 -D_REENTRANT -fPIC" liblinuxgc.so
	make clean # required before building normal libs.
	make CC=gcc DEBIAN_CFLAGS="-g -O2 -D_REENTRANT"
	make CC=gcc DEBIAN_CFLAGS="-g -O2 -D_REENTRANT" cords
	make CC=gcc DEBIAN_CFLAGS="-g -O2 -D_REENTRANT" c++
	touch build

clean:
	${checkdir}
	${MAKE} clean
	rm -f liblinuxgc.so libgc.a base_lib c++
	rm -f build debian/stamp-* debian/substvars
	find -name '*~' -o -name core | xargs --no-run-if-empty rm -f
	rm -rf debian/tmp debian/files*

binary-indep:	checkroot build
	${checkdir}
  # There are no architecture-independent files to be uploaded
  # generated by this package.  If there were any they would be
  # made here.

binary-arch:	checkroot build
	${checkdir}
	rm -rf debian/tmp
	install -d debian/tmp

	install -d debian/tmp/usr/include/gc
	cp -a include/* debian/tmp/usr/include/gc

	install -d debian/tmp/usr/lib
	install gc.a debian/tmp/usr/lib/${libname}.a
	strip --strip-debug debian/tmp/usr/lib/${libname}.a
	install liblinuxgc.so debian/tmp/usr/lib/${libname}.so.${upstream}
	strip --strip-unneeded debian/tmp/usr/lib/${libname}.so.${upstream}
	(cd debian/tmp/usr/lib && \
    ln -s ${libname}.so.${upstream} ${libname}.so.${libmajor}; \
    ln -s ${libname}.so.${upstream} ${libname}.so)

  # manpages
	install -d debian/tmp/usr/man/man3
	cp gc.man debian/tmp/usr/man/man3/gc.3
	find debian/tmp/usr/man -type f | xargs gzip -9v
	for alias in \
    GC_malloc GC_malloc_atomic GC_free GC_realloc GC_enable_incremental \
    GC_register_finalizer GC_malloc_ignore_off_page \
    GC_malloc_atomic_ignore_off_page GC_set_warn_proc; \
  do \
    (cd debian/tmp/usr/man/man3 && ln -s gc.3.gz $${alias}.3.gz); \
  done

  # docs
	install -d debian/tmp/usr/doc/libgc4
	install README README.linux README.debugging README.QUICK README.alpha \
    debian/tmp/usr/doc/libgc4
	install cord/README debian/tmp/usr/doc/libgc4/README.cord
	cp debian/changelog debian/tmp/usr/doc/libgc4/changelog.Debian
	find debian/tmp/usr/doc/libgc4 -type f | xargs gzip -9v
	cp debian/copyright debian/tmp/usr/doc/libgc4

  # Mangle permissions to conform.
	chown -R root.root debian/tmp
	find debian/tmp -type d | xargs chmod 755
	find debian/tmp -not -type d -a -not -type l | xargs chmod 644
  #	chmod 755 debian/tmp/usr/bin/*

  # control scripts	
	install -d debian/tmp/DEBIAN
	install --mode 755 debian/postinst debian/tmp/DEBIAN

	echo "${libname} ${libmajor}    ${shlibpkgname} (>= ${shlibminpkg})" > \
    debian/shlibs
	install --mode 644 debian/shlibs debian/tmp/DEBIAN

  # Final steps...
	dpkg-shlibdeps debian/tmp/usr/lib/${libname}.so.${upstream}
	dpkg-gencontrol -plibgc4
	dpkg --build debian/tmp ..

define checkdir
	test -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

# Local variables:
# mode: makefile
# tab-width: 2
# End: