Move all code to a subdir for the garage repo
[g2-sharing] / sharing-plugin-gallery2 / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*
3 # Sample debian/rules that uses debhelper.
4 # GNU copyright 1997 to 1999 by Joey Hess.
5
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
8         
9 DEBDIR = ..
10         
11 # These are used for cross-compiling and for saving the configure script
12 # from having to guess our platform (since we know it already)
13 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
14 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
15         
16 CFLAGS = -Wall -g
17         
18 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
19         CFLAGS += -O0
20 else
21         CFLAGS += -O2
22 endif
23         
24 # Use soft-float and thumb mode if it enabled.
25 ifneq (,$(findstring thumb,$(DEB_BUILD_OPTIONS)))
26         CFLAGS += -mthumb
27 endif
28         
29 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
30         INSTALL_PROGRAM += -s
31 endif
32
33 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
34         DEB_CONFIGURE_EXTRA_FLAGS += --enable-debug
35 endif
36         
37 config.status: configure
38         dh_testdir
39     
40         CFLAGS="$(CFLAGS)" ./configure \
41                 --host=$(DEB_HOST_GNU_TYPE) \
42                 --build=$(DEB_BUILD_GNU_TYPE) \
43                 --prefix=/usr \
44                 --mandir=\$${prefix}/share-template/man \
45                 --infodir=\$${prefix}/share-template/info \
46                 $(DEB_CONFIGURE_EXTRA_FLAGS)
47
48 configure: configure-stamp
49
50 configure-stamp:
51         dh_testdir
52         ./autogen.sh
53         touch configure-stamp
54         
55 build: build-stamp
56
57 build-stamp:  config.status
58         dh_testdir
59
60         $(MAKE)
61
62         touch build-stamp
63
64 clean:
65         dh_testdir
66         dh_testroot
67         rm -f build-stamp configure-stamp
68
69         [ ! -f Makefile ] || $(MAKE) distclean
70 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
71         cp -f /usr/share/misc/config.sub config.sub
72 endif
73 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
74         cp -f /usr/share/misc/config.guess config.guess
75 endif
76
77         dh_clean
78
79 install: build
80         dh_testdir
81         dh_testroot
82         dh_clean -k
83         dh_installdirs
84
85         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
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_install --sourcedir=debian/tmp -v
98         dh_link
99         dh_strip
100         dh_compress
101         dh_fixperms
102         dh_makeshlibs
103         dh_installdeb
104         dh_shlibdeps
105         dh_gencontrol
106         dh_md5sums
107         dh_builddeb --destdir=$(DEBDIR)
108         
109 binary: binary-indep binary-arch
110 .PHONY: build clean binary-indep binary-arch binary install