11a0b835608b40af9f519b5f3ff2c8d210e0b9eb
[framework/graphics/pixman.git] / debian / rules
1 #!/usr/bin/make -f
2
3 #include /usr/share/quilt/quilt.make
4
5 PACKAGE = libpixman-1-0
6 SHLIBS_VERSION = 0.15.16
7
8 CFLAGS = -Wall -g
9 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
10         CFLAGS += -O0
11 else
12         CFLAGS += -O2
13 endif
14 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
15         NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
16         MAKEFLAGS += -j$(NUMJOBS)
17 endif
18
19 DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
20 DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
21 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
22 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
23         confflags += --build=$(DEB_HOST_GNU_TYPE)
24 else
25         confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
26 #       confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
27 endif
28
29 ifeq (armel, $(DEB_HOST_ARCH))
30         CFLAGS += -mfpu=vfp -mfloat-abi=softfp
31 endif
32
33 autogen: autogen-stamp
34 autogen-stamp: $(QUILT_STAMPFN)
35         dh_testdir
36         autoreconf -vfi
37         touch $@
38
39 config: config-stamp
40 config-stamp: autogen-stamp
41         dh_testdir
42         test -d obj-$(DEB_BUILD_GNU_TYPE) || mkdir obj-$(DEB_BUILD_GNU_TYPE)
43         cd obj-$(DEB_BUILD_GNU_TYPE) && \
44         ../configure \
45           --prefix=/usr \
46           --mandir=\$${prefix}/share/man \
47           --infodir=\$${prefix}/share/info \
48           $(confflags) \
49           CFLAGS="$(CFLAGS)"
50         touch $@
51
52
53 build: build-stamp
54 build-stamp: config-stamp
55         dh_testdir
56         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
57         
58         touch $@
59
60 clean: 
61         #unpatch
62         dh_testdir
63         dh_testroot
64         rm -f autogen-stamp config-stamp build-stamp install-stamp
65         
66         rm -f config.cache config.log config.status
67         rm -f */config.cache */config.log */config.status
68         rm -f conftest* */conftest*
69         rm -rf autom4te.cache */autom4te.cache
70         rm -rf obj-*
71         rm -f $$(find -name Makefile.in)
72         rm -f compile config.guess config.sub configure depcomp install-sh
73         rm -f ltmain.sh missing INSTALL aclocal.m4 config.h.in
74         
75         dh_clean
76
77 install: install-stamp
78 install-stamp: build-stamp
79         dh_testdir
80         dh_testroot
81         dh_clean -k
82         dh_installdirs
83
84         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
85         touch $@
86
87 # Install architecture-dependent files here.
88 binary-arch: install
89         dh_testdir
90         dh_testroot
91
92         dh_installdocs
93         dh_install --sourcedir=debian/tmp --list-missing
94         dh_installchangelogs ChangeLog
95         dh_link
96         dh_strip --dbg-package=$(PACKAGE)-dbg
97         dh_compress
98         dh_fixperms
99         dh_makeshlibs -p$(PACKAGE) --add-udeb $(PACKAGE)-udeb -V"$(PACKAGE) (>= $(SHLIBS_VERSION))"
100         dh_installdeb
101         dh_shlibdeps
102         dh_gencontrol
103         dh_md5sums
104         dh_builddeb
105
106 binary-indep: install
107 # Nothing to do
108
109 binary: binary-indep binary-arch
110 .PHONY: autogen config build clean binary-indep binary-arch binary install