apply FSL(Flora Software License)
[framework/connectivity/libnet-client.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6
7 # These are used for cross-compiling and for saving the configure script
8 # from having to guess our platform (since we know it already)
9  DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
10  DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
11  
12 CFLAGS += -g -rdynamic
13 CFLAGS += -Wall -Werror
14 LDFLAGS ?=
15 PREFIX ?= /usr
16 DATADIR ?= /opt
17
18 LDFLAGS += -Wl,--as-needed
19
20 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
21         CFLAGS += -O0
22 else
23         CFLAGS += -O2
24 endif
25
26 config.status: configure
27         dh_testdir
28         # Add here commands to configure the package.
29         DATAFS="$(PREFIX)" \
30         CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
31         ./configure --prefix=$(PREFIX)
32
33 configure:
34         dh_testdir
35         ./autogen.sh
36                         
37 build: build-stamp
38
39 build-stamp: config.status 
40         dh_testdir
41
42         # Add here commands to compile the package.
43         $(MAKE) 
44
45         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
46                 cat $$f > $${f%.in}; \
47                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
48                 sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
49         done
50                                                                 
51         touch $@
52
53 clean:
54         dh_testdir
55         dh_testroot
56         rm -f build-stamp configure-stamp
57
58         # Add here commands to clean up after the build process.
59         -$(MAKE) distclean
60
61         find -name Makefile.in -exec rm -rf {} \;
62         rm -f aclocal.m4 config.guess config.h config.h.in config.sub configure depcomp install-sh ltmain.sh missing
63         rm -rf m4
64
65         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
66                 rm -f $${f%.in}; \
67         done
68
69         rm -f ../libnetwork-*.deb    
70         rm -f ../network_*.dsc     
71         rm -f ../network_*.changes
72         rm -f ../libnetwork-*.deb  
73         rm -f ../network_*.tar.gz
74                                                 
75         dh_clean 
76
77 install: build
78         dh_testdir
79         dh_testroot
80         dh_clean -k 
81         dh_installdirs
82
83         # Add here commands to install the package into debian/.
84         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
85
86
87 # Build architecture-independent files here.
88 binary-indep: build install
89 # We have nothing to do by default.
90
91 # Build architecture-dependent files here.
92 binary-arch: build install
93         dh_testdir
94         dh_testroot
95         dh_installchangelogs 
96         dh_installdocs
97         dh_installexamples
98         dh_install --sourcedir=debian/tmp
99         dh_installman
100         dh_link
101         dh_strip --dbg-package=libnetwork-dbg
102         dh_compress
103         dh_fixperms
104 #       dh_perl
105         dh_makeshlibs
106         dh_installdeb
107         dh_shlibdeps
108         dh_gencontrol
109         dh_md5sums
110         dh_builddeb
111
112 binary: binary-indep binary-arch
113 .PHONY: build clean binary-indep binary-arch binary install