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