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