aboutsummaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar David Aspinall <da@inf.ed.ac.uk>2000-05-25 17:52:33 +0000
committerGravatar David Aspinall <da@inf.ed.ac.uk>2000-05-25 17:52:33 +0000
commit3281b3cfd3af3a89f7286c847f15b74debdbd615 (patch)
treef78e9d5a8aebe6540b094c58d59c1bfeac3a1fd8 /Makefile
parentee472eeeb2a091242be2127a4a018187448ce92a (diff)
Add target for editing perl scripts too
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 25 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 5a517e6e..6bcfb6d5 100644
--- a/Makefile
+++ b/Makefile
@@ -3,8 +3,11 @@
##
## Author: David Aspinall <da@dcs.ed.ac.uk>
##
+## make - do "compile" and "scripts" targets
## make compile - make .elc's in a single session
## make all - make .elc's in separate sessions
+## make scripts - edit paths in isabelle interface scripts,
+## legotags and coqtags
##
## $Id$
##
@@ -18,6 +21,7 @@ BATCHEMACS=xemacs -batch -q -no-site-file
PWD=$(shell pwd)
BASH_SCRIPTS = isa/interface isar/interface
+PERL_SCRIPTS = lego/legotags coq/coqtags
# FIXME: would rather set load path in Elisp,
# but seems tricky to do only during compilation.
@@ -32,6 +36,8 @@ ELC=$(EL:.el=.elc)
.SUFFIXES: .el .elc
+default: compile scripts
+
##
## compile : byte compile files in working directory:
## Clearout old .elc's and re-compile in a
@@ -39,7 +45,7 @@ ELC=$(EL:.el=.elc)
## but can have artefacts because of context between
## compiles.
##
-compile: scripts
+compile:
@echo "*************************************************"
@echo " Byte compiling..."
@echo "*************************************************"
@@ -53,13 +59,15 @@ all: $(ELC)
.el.elc:
$(BYTECOMP) $*.el
-## scripts: try to patch bash scripts with path to bash
-##
##
-scripts:
+## scripts: try to patch bash and perl scripts with correct paths
+##
+scripts: bashscripts perlscripts
+
+bashscripts:
@(bash="`which bash`"; \
if [ -z "$$bash" ]; then \
- echo "Could not find bash - bash path not checked" >&2; \
+ echo "Could not find bash - bash paths not checked" >&2; \
exit 0; \
fi; \
for i in $(BASH_SCRIPTS); do \
@@ -68,6 +76,18 @@ scripts:
done; \
rm -f .tmp)
+perlscripts:
+ @(perl="`which perl`"; \
+ if [ -z "$$perl" ]; then \
+ echo "Could not find perl - perl paths not checked" >&2; \
+ exit 0; \
+ fi; \
+ for i in $(PERL_SCRIPTS); do \
+ sed "s|^#.*!.*/bin/perl.*$$|#!$$perl|" < $$i > .tmp \
+ && cat .tmp > $$i; \
+ done; \
+ rm -f .tmp)
+
clean:
rm -f $(ELC) *~
(cd doc; $(MAKE) clean)