0038f006a8f052a1dfd5c958579ce50a5c338f5a
[framework/uifw/xorg/lib/libxpm.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for the Debian libxpm 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 = libxpm4
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_BUILD_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_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
34 #       confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
35 endif
36
37
38 build: build-stamp
39 build-stamp:
40         dh_testdir
41         autoreconf -vfi
42         mkdir -p obj-$(DEB_BUILD_GNU_TYPE)
43         cd obj-$(DEB_BUILD_GNU_TYPE) && \
44         ../configure --prefix=/usr --mandir=\$${prefix}/share/man \
45                      --infodir=\$${prefix}/share/info $(confflags) \
46                      CFLAGS="$(CFLAGS)" \
47                      LDFLAGS="$(LDFLAGS)" 
48         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
49         >$@
50
51 clean:
52         dh_testdir
53         dh_testroot
54         rm -f build-stamp
55
56         rm -f config.cache config.log config.status
57         rm -f */config.cache */config.log */config.status
58         rm -f conftest* */conftest*
59         rm -rf autom4te.cache */autom4te.cache
60         rm -rf obj-*
61         rm -f aclocal.m4 compile config.guess config.h.in config.sub configure
62         rm -f INSTALL depcomp install-sh ltmain.sh missing mkinstalldirs
63         rm -f $$(find -name Makefile.in)
64
65         dh_clean
66
67 install: build
68         dh_testdir
69         dh_testroot
70         dh_clean -k
71         dh_installdirs
72
73         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
74
75 # Build architecture-dependent files here.
76 binary-arch: build install
77         dh_testdir
78         dh_testroot
79
80 #       dh_installdocs
81         dh_install --sourcedir=debian/tmp --list-missing
82 #       dh_installchangelogs ChangeLog
83         dh_link
84         dh_strip --dbg-package=$(PACKAGE)-dbg
85         dh_compress
86         dh_fixperms
87         dh_makeshlibs
88         dh_shlibdeps
89         dh_installdeb
90         dh_gencontrol
91         dh_md5sums
92         dh_builddeb
93
94 # Build architecture-independent files here.
95 binary-indep: build install
96 # Nothing to do
97
98 binary: binary-indep binary-arch
99 .PHONY: build clean binary-indep binary-arch binary install