apply FSL(Flora Software License)
[apps/home/libslp-alarm.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 CFLAGS += -Wall -g
13 CXXFLAGS +=  -Wall -g
14 LDFLAGS ?=
15 PREFIX ?= /usr
16 SHAREDIR ?= /opt/share
17 UGPREFIX ?= /opt/ug
18 UGDATADIR ?= /opt/ug/res
19 UGLIBDIR ?= /opt/ug/lib
20
21 CFLAGS ?= -fPIC -Wall -g
22 CXXFLAGS += -fPIC
23 LDFLAGS += -Wl,--rpath,$(PREFIX)/lib -Wl,--hash-style=both -Wl,--as-needed
24
25 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
26         CFLAGS += -O0
27 else
28         CFLAGS += -O2
29 endif
30
31 CMAKE_BUILD_DIR ?= $(CURDIR)/cmake_build_tmp
32
33 configure: configure-stamp
34 configure-stamp:
35         dh_testdir
36         # Add here commands to configure the package.
37         mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && \
38         CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake ${CURDIR} -DCMAKE_INSTALL_PREFIX=$(PREFIX) 
39         touch configure-stamp
40
41 build: build-stamp
42
43 build-stamp: configure-stamp
44         dh_testdir
45
46         # Add here commands to compile the package.
47         $(MAKE) -C $(CMAKE_BUILD_DIR)
48         #docbook-to-man debian/worldclock.sgml > worldclock.1
49
50         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
51                 cat $$f > $${f%.in}; \
52                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
53                 sed -i -e "s#@SHAREDIR@#$(SHAREDIR)#g" $${f%.in}; \
54                 sed -i -e "s#@PREFIX@#$(UGPREFIX)#g" $${f%.in}; \
55                 sed -i -e "s#@UGDATADIR@#$(UGDATADIR)#g" $${f%.in}; \
56                 sed -i -e "s#@UGLIBDIR@#$(UGLIBDIR)#g" $${f%.in}; \
57         done
58
59         touch $@
60
61 clean:
62         dh_testdir
63         dh_testroot
64         rm -f build-stamp configure-stamp
65
66         # Add here commands to clean up after the build process.
67         mkdir -p $(CMAKE_BUILD_DIR)
68         -$(MAKE) -C $(CMAKE_BUILD_DIR) clean
69         rm -rf $(CMAKE_BUILD_DIR)
70         find -name CMakeCache.txt | xargs rm -rf
71         find -name CMakeFiles | xargs rm -rf
72         find -name cmake_install.cmake | xargs rm -rf
73         #find -name Makefile | xargs rm -rf
74         find -name install_manifest.txt | xargs rm -rf
75         find -name *.so | xargs rm -rf
76         find -name *.edj | xargs rm -rf
77         find -name *.desktop | xargs rm -rf
78         
79         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
80                 rm -f $${f%.in}; \
81         done
82
83         dh_clean 
84
85 install: build
86         dh_testdir
87         dh_testroot
88         dh_clean -k 
89         dh_installdirs
90
91         # Add here commands to install the package into debian/worldclock.
92         $(MAKE) -C $(CMAKE_BUILD_DIR) DESTDIR=$(CURDIR)/debian/tmp install
93  
94         # Temporaruy code until next week. libug-magazine-org.tizen.clock.so
95         # cd $(CURDIR)/debian/tmp/opt/ug/lib && ln -s libug-magazine-clock-efl.so libug-magazine-clock.so
96         # cd $(CURDIR)/debian/tmp/opt/ug/lib && ln -s libug-magazine-clock-efl.so libug-magazine-org.tizen.clock.so
97
98 # Build architecture-independent files here.
99 binary-indep: build install
100 # We have nothing to do by default.
101
102 # Build architecture-dependent files here.
103 binary-arch: build install
104         dh_testdir
105         dh_testroot
106 #       dh_installchangelogs 
107 #       dh_installdocs
108         dh_installexamples
109         dh_install --sourcedir=debian/tmp
110 #       dh_installmenu
111 #       dh_installdebconf       
112 #       dh_installlogrotate
113 #       dh_installemacsen
114 #       dh_installpam
115 #       dh_installmime
116 #       dh_python
117 #       dh_installinit
118 #       dh_installcron
119 #       dh_installinfo
120         dh_installman
121         dh_link
122         #dh_strip
123         dh_strip --dbg-package=libslp-alarm-dbg
124         dh_compress
125         dh_fixperms
126 #       dh_perl
127         dh_makeshlibs
128         dh_installdeb
129         dh_shlibdeps
130         dh_gencontrol
131         dh_md5sums
132         dh_builddeb
133
134 binary: binary-indep binary-arch
135 .PHONY: build clean binary-indep binary-arch binary install configure