9f6dd0abb19a18bd9cda249fc26e2c2ac6de24c4
[external/freealut.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 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
16 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
17 DEB_HOST_ARCH       ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
18 DEB_HOST_ARCH_OS    ?= $(shell dpkg-architecture -qDEB_HOST_GNU_OS)
19
20 CFLAGS ?= -Wall -g
21 LDFLAGS ?= 
22 PREFIX ?= /usr
23 DATADIR ?= /opt
24
25 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
26         CFLAGS += -O0
27 else
28         CFLAGS += -O2
29 endif
30
31 # architecture is not arm
32 ifneq (, $(findstring arm, $(DEB_HOST_ARCH)))
33         # do something here
34         #OPTION= --enable-aquila
35 else
36         # do something here for arm architecture
37         #OPTION= --enable-aquila
38 endif
39
40 LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed
41
42 config.status: configure
43         dh_testdir
44         # Add here commands to configure the package.
45         ./autogen.sh
46         CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --prefix=$(PREFIX)
47
48 build: build-stamp
49
50 build-stamp:  config.status
51         dh_testdir
52
53         # Add here commands to compile the package.
54         $(MAKE)
55         #docbook-to-man debian/ncurses.sgml > ncurses.1
56
57         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
58                 cat $$f > $${f%.in}; \
59                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
60                 sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
61         done
62
63         touch $@
64
65 clean:
66         dh_testdir
67         dh_testroot
68         rm -f build-stamp 
69
70         # Add here commands to clean up after the build process.
71         -$(MAKE) distclean
72 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
73         cp -f /usr/share/misc/config.sub config.sub
74 endif
75 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
76         cp -f /usr/share/misc/config.guess config.guess
77 endif
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/ncurses.
92         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
93
94
95 # Build architecture-independent files here.
96 binary-indep: build install
97 # We have nothing to do by default.
98
99 # Build architecture-dependent files here.
100 binary-arch: build install
101         dh_testdir
102         dh_testroot
103         dh_installchangelogs 
104         dh_installdocs
105         dh_installexamples
106         dh_install --list-missing --sourcedir=debian/tmp
107 #       dh_installmenu
108 #       dh_installdebconf       
109 #       dh_installlogrotate
110 #       dh_installemacsen
111 #       dh_installpam
112 #       dh_installmime
113 #       dh_python
114 #       dh_installinit
115 #       dh_installcron
116 #       dh_installinfo
117         dh_installman
118         dh_link
119         dh_strip --dbg-package=libfreealut-dbg
120         dh_compress
121         dh_fixperms
122 #       dh_perl
123         dh_makeshlibs
124         dh_installdeb
125         dh_shlibdeps
126         dh_gencontrol
127         dh_md5sums
128         dh_builddeb
129
130 binary: binary-indep binary-arch
131 .PHONY: build clean binary-indep binary-arch binary install