Git init
[framework/uifw/xorg/lib/libxau.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for the Debian libxau 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 = libxau6
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         autoreconf -vfi
38
39 obj-$(DEB_BUILD_GNU_TYPE)/config.status: configure
40         mkdir -p obj-$(DEB_BUILD_GNU_TYPE)
41         cd obj-$(DEB_BUILD_GNU_TYPE) && \
42         ../configure \
43           --prefix=/usr \
44           --mandir=\$${prefix}/share/man \
45           --infodir=\$${prefix}/share/info \
46           $(confflags) \
47           CFLAGS="$(CFLAGS)"
48
49 build: build-stamp
50 build-stamp: obj-$(DEB_BUILD_GNU_TYPE)/config.status
51         dh_testdir
52
53         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
54
55         touch build-stamp
56
57 clean: xsfclean
58         dh_testdir
59         dh_testroot
60         rm -f build-stamp
61
62         rm -f config.cache config.log config.status
63         rm -f */config.cache */config.log */config.status
64         rm -f conftest* */conftest*
65         rm -rf autom4te.cache */autom4te.cache
66         rm -rf obj-*
67         rm -f $$(find -name Makefile.in)
68         rm -f compile config.guess config.sub configure depcomp install-sh
69         rm -f ltmain.sh missing INSTALL aclocal.m4 mkinstalldirs config.h.in
70
71         dh_clean
72
73 install: build
74         dh_testdir
75         dh_testroot
76         dh_clean -k
77         dh_installdirs
78
79         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
80
81 # Build architecture-dependent files here.
82 binary-arch: build install
83         dh_testdir
84         dh_testroot
85
86 #       dh_installdocs
87         dh_install --sourcedir=debian/tmp --list-missing
88 #       dh_installchangelogs ChangeLog
89         dh_link
90         dh_strip --dbg-package=$(PACKAGE)-dbg
91         dh_compress
92         dh_fixperms
93         dh_makeshlibs
94 #       dh_makeshlibs --add-udeb=$(PACKAGE)-udeb
95         dh_shlibdeps
96         dh_installdeb
97         dh_gencontrol
98         dh_md5sums
99         dh_builddeb
100
101 # Build architecture-independent files here.
102 binary-indep: build install
103 # Nothing to do
104
105 binary: binary-indep binary-arch
106 .PHONY: build clean binary-indep binary-arch binary install