Tizen 2.1 base
[platform/core/uifw/e17-extra-config-modules.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 = e17-extra-config-modules
12 PREFIX ?= /usr
13
14 #include debian/xsfbs/xsfbs.mk
15
16 # This package contains multiple modules as shipped by upstream. Each module is # 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 DEF_SUBDIRS= config-slp
19 SUBDIRS=$(DEF_SUBDIRS)
20 BUILD_STAMPS = $(addprefix $(STAMP_DIR)/build-,$(SUBDIRS))
21
22 CFLAGS = -Wall -g -fPIC -rdynamic
23 CXXFLAGS += -fPIC
24 LDFLAGS += -Wl,--hash-style=both -Wl,--as-needed -Wl,--rpath=$(PREFIX)/lib
25
26 # Machine name
27 MACHINE_NAME=$(shell uname -m)
28
29 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
30         CFLAGS += -O0
31 else
32         CFLAGS += -O2
33 endif
34 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
35         NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
36         MAKEFLAGS += -j$(NUMJOBS)
37 endif
38
39 ifeq ($(MACHINE_NAME), arm)
40         CFLAGS  += -D_ENV_ARM
41 endif
42
43 DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
44 DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
45 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
46 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
47         confflags += --build=$(DEB_HOST_GNU_TYPE)
48 else
49         confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
50 endif
51
52 build:
53         >$@
54         for FILE in $(SUBDIRS); do \
55                 mkdir -p "$$FILE"-obj-$(DEB_BUILD_GNU_TYPE) ; \
56                 cd "$$FILE" && ./autogen.sh && cd ..; \
57                 cd "$$FILE"-obj-$(DEB_BUILD_GNU_TYPE) && ../"$$FILE"/configure --prefix=/usr "$(confflags)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" && $(MAKE) || exit ; \
58                 cd ..; \
59         done
60         >$@
61
62 clean:
63         dh_testdir
64         dh_testroot
65         rm -f 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 build
73
74         dh_clean
75
76 install: build
77         dh_testdir
78         dh_testroot
79         dh_clean -k
80         dh_installdirs
81
82         for FILE in $(SUBDIRS); do \
83                 cd "$$FILE"-obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install ; \
84                 cd ..; \
85         done
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_installmenu
95         dh_installchangelogs
96         dh_link
97         dh_strip --dbg-package=$(PACKAGE)-dbg
98         dh_compress
99         dh_fixperms
100         dh_installdeb
101         dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
102         dh_gencontrol
103         dh_md5sums
104         dh_builddeb
105
106 # Build architecture-independent files here.
107 binary-indep: build install
108 # Nothing to do
109
110 binary: binary-indep binary-arch
111 .PHONY: build clean binary-indep binary-arch binary install