2
############################ -*- Mode: Makefile -*- ###########################
4
## Author : Manoj Srivastava ( srivasta@tiamat.datasync.com )
5
## Created On : Tue Feb 11 15:39:24 1997
6
## Created On Node : tiamat.datasync.com
2
############################ -*- Mode: Makefile; coding: utf-8 -*- ###########################
4
## Author : Manoj Srivastava ( srivasta@glaurung.green-gryphon.com )
5
## Created On : Fri Nov 14 12:33:34 2003
6
## Created On Node : glaurung.green-gryphon.com
7
7
## Last Modified By : Manoj Srivastava
8
## Last Modified On : Mon Mar 19 09:43:56 2001
8
## Last Modified On : Tue Nov 18 17:46:22 2003
9
9
## Last Machine Used: glaurung.green-gryphon.com
11
11
## Status : Unknown, Use with caution!
15
## arch-tag: 9a5063f4-1e20-4fff-b22a-de94c1e3d954
17
## This program is free software; you can redistribute it and/or modify
18
## it under the terms of the GNU General Public License as published by
19
## the Free Software Foundation; either version 2 of the License, or
20
## (at your option) any later version.
22
## This program is distributed in the hope that it will be useful,
23
## but WITHOUT ANY WARRANTY; without even the implied warranty of
24
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
## GNU General Public License for more details.
27
## You should have received a copy of the GNU General Public License
28
## along with this program; if not, write to the Free Software
29
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15
31
###############################################################################
16
# The name of the package (for example, `emacs').
17
package = $(shell grep Source debian/control | sed 's/^Source: //')
18
version := $(shell perl -n0777e 'if ($$. == 1 && m/\(([\S]+)\)/o){print "$$1\n";}' debian/changelog)
24
# set the dpkg-architecture vars
25
export DEB_BUILD_ARCH := $(shell dpkg-architecture $(ha) \
27
export DEB_BUILD_GNU_CPU := $(shell dpkg-architecture $(ha) \
29
export DEB_BUILD_GNU_SYSTEM:= $(shell dpkg-architecture $(ha) \
30
-qDEB_BUILD_GNU_SYSTEM)
31
export DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture $(ha) \
33
export DEB_HOST_ARCH := $(shell dpkg-architecture $(ha) \
35
export DEB_HOST_GNU_CPU := $(shell dpkg-architecture $(ha) \
37
export DEB_HOST_GNU_SYSTEM := $(shell dpkg-architecture $(ha) \
38
-qDEB_HOST_GNU_SYSTEM)
39
export DEB_HOST_GNU_TYPE := $(shell dpkg-architecture $(ha) \
43
# VERSION=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | \
44
# sed 's/^Version: *//')
47
FILES_TO_CLEAN := vm.elc vm.info* debian/files debian/substvars \
48
debian/buildinfo base64-decode base64-encode \
50
STAMPS_TO_CLEAN := stamp-binary stamp-build stamp-html stamp-el \
51
stamp-codec stamp-info
52
DIRS_TO_CLEAN := debian/tmp debian/tmp-el debian/html debian/codec
54
# Location of the source dir
55
SRCTOP := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi;)
56
TMPTOP := $(SRCTOP)/debian/tmp
57
INFODIR := $(TMPTOP)/usr/share/info
58
DOCDIR := $(TMPTOP)/usr/share/doc/$(package)
59
DOCBASE := $(TMPTOP)/usr/share/doc-base
60
MENUDIR := $(TMPTOP)/usr/lib/menu
61
LISPDIR := $(TMPTOP)/usr/share/emacs/site-lisp/$(package)
62
PIXMAPDIR := $(LISPDIR)/etc
63
STARTDIRS := $(TMPTOP)/etc/emacs19/site-start.d
64
COMPILEDIR:= $(TMPTOP)/usr/lib/emacsen-common/packages/
65
STARTFILE := $(package)-init.el
67
MTMPTOP := $(SRCTOP)/debian/codec
68
MDOCDIR := $(MTMPTOP)/usr/share/doc/mime-codecs
69
MBINDIR := $(MTMPTOP)/usr/bin
70
MMANDIR := $(MTMPTOP)/usr/share/man
71
MMAN1DIR := $(MMANDIR)/man1
72
LINTIANDIR:= $(TMPTOP)/usr/share/lintian/overrides
77
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
80
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
85
install_file := install -p -o root -g root -m 644
86
install_program := install -p -o root -g root -m 755
87
make_directory := install -p -d -o root -g root -m 755
89
all build: stamp-build
92
# This used to be needed for older dpkg-sources
93
#-test ! -d debian/examples && $(MAKE) -f debian/rules explode
94
#$(MAKE) INFODIR=$(INFODIR) LISPDIR=$(LISPDIR) PIXMAPDIR=$(PIXMAPDIR);
95
$(CC) $(CFLAGS) base64-decode.c -o base64-decode
96
$(CC) $(CFLAGS) base64-encode.c -o base64-encode
97
$(CC) $(CFLAGS) qp-decode.c -o qp-decode
98
$(CC) $(CFLAGS) qp-encode.c -o qp-encode
99
dpkg -l gcc perl dpkg 'libc*' binutils ldso make dpkg-dev |\
100
awk '$$1 == "ii" { printf("%s-%s\n", $$2, $$3) }' > \
106
-rm -f $(FILES_TO_CLEAN) $(STAMPS_TO_CLEAN)
107
-rm -rf $(DIRS_TO_CLEAN)
109
-rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
110
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
111
-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print` TAGS
115
-test -d debian/examples && (cd debian && \
116
tar zfc debian.tar.gz examples && \
117
uuencode debian.tar.gz debian.tar.gz > debian.uue \
118
&& rm -f debian.tar.gz )
121
-test ! -d debian/examples && (cd debian && uudecode debian.uue \
122
&& tar zfx debian.tar.gz && rm -f debian.tar.gz )
124
binary: binary-arch binary-indep
125
binary-arch: build stamp-codecs
128
# builds the architecture dependent part
130
@test 0 = $$(id | sed -e 's/(.*$$//' -e 's/^uid=//') || \
131
(echo need root priviledges; exit 1)
133
rm -rf $(MTMPTOP) debian/codec.deb
134
$(make_directory) $(MTMPTOP)/DEBIAN
135
$(make_directory) $(MMAN1DIR)
136
$(make_directory) $(MBINDIR)
137
$(make_directory) $(MDOCDIR)
138
$(make_directory) $(LINTIANDIR)
139
echo 'mime-codecs: postinst-does-not-set-usr-doc-link' \
140
>> $(LINTIANDIR)/mime-codecs
141
$(install_program) debian/postinst.codec $(MTMPTOP)/DEBIAN/postinst
142
$(install_program) debian/prerm.codec $(MTMPTOP)/DEBIAN/prerm
143
$(install_program) $(STRIP) base64-decode $(MBINDIR)
144
$(install_program) $(STRIP) base64-encode $(MBINDIR)
145
$(install_program) $(STRIP) qp-decode $(MBINDIR)
146
$(install_program) $(STRIP) qp-encode $(MBINDIR)
147
$(install_file) base64-decode.1 $(MMAN1DIR)
148
$(install_file) base64-encode.1 $(MMAN1DIR)
149
$(install_file) qp-decode.1 $(MMAN1DIR)
150
$(install_file) qp-encode.1 $(MMAN1DIR)
151
$(install_file) debian/README.debian $(MDOCDIR)
152
$(install_file) debian/changelog $(MDOCDIR)/changelog.Debian
153
$(install_file) debian/buildinfo $(MDOCDIR)/buildinfo.Debian
154
gzip -9fqr $(MMANDIR)
155
gzip -9fqr $(MDOCDIR)
156
$(install_file) debian/copyright $(MDOCDIR)
157
dpkg-shlibdeps base64-decode base64-encode qp-decode qp-encode
158
dpkg-gencontrol -pmime-codecs -isp -P$(MTMPTOP)
159
chown -R root.root $(MTMPTOP)
160
chmod -R go=rX $(MTMPTOP)
161
dpkg --build $(MTMPTOP) ..
164
binary-indep: build html info stamp-binary
166
stamp-binary: html info
167
@test 0 = $$(id | sed -e 's/(.*$$//' -e 's/^uid=//') || \
168
(echo need root priviledges; exit 1)
170
rm -rf $(TMPTOP) debian/tmp.deb
171
$(make_directory) $(TMPTOP)/DEBIAN
172
$(make_directory) $(INFODIR)
173
$(make_directory) $(LISPDIR)
174
$(make_directory) $(PIXMAPDIR)
175
$(make_directory) $(STARTDIRS)
176
$(make_directory) $(DOCDIR)/examples
177
$(make_directory) $(PIXMAPDIR)
178
$(make_directory) $(DOCBASE)
179
$(make_directory) $(MENUDIR)
180
$(make_directory) $(COMPILEDIR)/install
181
$(make_directory) $(COMPILEDIR)/remove
182
$(make_directory) $(LINTIANDIR)
183
echo "vm: postinst-does-not-set-usr-doc-link" \
185
$(install_file) make-autoloads $(LISPDIR)
186
$(install_file) Makefile *.el $(LISPDIR)
187
$(install_file) debian/$(STARTFILE) $(LISPDIR)
188
$(install_file) pixmaps/*.xbm $(PIXMAPDIR)
189
$(install_file) pixmaps/*.xpm $(PIXMAPDIR)
190
$(install_file) vm.info* $(INFODIR)/
191
$(install_file) debian/changelog $(DOCDIR)/changelog.Debian
192
$(install_file) debian/README.debian $(DOCDIR)
193
$(install_file) debian/README.hilit19 $(DOCDIR)
194
$(install_file) vm-vars.el $(DOCDIR)
195
$(install_file) README $(DOCDIR)
196
$(install_file) debian/buildinfo $(DOCDIR)/buildinfo.Debian
197
(cd debian/examples; tar cf - * | (cd $(DOCDIR)/examples;tar xf -))
198
(cd pixmaps; tar cf - * | (cd $(PIXMAPDIR); tar xf -))
199
rm -rf $(DOCDIR)/examples/CVS
200
gzip -9fqr $(INFODIR)/
201
gzip -9frq $(DOCDIR)/
202
# Make sure the copyright file is not compressed
203
$(install_file) debian/copyright $(DOCDIR)/copyright
204
$(install_file) debian/html/vm_*.html $(DOCDIR)/
205
$(install_file) debian/menuentry $(MENUDIR)/$(package)
206
$(install_file) debian/docentry $(DOCBASE)/$(package)
207
$(install_program) debian/postinst $(TMPTOP)/DEBIAN/postinst
208
$(install_program) debian/prerm $(TMPTOP)/DEBIAN/prerm
209
$(install_program) debian/postrm $(TMPTOP)/DEBIAN/postrm
210
sed -e 's/=P/$(package)/g' -e 's/=V/$(version)/g' \
211
debian/emacsen.install > \
212
$(COMPILEDIR)/install/$(package)
213
sed -e 's/=P/$(package)/g' -e 's/=V/$(version)/g' \
214
debian/emacsen.remove > \
215
$(COMPILEDIR)/remove/$(package)
216
chmod 0755 $(COMPILEDIR)/install/$(package) \
217
$(COMPILEDIR)/remove/$(package)
218
dpkg-gencontrol -pvm -isp -P$(TMPTOP)
219
chown -R root.root $(TMPTOP)
220
chmod -R go=rX $(TMPTOP)
221
dpkg --build $(TMPTOP) ..
228
$(make_directory) debian/html
230
texi2html -doctype html2 -expandinfo -menu \
231
-split_chapter -verbose ../../vm.texinfo)
242
@test -f debian/rules -a -f vm-license.el || \
243
(echo Not in correct source directpry; exit 1)
246
# Below here is fairly generic really
249
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
251
.PHONY: binary binary-arch binary-indep clean implode explode
33
# Include dpkg-architecture generated variables
34
include debian/common/archvars.mk
36
# Set variables with information extracted from control and changelog files
37
include debian/common/pkgvars.mk
39
# variables useful for perl packages
40
include debian/common/perlvars.mk
43
include debian/common/install_cmds.mk
45
include debian/local-vars.mk
47
include debian/common/copt.mk
49
include debian/common/automake.mk
54
@echo nothing to be done
56
include debian/common/targets.mk
58
include debian/local.mk