9aac7a63611b0e5530519986a182acd82765d52a
[framework/uifw/xorg/lib/libice.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for the Debian libice 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 = libice6
12
13 include debian/xsfbs/xsfbs.mk
14
15 CFLAGS = -Wall -g
16 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
17         CFLAGS += -O0
18 else
19         CFLAGS += -O2
20 endif
21 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
22         NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
23         MAKEFLAGS += -j$(NUMJOBS)
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 ?= $(shell dpkg-architecture -qDEB_BUILD_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_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
33 #       confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
34 endif
35
36 configure: $(STAMP_DIR)/patch
37         dh_testdir
38         autoreconf -vfi
39
40 build: build-stamp
41 build-stamp: configure
42         dh_testdir
43
44         test -d obj-$(DEB_BUILD_GNU_TYPE) || mkdir obj-$(DEB_BUILD_GNU_TYPE)
45         cd obj-$(DEB_BUILD_GNU_TYPE) && \
46         ../configure --prefix=/usr --mandir=\$${prefix}/share/man \
47                      --infodir=\$${prefix}/share/info $(confflags) \
48                      CFLAGS="$(CFLAGS)" 
49         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
50         >$@
51
52 clean: xsfclean
53         dh_testdir
54         dh_testroot
55         rm -f build-stamp
56
57         rm -f config.cache config.log config.status
58         rm -f */config.cache */config.log */config.status
59         rm -f conftest* */conftest*
60         rm -rf autom4te.cache */autom4te.cache
61         rm -rf obj-*
62         rm -f aclocal.m4 config.guess config.sub config.h.in configure
63         rm -f depcomp install-sh ltmain.sh missing mkinstalldirs INSTALL
64         rm -f $$(find -name Makefile.in)
65
66         dh_clean
67
68 install: build
69         dh_testdir
70         dh_testroot
71         dh_clean -k
72         dh_installdirs
73
74         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
75
76 # Build architecture-dependent files here.
77 binary-arch: build install
78         dh_testdir
79         dh_testroot
80
81 #       dh_installdocs
82         dh_install --sourcedir=debian/tmp --list-missing
83         #dh_install --sourcedir=debian/tmp --list-missing --exclude=libICE.la
84 #       dh_installchangelogs ChangeLog
85         dh_link
86         dh_strip --dbg-package=$(PACKAGE)-dbg
87         dh_compress
88         dh_fixperms
89         dh_makeshlibs
90         dh_shlibdeps
91         dh_installdeb
92         dh_gencontrol
93         dh_md5sums
94         dh_builddeb
95
96 # Build architecture-independent files here.
97 binary-indep: build install
98 # Nothing to do
99
100 binary: binary-indep binary-arch
101 .PHONY: build clean binary-indep binary-arch binary install