0f03f8a968ed443aa723ff79c149d97e89f0aaa9
[framework/uifw/xorg/lib/libxxf86vm.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for the Debian libxxf86vm 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 = libxxf86vm1
12
13 include debian/xsfbs/xsfbs.mk
14
15 CFLAGS = -Wall -g
16 LDFLAGS +=  -Wl,--hash-style=both -Wl,--as-needed
17 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
18         CFLAGS += -O0
19 else
20         CFLAGS += -O2
21 endif
22 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
23         NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
24         MAKEFLAGS += -j$(NUMJOBS)
25 endif
26
27 DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
28 DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
29 DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
30 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
31         confflags += --build=$(DEB_HOST_GNU_TYPE)
32 else
33         confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
34 endif
35
36
37 build: patch build-stamp
38 build-stamp:
39         dh_testdir
40         autoreconf -vfi
41         mkdir -p 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 $(confflags) \
45                      CFLAGS="$(CFLAGS)" \
46                      LDFLAGS="$(LDFLAGS)" 
47         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
48         >$@
49
50 clean: xsfclean
51         dh_testdir
52         dh_testroot
53         rm -f build-stamp
54
55         rm -f config.cache config.log config.status
56         rm -f */config.cache */config.log */config.status
57         rm -f conftest* */conftest*
58         rm -rf autom4te.cache */autom4te.cache
59         rm -rf obj-*
60         rm -f aclocal.m4 config.guess config.h.in config.sub configure
61         rm -f depcomp install-sh ltmain.sh missing mkinstalldirs
62         find -name Makefile.in -exec rm -f {} \;
63         #find -name Makefile.in -delete
64         rm -f src/config.h.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_installchangelogs ChangeLog
84         dh_link
85         dh_strip --dbg-package=$(PACKAGE)-dbg
86         dh_compress
87         dh_fixperms
88         dh_makeshlibs
89         dh_shlibdeps
90         dh_installdeb
91         dh_gencontrol
92         dh_md5sums
93         dh_builddeb
94
95 # Build architecture-independent files here.
96 binary-indep: build install
97 # Nothing to do
98
99 binary: binary-indep binary-arch
100 .PHONY: build clean binary-indep binary-arch binary install