From 482a7715c17560fd78acc552d8c2c3a972b59759 Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Sat, 28 Feb 2004 19:51:30 +0000 Subject: Expand: add install targets, editing proofgeneral script, dealing with emacs versions. --- Makefile | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 104 insertions(+), 17 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 936e434d..68aeb2f7 100644 --- a/Makefile +++ b/Makefile @@ -6,23 +6,33 @@ ## 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 +## make scripts - edit paths to bash/perl in scripts +## make install - install into system directories ## ## $Id$ ## ########################################################################### +# Set this to "emacs" or "xemacs" according to your version of Emacs. +# NB: this is also used to set default install path names below. +EMACS=xemacs -ELISP_DIRS = generic lego coq isa isar plastic demoisa hol98 phox twelf acl2 mmm -# FIXME: automate the emacs choice to be xemacs if it can be -# found, otherwise emacs. -BATCHEMACS=xemacs -batch -q -no-site-file -#BATCHEMACS=emacs -batch -q -no-site-file +# We default to /usr rather than /usr/local because installs of +# desktop and doc files under /usr/local are unlikely to work with +# rest of the system. If that's no good for you, edit the paths +# individually before the install section. +PREFIX=/usr PWD=$(shell pwd) -BASH_SCRIPTS = isa/interface isar/interface + +ELISP_DIRS = generic lego coq isa isar plastic demoisa hol98 phox twelf acl2 mmm + +BATCHEMACS=${EMACS} -batch -q -no-site-file + +BASH_SCRIPTS = isa/interface isar/interface bin/proofgeneral PERL_SCRIPTS = lego/legotags coq/coqtags +BIN_SCRIPTS = bin/proofgeneral +PG_SCRIPTS = bin/proofgeneral # FIXME: would rather set load path in Elisp, # but seems tricky to do only during compilation. @@ -41,16 +51,20 @@ BROKENELC= .SUFFIXES: .el .elc -default: compile scripts +default: all ## ## compile : byte compile files in working directory: ## Clearout old .elc's and re-compile in a -## single Emacs process. This is faster than make all, +## single Emacs process. This is faster than "make elc", ## but can have artefacts because of context between ## compiles. ## -compile: +compile: .byte-compile + lastemacs=`cat .byte-compile`; if [ "$$lastemacs" != "$(EMACS)" ]; then rm -f .byte-compile; make .byte-compile; fi + + +.byte-compile: $(EL) x-symbol/lisp/*.el @echo "*************************************************" @echo " Byte compiling..." @echo "*************************************************" @@ -60,20 +74,86 @@ compile: rm -f $(BROKENELC) @echo " Byte compiling X-Symbol..." (cd x-symbol/lisp; rm -f *.elc; $(MAKE)) + echo $(EMACS) > $(@) @echo "*************************************************" @echo " Finished." @echo "*************************************************" -all: $(ELC) + +## +## Make .elc's individually. For testing only: it's a nuisance to +## set compiling context properly in each .el file. +## .el.elc: $(BYTECOMP) $*.el rm -f $(BROKENELC) +elc: $(ELC) + + +## +## Default targets +## + +default: compile scripts + +all: compile scripts + + +## +## Remove generated targets +## +clean: cleanpgscripts + rm -f $(ELC) *~ */*~ .\#* */.\#* .byte-compile + (cd doc; $(MAKE) clean) + (cd x-symbol/lisp; $(MAKE) distclean) + +## +## Install files +## +DESKTOP_PREFIX=${PREFIX} +ELISP=${PREFIX}/share/${EMACS}/site-lisp/ProofGeneral +BINDIR=${PREFIX}/bin +DESKTOP=${PREFIX}/share +DOCDIR=${PREFIX}/share/doc/ProofGeneral + +install: install-desktop install-elisp install-bin + +install-desktop: + mkdir -p ${DESKTOP}/icons/hicolor/16x16 + cp etc/desktop/icons/16x16/proofgeneral.png ${DESKTOP}/icons/hicolor/16x16 + mkdir -p ${DESKTOP}/icons/hicolor/32x32 + cp etc/desktop/icons/32x32/proofgeneral.png ${DESKTOP}/icons/hicolor/32x32 + mkdir -p ${DESKTOP}/icons/hicolor/48x48 + cp etc/desktop/icons/48x48/proofgeneral.png ${DESKTOP}/icons/hicolor/48x48 + mkdir -p ${DESKTOP}/pixmaps + cp etc/desktop/icons/48x48/proofgeneral.png ${DESKTOP}/pixmaps + mkdir -p ${DESKTOP}/applications + cp etc/desktop/proofgeneral.desktop ${DESKTOP}/applications + mkdir -p ${DESKTOP}/mime-info + cp etc/desktop/mime-info/proofgeneral.mime ${DESKTOP}/mime-info + cp etc/desktop/mime-info/proofgeneral.keys ${DESKTOP}/mime-info + +# NB: .el files are not strictly necessary, but we package/install them +# for the time being to help with debugging. +install-elisp: compile + mkdir -p ${ELISP} + for f in ${ELISP_DIRS}; do mkdir -p ${ELISP}/$$f; done + for f in ${ELISP_DIRS}; do cp -pf $$f/*.el ${ELISP}/$$f; done + for f in ${ELISP_DIRS}; do cp -pf $$f/*.elc ${ELISP}/$$f; done + +install-bin: scripts + mkdir -p ${BINDIR} + cp -pf ${BIN_SCRIPTS} ${BINDIR} + +# FIXME: add install-doc to install info/man pages + + ## ## scripts: try to patch bash and perl scripts with correct paths ## -scripts: bashscripts perlscripts +scripts: bashscripts perlscripts pgscripts bashscripts: @(bash="`which bash`"; \ @@ -99,10 +179,17 @@ perlscripts: done; \ rm -f .tmp) -clean: - rm -f $(ELC) *~ */*~ .\#* */.\#* - (cd doc; $(MAKE) clean) - (cd x-symbol/lisp; $(MAKE) distclean) +pgscripts: + @(pghome=${ELISP}; \ + for i in $(PG_SCRIPTS); do \ + sed "s|PGHOME=.*$$|PGHOME=$$pghome|" < $$i > .tmp \ + && cat .tmp > $$i; \ + done; \ + rm -f .tmp) + +# Set PGHOME path in scripts back to default location. +cleanpgscripts: + make pgscripts ELISP=.. ## -- cgit v1.2.3