b84999db392ec22f167c58970e113977d685c62e
[framework/location/gps-manager.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
16 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
17 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
18 DEB_HOST_ARCH       ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
19
20 ifneq (,$(findstring armel,$(DEB_HOST_ARCH)))
21         GPS_ENABLER ?= --enable-gps
22 else
23         GPS_ENABLER ?= --disable-gps
24 endif
25
26 #CFLAGS ?= -Wall -g
27 #LDFLAGS ?=
28 PREFIX ?= /usr
29 DATADIR ?= /usr/share
30 DESTDIR ?= $(CURDIR)/debian/tmp
31
32 #CFLAGS += -O0
33 CFLAGS += -O0 -fvisibility=hidden -Wall -fPIC -g
34 CXXFLAGS += -O0 -fvisibility=hidden -Wall -fPIC -g
35 #LDFLAGS += -Wl,--as-needed -Wl,--hash-style=both
36
37 #ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
38 #       CFLAGS += -O0
39 #else
40 #       CFLAGS += -O2
41 #endif
42 #ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
43 #       CFLAGS += -g
44 #endif
45
46 configure: configure-stamp
47 configure-stamp: 
48         dh_testdir
49         # Add here commands to configure the package.
50         ./autogen.sh
51         mkdir -p build
52         cd build && CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ../configure --prefix=$(PREFIX) --datadir=$(DATADIR) $(GPS_ENABLER)
53
54         touch $@
55
56 build: build-stamp
57 build-stamp:  configure-stamp
58         dh_testdir
59
60         # Add here commands to compile the package.
61         mkdir -p build
62         cd build && $(MAKE)
63         #docbook-to-man debian/ncurses.sgml > ncurses.1
64
65         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
66                 cat $$f > $${f%.in}; \
67                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
68                 sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
69         done
70
71         touch $@
72
73 clean:
74         dh_testdir
75         dh_testroot
76         rm -f build-stamp configure-stamp
77
78         # Add here commands to clean up after the build process.
79         mkdir -p build
80         cd build
81         -$(MAKE) clean
82         -$(MAKE) distclean
83         cd ..
84 #ifneq "$(wildcard /usr/share/misc/config.sub)" ""
85 #       cp -f /usr/share/misc/config.sub config.sub
86 #endif
87 #ifneq "$(wildcard /usr/share/misc/config.guess)" ""
88 #       cp -f /usr/share/misc/config.guess config.guess
89 #endif
90
91         for f in `find $(CURDIR)/debian -name "*.in"`; do \
92                 rm -f $${f%.in}; \
93         done
94
95         find $(CURDIR) -name "Makefile.in" -exec rm -f {} \;
96
97         rm -rf build build-aux m4 configure config.h.in configure aclocal.m4
98         dh_clean 
99
100 install: build
101         dh_testdir
102         dh_testroot
103 #       dh_clean -k
104         dh_installdirs
105
106         # Add here commands to install the package into debian/ncurses.
107         mkdir -p build
108         cd build && $(MAKE) DESTDIR=$(DESTDIR) install
109
110 # Build architecture-independent files here.
111 binary-indep: build install
112 # We have nothing to do by default.
113
114 # Build architecture-dependent files here.
115 binary-arch: build install
116         dh_testdir
117         dh_testroot
118         dh_installchangelogs 
119         dh_installdocs
120         dh_installexamples
121         dh_install #--sourcedir=debian/tmp
122 #       dh_installmenu
123 #       dh_installdebconf       
124 #       dh_installlogrotate
125 #       dh_installemacsen
126 #       dh_installpam
127 #       dh_installmime
128 #       dh_python
129 #       dh_installinit
130 #       dh_installcron
131 #       dh_installinfo
132         dh_installman
133         dh_link
134 #       dh_strip
135         dh_strip --dbg-package=gps-manager-dbg
136         dh_compress
137         dh_fixperms
138 #       dh_perl
139         dh_makeshlibs
140         dh_installdeb
141         dh_shlibdeps
142         dh_gencontrol
143         dh_md5sums
144         dh_builddeb
145
146 binary: binary-indep binary-arch
147 .PHONY: build clean binary-indep binary-arch binary install