5 # list of flavors we build; each gets a builddir, a configure pass (configure
6 # args are defined below), a build pass, and an install pass
9 # current flavor we're building; this is only expanded in flavor specific
13 # macro to get a value for the current flavor we're building; for example
14 # when building the main flavor, $(call flavor_get,CFLAGS) will expand to
15 # main_CFLAGS if it's set or to CFLAGS otherwise; pay attention to not adding
16 # superflous spaces when for the arguments of $(call ); only some vars can
17 # be expanded in this way though
18 flavor_get = $(or $($(current_flavor)_$(1)),$($(1)))
20 # Supported backends (as of Cairo 1.7.4):
27 # Experimental and unsupported backends:
28 # directfb DirectFB (requires Build-Depend on libdirectfb-dev (>=0.9.25) )
29 # glitz OpenGL (glitz)
30 # xcb XCB (requires Build-Depend on at least libxcb1-dev)
32 # Other platform backends are auto disabled: quartz/OSX, win32/Win32
35 # --enable-png PNG (default enabled)
37 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
38 DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
39 #DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
44 --mandir=/usr/share/man \
45 --infodir=/usr/share/info \
47 --build=$(DEB_BUILD_GNU_TYPE) \
49 --enable-directfb=no \
52 --x-includes=$(PREFIX)/include \
53 --x-libraries=$(PREFIX)/lib \
57 ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
58 configure_flags += --host=$(DEB_HOST_GNU_TYPE)
61 ifeq (arm, $(findstring arm, $(DEB_HOST_GNU_TYPE)))
62 CONFIGURE_OPTIONS += \
70 main_configure_flags += \
73 ifeq ($(DISTRIBUTION),SLP)
74 configure_flags += --enable-xcb
77 builddir = $(buildbasedir)/$(current_flavor)
78 buildbasedir = $(CURDIR)/debian/build
80 installdir = $(installbasedir)/$(current_flavor)
81 installbasedir = $(CURDIR)/debian/install
83 # default CFLAGS; these can be expanded with $(call flavor_get, )
86 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
92 CFLAGS += -fPIC -rdynamic
93 LDFLAGS += -Wl,--hash-style=both -Wl,--as-needed
95 ifeq (armel, $(DEB_HOST_ARCH))
96 CFLAGS += -mfpu=vfp -mfloat-abi=softfp
99 include /usr/share/dpatch/dpatch.make
101 configure-common-stamp: patch-stamp
103 NOCONFIGURE=1 ./autogen.sh
106 configure-stamp-%: configure-common-stamp
108 mkdir -p $(builddir); \
110 $(CURDIR)/configure \
111 CFLAGS="$(call flavor_get,CFLAGS)" \
112 $(call flavor_get,configure_flags)
115 build: $(addprefix build-stamp-, $(FLAVORS))
117 build-stamp-%: configure-stamp-%
119 $(MAKE) -C $(builddir)
125 # restore files from backup
126 [ ! -r config.sub.orig ] || mv -f config.sub.orig config.sub
127 [ ! -r config.guess.orig ] || mv -f config.guess.orig config.guess
128 rm -f src/cairo-features.h
130 rm -rf $(buildbasedir) $(installbasedir)
131 # Generated by configure and breaks the build if already existing
132 rm -f src/cairo-features.h
133 # Copy in fresh copies of config.{sub,guess}
134 # (these are from autotools-dev, so must Build-Depend on it)
135 -test -r /usr/share/misc/config.sub && \
136 cp -f /usr/share/misc/config.sub config.sub
137 -test -r /usr/share/misc/config.guess && \
138 cp -f /usr/share/misc/config.guess config.guess
141 install-%: build-stamp-%
142 $(MAKE) -C $(builddir) install DESTDIR=$(installdir)
143 sed -i "/dependency_libs/ s/'.*'/''/" $(installdir)/usr/lib/*.la
150 for f in $(FLAVORS); do \
151 debian/rules install-$$f; \
154 binary-indep: build install
158 dh_installchangelogs -i ChangeLog
159 dh_installdocs -i -A NEWS README AUTHORS
168 binary-arch: build install
172 dh_installdocs -s -A README NEWS AUTHORS
173 dh_installchangelogs -s ChangeLog
175 dh_installexamples -s
177 dh_strip -s --dbg-package=libcairo2-dbg
180 dh_makeshlibs -plibcairo2 -V 'libcairo2 (>= 1.8.0-2)' -- -c4
188 binary: binary-indep binary-arch
190 .PHONY: build clean binary-indep binary-arch binary install patch unpatch clean