File: rules

package info (click to toggle)
roy 1.0.8-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,316 kB
  • ctags: 1,564
  • sloc: ansic: 14,459; sh: 8,259; makefile: 322
file content (91 lines) | stat: -rwxr-xr-x 2,188 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
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Handle DEB_BUILD_OPTIONS
ALL_CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
OPT_CFLAGS = -O0
else
OPT_CFLAGS = -O2
endif

# Avoid buildfailure on alpha
ifeq ($(DEB_HOST_ARCH),alpha)
  ALL_CFLAGS += -mieee
endif

#Common configure arguments
CONFIG_ARGS = --prefix=/usr --mandir=\$${prefix}/share/man

build: build-stamp
build-stamp:
	dh_testdir

# Standard, optimized lib
	mkdir -p bld_opt
	cd bld_opt && CFLAGS="${ALL_CFLAGS} ${OPT_CFLAGS}" ../configure ${CONFIG_ARGS}
	$(MAKE) -C bld_opt
# Debug, unoptimized lib
	mkdir -p bld_unopt
	cd bld_unopt && CFLAGS="${ALL_CFLAGS} -O0" ../configure ${CONFIG_ARGS} --libdir=\$${prefix}/lib/debug
	$(MAKE) -C bld_unopt
# Profiling lib
	mkdir -p bld_prof
	cd bld_prof && CFLAGS="${ALL_CFLAGS} -O0" ../configure ${CONFIG_ARGS} --disable-shared
	$(MAKE) -C bld_prof CFLAGS="${ALL_CFLAGS} -O0 -pg" LDFLAGS="-pg"

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp

#	-$(MAKE) distclean
	-rm -rf bld_opt bld_unopt bld_prof

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	$(MAKE) install DESTDIR=`pwd`/debian/tmp -C bld_prof
	cd debian/tmp/usr/lib && mv libroy.a libroy_p.a && sed -e 's/libroy\.a/libroy_p\.a/' libroy.la > libroy_p.la
	$(MAKE) install DESTDIR=`pwd`/debian/tmp -C bld_unopt
	$(MAKE) install DESTDIR=`pwd`/debian/tmp -C bld_opt

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_movefiles
	dh_installdocs
	dh_installexamples
	dh_installchangelogs 
	dh_strip -Nlibroy1-dbg
	dh_compress
	dh_fixperms
	dh_makeshlibs -X debug
	dh_installdeb
	dh_shlibdeps -L libroy1 -l debian/libroy1/usr/lib
	case $(DEB_HOST_ARCH) in \
		alpha|ia64)	lib=libc6.1-prof ;;	\
		hurd-i386)	lib=libc0.3-prof ;;	\
		*)		lib=libc6-prof ;;	\
	esac; echo "roy:ProfilingLib=$$lib" >> debian/libroy1-prof.substvars
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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