Git init
[framework/uifw/xorg/proto/x11proto-xf86dga.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for the Debian x11proto-xf86dga-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 = x11proto-xf86dga-dev
11
12 include debian/xsfbs/xsfbs.mk
13
14 CFLAGS = -Wall -g
15 ifneq (,$(filter 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_HOST_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 endif
33
34
35 build: build-stamp
36 build-stamp:
37         dh_testdir
38         autoreconf -vfi
39         mkdir -p obj-$(DEB_BUILD_GNU_TYPE)
40         cd obj-$(DEB_BUILD_GNU_TYPE) && \
41         ../configure --prefix=/usr --mandir=\$${prefix}/share/man \
42                      --infodir=\$${prefix}/share/info --disable-shared \
43                      $(confflags) CFLAGS="$(CFLAGS)" 
44         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
45         >$@
46
47 clean:
48         dh_testdir
49         dh_testroot
50         rm -f build-stamp
51
52         rm -f config.cache config.log config.status config.guess config.sub
53         rm -f */config.cache */config.log */config.status */config.guess */config.sub
54         rm -f conftest* */conftest*
55         rm -rf autom4te.cache */autom4te.cache
56         rm -rf obj-*
57         rm -f aclocal.m4 configure install-sh missing mkinstalldirs
58         find -name Makefile.in -exec rm -f {} \;
59         #find -name Makefile.in -delete
60
61         dh_clean
62
63 install: build
64         dh_testdir
65         dh_testroot
66         dh_clean -k
67         dh_installdirs
68
69         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
70
71 # Build architecture-independent files here.
72 binary-indep: build install
73         dh_testdir
74         dh_testroot
75
76 #       dh_installdocs
77 #       dh_installman
78         dh_install --sourcedir=debian/tmp --list-missing
79 #       dh_installchangelogs ChangeLog
80         dh_link
81         dh_strip
82         dh_compress
83         dh_fixperms
84         dh_installdeb
85         dh_shlibdeps
86         dh_gencontrol
87         dh_md5sums
88         dh_builddeb
89
90 # Build architecture-dependent files here.
91 binary-arch: build install
92 # Nothing to do
93
94 binary: binary-indep binary-arch
95 .PHONY: build clean binary-indep binary-arch binary install