upload tizen1.0 source
[external/opencore-amr.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # This file was originally written by Joey Hess and Craig Small.
5 # As a special exception, when this file is copied by dh-make into a
6 # dh-make output file, you may use that output file without restriction.
7 # This special exception was added by Craig Small in version 0.37 of dh-make.
8
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
11
12
13 # These are used for cross-compiling and for saving the configure script
14 # from having to guess our platform (since we know it already)
15 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
16 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
17 DEB_HOST_ARCH       ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
18 DEB_HOST_ARCH_OS    ?= $(shell dpkg-architecture -qDEB_HOST_GNU_OS)
19
20 CFLAGS = -Wall -g
21 LDFLAGS ?=
22 PREFIX ?= /usr
23
24 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
25         CFLAGS += -O0
26 else
27         CFLAGS += -O2
28 endif
29
30 CFLAGS += -fPIC
31 LDFLAGS +=-Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed -Wl,-z,defs -Wl,--hash-style=both
32
33 # shared library versions, option 1
34 version=2.0.5
35 major=2
36 # option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
37 #version=`ls src/.libs/lib*.so.* | \
38 # awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
39 #major=`ls src/.libs/lib*.so.* | \
40 # awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
41
42 configure: configure.ac
43         ./autogen.sh
44
45 config.status: configure
46         dh_testdir
47         # Add here commands to configure the package.
48         ./configure --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
49
50
51 build: build-stamp
52 build-stamp:  config.status
53         dh_testdir
54
55         # Add here commands to compile the package.
56         $(MAKE)
57
58         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
59                 cat $$f > $${f%.in}; \
60                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
61                 sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
62         done
63
64         touch $@
65
66 clean:
67         dh_testdir
68         dh_testroot
69         rm -f build-stamp 
70
71         # Add here commands to clean up after the build process.
72         -$(MAKE) distclean
73 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
74         cp -f /usr/share/misc/config.sub config.sub
75 endif
76 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
77         cp -f /usr/share/misc/config.guess config.guess
78 endif
79
80         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
81                 rm -f $${f%.in}; \
82         done
83
84         dh_clean 
85
86 install: build
87         dh_testdir
88         dh_testroot
89         dh_clean -k 
90         dh_installdirs
91
92         # Add here commands to install the package into debian/tmp
93         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
94
95
96 # Build architecture-independent files here.
97 binary-indep: build install
98 # We have nothing to do by default.
99
100 # Build architecture-dependent files here.
101 binary-arch: build install
102         dh_testdir
103         dh_testroot
104         dh_installchangelogs 
105         dh_installdocs
106         dh_installexamples
107         dh_install --sourcedir=debian/tmp
108 #       dh_installmenu
109 #       dh_installdebconf       
110 #       dh_installlogrotate
111 #       dh_installemacsen
112 #       dh_installpam
113 #       dh_installmime
114 #       dh_installinit
115 #       dh_installcron
116 #       dh_installinfo
117         dh_installman
118         dh_link
119         dh_strip -plibopencore-amrnb --dbg-package=libopencore-amrnb-dbg
120         dh_strip -plibopencore-amrwb --dbg-package=libopencore-amrwb-dbg
121         dh_compress
122         dh_fixperms
123 #       dh_perl
124 #       dh_python
125         dh_makeshlibs
126         dh_installdeb
127         dh_shlibdeps
128         dh_gencontrol
129         dh_md5sums
130         dh_builddeb
131
132 binary: binary-indep binary-arch
133 .PHONY: build clean binary-indep binary-arch binary install