upload tizen2.0 source
[framework/uifw/xorg/util/x11-xkb-utils.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for the Debian xutils 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 = x11-xkb-utils
12
13 include debian/xsfbs/xsfbs.mk
14
15 # This package contains multiple modules as shipped by upstream. Each module is
16 # contained in a subdirectory in the root dir of the package. You must list each
17 # subdirectory explicitly so that the build system knows what to build
18 XKB_SUBDIRS=setxkbmap xkbcomp xkbevd xkbprint xkbutils
19 SUBDIRS=$(XKB_SUBDIRS)
20 BUILD_STAMPS = $(addprefix $(STAMP_DIR)/build-,$(SUBDIRS))
21
22 CFLAGS = -Wall -g
23 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
24         CFLAGS += -O0
25 else
26         CFLAGS += -O2
27 endif
28 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
29         NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
30         MAKEFLAGS += -j$(NUMJOBS)
31 endif
32
33 DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
34 DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
35 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
36 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
37         confflags += --build=$(DEB_HOST_GNU_TYPE)
38 else
39         confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
40 endif
41
42 build: build-stamp
43 build-stamp: $(BUILD_STAMPS)
44         >$@
45
46 $(STAMP_DIR)/build-%: $(STAMP_DIR)/genscripts $(STAMP_DIR)/patch
47         dh_testdir
48
49         mkdir -p $*-obj-$(DEB_HOST_GNU_TYPE)
50         cd $* && autoreconf -i -v -f
51         cd $*-obj-$(DEB_HOST_GNU_TYPE) && \
52         ../$*/configure --prefix=/usr --mandir=\$${prefix}/share/man \
53                         --infodir=\$${prefix}/share/info $(confflags) \
54                         --datadir=/usr/etc \
55                         CFLAGS="$(CFLAGS) "
56         cd $*-obj-$(DEB_HOST_GNU_TYPE) && $(MAKE)
57         >$@
58
59 clean: xsfclean
60         dh_testdir
61         dh_testroot
62         rm -f build-stamp
63
64         rm -f configure */Makefile.in
65         rm -f config.cache config.log config.status
66         rm -f */config.cache */config.log */config.status
67         rm -f conftest* */conftest*
68         rm -rf autom4te.cache */autom4te.cache
69         rm -rf *-obj-*
70
71         dh_clean
72
73 install: build
74         dh_testdir
75         dh_testroot
76         dh_clean -k
77         dh_installdirs
78
79         for FILE in $(SUBDIRS); do \
80                 cd "$$FILE"-obj-$(DEB_HOST_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install ; \
81                 cd ..; \
82         done
83
84 # Build architecture-dependent files here.
85 binary-arch: build install
86         dh_testdir
87         dh_testroot
88
89         dh_installdocs
90         dh_install --sourcedir=debian/tmp --list-missing
91         dh_installchangelogs
92         dh_link
93         dh_strip
94         dh_compress
95         dh_fixperms
96         dh_makeshlibs
97         dh_shlibdeps
98         dh_installdeb
99         dh_gencontrol
100         dh_md5sums
101         dh_builddeb
102
103 # Build architecture-independent files here.
104 binary-indep: build install
105 # Nothing to do
106
107 binary: binary-indep binary-arch
108 .PHONY: build clean binary-indep binary-arch binary install