Tizen 2.0 Release
[pkgs/xorg/lib/libxtrap.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for the Debian libxtrap package.
3 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>
4 # Copyright © 2005 Daniel Stone <daniel@fooishbar.org>
5 # Copyright © 2005 David Nusinow <dnusinow@debian.org>
6
7 # Uncomment this to turn on verbose mode.
8 #export DH_VERBOSE=1
9
10 # set this to the name of the main shlib's binary package
11 PACKAGE = libxtrap6
12
13 include debian/xsfbs/xsfbs.mk
14
15 CFLAGS = -Wall -g
16 LDFLAGS +=  -Wl,--hash-style=both -Wl,--as-needed
17 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
18         CFLAGS += -O0
19 else
20         CFLAGS += -O2
21 endif
22 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
23         INSTALL_PROGRAM += -s
24 endif
25
26 DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
27 DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
28 DEB_BUILD_GNU_TYPE = $(DEB_HOST_GNU_TYPE)
29 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
30         confflags += --build=$(DEB_HOST_GNU_TYPE)
31 else
32         confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
33 endif
34
35
36 build: build-stamp
37 build-stamp:
38         dh_testdir
39         autoreconf -vfi
40         mkdir -p obj-$(DEB_BUILD_GNU_TYPE)
41         cd obj-$(DEB_BUILD_GNU_TYPE) && \
42         ../configure --prefix=/usr --mandir=\$${prefix}/share/man \
43                      --infodir=\$${prefix}/share/info $(confflags) \
44                      CFLAGS="$(CFLAGS)" \
45                      LDFLAGS="$(LDFLAGS)" 
46         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
47         >$@
48
49 # touch build-stamp
50
51 clean:
52         dh_testdir
53         dh_testroot
54         rm -f build-stamp
55
56         rm -f config.cache config.log config.status
57         rm -f */config.cache */config.log */config.status
58         rm -f conftest* */conftest*
59         rm -rf autom4te.cache */autom4te.cache
60         rm -rf obj-*
61
62         dh_clean
63
64 install: build
65         dh_testdir
66         dh_testroot
67         dh_clean -k
68         dh_installdirs
69
70         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
71
72 # Build architecture-dependent files here.
73 binary-arch: build install
74         dh_testdir
75         dh_testroot
76
77         dh_installdocs
78         dh_install --sourcedir=debian/tmp --list-missing
79         dh_installchangelogs
80         dh_link
81         dh_strip --dbg-package=$(PACKAGE)-dbg
82         dh_compress
83         dh_fixperms
84         dh_makeshlibs
85         dh_shlibdeps
86         dh_installdeb
87         dh_gencontrol
88         dh_md5sums
89         dh_builddeb
90
91 # Build architecture-independent files here.
92 binary-indep: build install
93 # Nothing to do
94
95 binary: binary-indep binary-arch
96 .PHONY: build clean binary-indep binary-arch binary install