1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
|
#!/usr/bin/make -f
############################ -*- Mode: Makefile -*- ###########################
## rules ---
## Author : Manoj Srivastava ( srivasta@tiamat.datasync.com )
## Created On : Tue Feb 11 15:39:24 1997
## Created On Node : tiamat.datasync.com
## Last Modified By : Manoj Srivastava
## Last Modified On : Tue Feb 8 20:17:41 2000
## Last Machine Used: glaurung.green-gryphon.com
## Update Count : 88
## Status : Unknown, Use with caution!
## HISTORY :
## Description :
##
###############################################################################
# The name of the package (for example, `emacs').
package = $(shell grep Source debian/control | sed 's/^Source: //')
version := $(shell perl -n0777e 'if ($$. == 1 && m/\(([\S]+)\)/o){print "$$1\n";}' debian/changelog)
#
# VERSION=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | \
# sed 's/^Version: *//')
#
FILES_TO_CLEAN := vm.elc vm.info* debian/files debian/substvars
STAMPS_TO_CLEAN := stamp-binary stamp-build stamp-html stamp-el
DIRS_TO_CLEAN := debian/tmp debian/tmp-el debian/html
# Location of the source dir
SRCTOP := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi;)
TMPTOP := $(SRCTOP)/debian/tmp
INFODIR := $(TMPTOP)/usr/share/info
DOCDIR := $(TMPTOP)/usr/share/doc/$(package)
DOCBASE := $(TMPTOP)/usr/share/doc-base
MENUDIR := $(TMPTOP)/usr/lib/menu
LISPDIR := $(TMPTOP)/usr/share/emacs/site-lisp/$(package)
PIXMAPDIR := $(LISPDIR)/etc
STARTDIRS := $(TMPTOP)/etc/emacs19/site-start.d
COMPILEDIR:= $(TMPTOP)/usr/lib/emacsen-common/packages/
STARTFILE := $(package)-init.el
# install commands
install_file := install -p -o root -g root -m 644
install_program := install -p -o root -g root -m 755
make_directory := install -p -d -o root -g root -m 755
all build: stamp-build
stamp-build:
$(checkdir)
$(MAKE) vm.info
# This used to be needed for older dpkg-sources
#-test ! -d debian/examples && $(MAKE) -f debian/rules explode
#$(MAKE) INFODIR=$(INFODIR) LISPDIR=$(LISPDIR) PIXMAPDIR=$(PIXMAPDIR);
touch stamp-build
clean:
$(checkdir)
-rm -f $(FILES_TO_CLEAN) $(STAMPS_TO_CLEAN)
-rm -rf $(DIRS_TO_CLEAN)
-$(MAKE) clean
-rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print` TAGS
implode:
$(checkdir)
-test -d debian/examples && (cd debian && \
tar zfc debian.tar.gz examples && \
uuencode debian.tar.gz debian.tar.gz > debian.uue \
&& rm -f debian.tar.gz )
explode:
$(checkdir)
-test ! -d debian/examples && (cd debian && uudecode debian.uue \
&& tar zfx debian.tar.gz && rm -f debian.tar.gz )
binary: binary-arch binary-indep
binary-arch: build
# builds the architecture dependent part
binary-indep: build html stamp-binary
stamp-binary: html
@test 0 = $$(id | sed -e 's/(.*$$//' -e 's/^uid=//') || \
(echo need root priviledges; exit 1)
$(checkdir)
rm -rf debian/tmp debian/tmp.deb
$(make_directory) debian/tmp/DEBIAN
$(make_directory) $(INFODIR)
$(make_directory) $(LISPDIR)
$(make_directory) $(STARTDIRS)
$(make_directory) $(DOCDIR)/examples
$(make_directory) $(PIXMAPDIR)
$(make_directory) $(DOCBASE)
$(make_directory) $(MENUDIR)
$(make_directory) $(COMPILEDIR)/install
$(make_directory) $(COMPILEDIR)/remove
$(install_file) make-autoloads $(LISPDIR)
$(install_file) Makefile *.el $(LISPDIR)
$(install_file) debian/$(STARTFILE) $(LISPDIR)
$(install_file) vm.info* $(INFODIR)/
$(install_file) debian/changelog $(DOCDIR)/changelog.Debian
$(install_file) debian/README.debian $(DOCDIR)
$(install_file) debian/README.hilit19 $(DOCDIR)
$(install_file) vm-vars.el $(DOCDIR)
$(install_file) README $(DOCDIR)
(cd debian/examples; tar cf - * | (cd $(DOCDIR)/examples;tar xf -))
(cd pixmaps; tar cf - * | (cd $(PIXMAPDIR); tar xf -))
rm -rf $(DOCDIR)/examples/CVS
gzip -9fqr $(INFODIR)/
gzip -9frq $(DOCDIR)/
# Make sure the copyright file is not compressed
$(install_file) debian/copyright $(DOCDIR)/copyright
$(install_file) debian/html/vm_*.html $(DOCDIR)/
$(install_file) debian/menuentry $(MENUDIR)/$(package)
$(install_file) debian/docentry $(DOCBASE)/$(package)
$(install_program) debian/postinst debian/tmp/DEBIAN/postinst
$(install_program) debian/prerm debian/tmp/DEBIAN/prerm
$(install_program) debian/postrm debian/tmp/DEBIAN/postrm
sed -e 's/=P/$(package)/g' -e 's/=V/$(version)/g' \
debian/emacsen.install > \
$(COMPILEDIR)/install/$(package)
sed -e 's/=P/$(package)/g' -e 's/=V/$(version)/g' \
debian/emacsen.remove > \
$(COMPILEDIR)/remove/$(package)
chmod 0755 $(COMPILEDIR)/install/$(package) \
$(COMPILEDIR)/remove/$(package)
dpkg-gencontrol -pvm -isp -Pdebian/tmp
chown -R root.root debian/tmp
chmod -R go=rX debian/tmp
dpkg --build debian/tmp ..
touch stamp-binary
html: stamp-html
stamp-html:
$(checkdir)
$(make_directory) debian/html
(cd debian/html; \
texi2html -doctype html2 -expandinfo -glossary -menu \
-split_chapter -verbose ../../vm.texinfo)
define checkdir
@test -f debian/rules -a -f vm-license.el || \
(echo Not in correct source directpry; exit 1)
endef
# Below here is fairly generic really
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
.PHONY: binary binary-arch binary-indep clean implode explode
|