2a315572eb2e5a9316c32bed84e0f60e5fa6408d
[captive.git] / debian / rules
1 #!/usr/bin/make -f
2 # Makefile for Debian dpkg-buildpackage(1)
3 # Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; exactly version 2 of June 1991 is required
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18
19 # Uncomment this to turn on verbose mode. 
20 #export DH_VERBOSE=1
21
22 # This is the debhelper compatibility version to use.
23 export DH_COMPAT=3
24
25 # These are used for cross-compiling and for saving the configure script
26 # from having to guess our platform (since we know it already)
27 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
28 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
29
30
31 #ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
32 #       CFLAGS += -g
33 #endif
34 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
35         INSTALL_PROGRAM += -s
36 endif
37
38 # FIXME: Use our own CFLAGS to prevent '-mcpu=i686' which up to gcc-20030214 gcc
39 # will ignore stack freeing of attribute((stdcall)) callees in caller functions code.
40 # Check at the final call of src/libcaptive/reactos/ntoskrnl/io/irp.c/IofCallDriver().
41 config.status: configure
42         dh_testdir
43         CFLAGS="-O2" ./configure --prefix=/usr --sysconfdir=/etc \
44                 --enable-shared --disable-static \
45                 --with-readline \
46                 --disable-bug-replay \
47                 --enable-lufs \
48                 --enable-install-pkg \
49                 --enable-sandbox-setuid=captive \
50                 --enable-sandbox-setgid=captive \
51                 --enable-sandbox-chroot=/var/lib/captive \
52                 --enable-sbin-mountdir=/sbin \
53                 --enable-sbin-mount-fs=ntfs:fastfat:cdfs:ext2fsd \
54                 --disable-gtk-doc
55
56 build-arch:  config.status build-arch-stamp
57 build-arch-stamp:
58         dh_testdir
59         $(MAKE)
60         touch build-arch-stamp
61
62 build: build-arch
63
64 clean:
65         dh_testdir
66         dh_testroot
67         rm -f build-stamp 
68         # Do not: -$(MAKE) distclean
69         # as we are run in clean distribution archive by AutoGen.pm
70         dh_clean
71
72 install: DH_OPTIONS=
73 install: build
74         dh_testdir
75         dh_testroot
76         dh_clean -k
77         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install-strip
78         dh_movefiles
79         #FIXME: dh_movefiles(1) ignores any directories
80         #       and dh_installdirs(1) creates them in debian/tmp/
81         mkdir -p $(CURDIR)/debian/captive/var/lib/captive
82
83 # Build architecture-dependent files here.
84 binary-arch: build install
85         dh_testdir -a
86         dh_testroot -a
87 #       dh_installdebconf -a
88         dh_installdocs -a
89 #       dh_installinit -a
90 #       dh_installman -a
91 #       dh_installchangelogs ChangeLog -a
92         dh_link -a
93         dh_compress -a
94         dh_fixperms -a
95         dh_makeshlibs -a
96         dh_installdeb -a
97         # FIXME: warning: could not find path for libcaptive-0.9cvs.so
98         #dh_shlibdeps -a
99         dh_gencontrol -a
100         dh_md5sums -a
101         dh_builddeb -a
102
103 binary: binary-arch
104 .PHONY: build clean binary-arch binary install