Source

reftex / Makefile.Carsten

Full commit
# Makefile - for the RefTeX distribution.
#
# Maintainer: Carsten Dominik <dominik@strw.leidenuniv.nl
# Version: 4.8 
#
# To install RefTeX, edit the Makefile, type `make', then `make install'.
# To create the postscript documentation file reftex.ps, type `make ps'.
# To create the HTML documentation file reftex.html, type `make html'.

##----------------------------------------------------------------------
##  YOU MUST EDIT THE FOLLOWING LINES 
##----------------------------------------------------------------------

# Where local software is found
prefix=/usr/local

# Where info files go.
infodir = $(prefix)/info

# Where local lisp files go.
lispdir = $(prefix)/share/emacs/site-lisp

# Name of your emacs binary
EMACS=xemacs

##----------------------------------------------------------------------
## YOU MAY NEED TO EDIT THESE
##----------------------------------------------------------------------

# Using emacs in batch mode.
BATCH=$(EMACS) -batch -q -l lpath.el

# Specify the byte-compiler for compiling RefTeX files
ELC= $(BATCH) -f batch-byte-compile

# How to make a dvi file from a texinfo file
TEXI2DVI = texi2dvi

# How to create directories
MKDIR = mkdir -p

# How to make a postscript file from a dvi file
DVIPS = dvips

# How to create the info files from the texinfo file
MAKEINFO = makeinfo

# How to create the HTML file
TEXI2HTML = texi2html -monolithic -number

# How to move the byte compiled files to their destination.  
MV = mv

# How to copy the lisp files to their distination.
CP = cp -p

##----------------------------------------------------------------------
##  BELOW THIS LINE ON YOUR OWN RISK!
##----------------------------------------------------------------------

# The following variables need to be defined by the maintainer
METAFILE   = REFTEX.el
LISPFILES  = reftex-vars.el reftex.el reftex-auc.el reftex-cite.el\
             reftex-global.el reftex-parse.el reftex-ref.el\
             reftex-sel.el reftex-toc.el reftex-vcr.el reftex-index.el
ELCFILES   = $(LISPFILES:.el=.elc)
TEXIFILES  = reftex.texinfo
INFOFILES  = reftex reftex-1 reftex-2 reftex-3 reftex-4 reftex-5
FTPDIR     = /ftphome/pub/dominik/reftex/
HTMLDIR    = /home/strw/dominik/public_html

# An alternative installation point
MY_INFODIR = /home/strw/dominik/lib/emacs/info
MY_LISPDIR = /home/strw/dominik/lib/emacs/lisp

.SUFFIXES: .el .elc .texinfo
SHELL = /bin/sh

DISTFILES=  README INSTALL NUTSHELL CHANGES COPYING Makefile\
	    $(LISPFILES) reftex.texinfo $(INFOFILES) lpath.el

all:	lisp

split:
	perl split_reftex $(METAFILE)

install: install-lisp install-info

lisp:	$(LISPFILES)
	$(ELC) $(LISPFILES)

compile: $(LISPFILES)
	$(ELC) $(LISPFILES)

info:	$(INFOFILES)

dvi:    reftex.dvi

view:   
	xdvi reftex.dvi&

ps:	reftex.ps

html:	reftex.html

nutshell: reftex.nutshell

install-lisp: $(LISPFILES) $(ELCFILES)
	if [ ! -d $(lispdir) ]; then $(MKDIR) $(lispdir); else true; fi ;
	$(CP) $(LISPFILES) $(lispdir)
	$(CP) $(ELCFILES)  $(lispdir)

install-info: $(INFOFILES)
	if [ ! -d $(infodir) ]; then $(MKDIR) $(infodir); else true; fi ;
	$(CP) $(INFOFILES) $(infodir)

reftex.elc: reftex.el
	$(ELC) reftex.el

reftex: reftex.texinfo
	$(MAKEINFO) reftex.texinfo

reftex-1: reftex.texinfo
	$(MAKEINFO) reftex.texinfo

reftex-2: reftex.texinfo
	$(MAKEINFO) reftex.texinfo

reftex-3: reftex.texinfo
	$(MAKEINFO) reftex.texinfo

reftex-4: reftex.texinfo
	$(MAKEINFO) reftex.texinfo

reftex-5: reftex.texinfo
	$(MAKEINFO) reftex.texinfo

reftex.dvi: reftex.texinfo
	$(TEXI2DVI) reftex.texinfo

reftex.ps: reftex.dvi
	$(DVIPS) -o reftex.ps reftex.dvi

reftex.html: reftex.texinfo
	$(TEXI2HTML) reftex.texinfo

reftex.nutshell: reftex.html
	perl nutshell.pl reftex.html > reftex.nutshell

NUTSHELL: reftex.texinfo
	makeinfo --no-headers reftex.texinfo|perl NUTSHELL.pl>NUTSHELL

wcompile:
	xemacs -batch -q -l lpath-warn.el -f batch-byte-compile $(LISPFILES)

ecompile:
	emacs -batch -q -l lpath-warn.el -f batch-byte-compile $(LISPFILES)

ccompile:
	xemacs -batch -q -l lpath-compatible.el -f batch-byte-compile $(LISPFILES)

myinstall: $(LISPFILES) $(ELCFILES) $(INFOFILES)
	if [ ! -d $(MY_LISPDIR) ]; then $(MKDIR) $(MY_LISPDIR); else true; fi ;
	$(CP) $(LISPFILES) $(MY_LISPDIR)
	$(CP) $(ELCFILES)  $(MY_LISPDIR)
	if [ ! -d $(MY_INFODIR) ]; then $(MKDIR) $(MY_INFODIR); else true; fi ;
	$(CP) $(INFOFILES) $(MY_INFODIR)

distfile:
	make split
	make info
	make NUTSHELL
	@if [ "X$(TAG)" = "X" ]; then echo "*** No tag ***"; exit 1; fi
	rm -rf reftex-$(TAG)
	$(MKDIR) reftex-$(TAG)
	cp $(DISTFILES) reftex-$(TAG)/
	perl -pi -e 's/\sVERSIONTAG\b/ $(TAG)/' reftex-$(TAG)/*
	gtar zcvf reftex-$(TAG).tar.gz reftex-$(TAG)
	rm -rf reftex-$(TAG)

dist:
	make distfile TAG=$(TAG)
	cp reftex-$(TAG).tar.gz $(FTPDIR)
	rm -f $(FTPDIR)/reftex.tar.gz
	rm -f $(FTPDIR)/reftex-alpha.tar.gz
	(cd $(FTPDIR); ln -s reftex-$(TAG).tar.gz reftex.tar.gz)
	(cd $(FTPDIR); ln -s reftex-$(TAG).tar.gz reftex-alpha.tar.gz)
	make ps
	make html
	gtar zcvf reftex.info.tar.gz $(INFOFILES)
	cp reftex.html $(HTMLDIR)/Tools/reftex/
	gzip -c reftex.ps > $(FTPDIR)/reftex.ps.gz
	gzip -c reftex.texinfo > $(FTPDIR)/reftex.texinfo.gz
	cp reftex.info.tar.gz $(FTPDIR)
	cp CHANGES $(HTMLDIR)/Tools/reftex/
	 #make nutshell
	 #cp reftex.nutshell $(HTMLDIR)/Tools/reftex/reftex.nutshell

alphadist:
	make distfile TAG=$(TAG)
	cp reftex-$(TAG).tar.gz $(FTPDIR)
	cp CHANGES $(HTMLDIR)/Tools/reftex/
	rm -f $(FTPDIR)/reftex-alpha.tar.gz
	(cd $(FTPDIR); ln -s reftex-$(TAG).tar.gz reftex-alpha.tar.gz)

distfile_emacs:
	rm -rf distributions/Emacs/reftex
	$(MKDIR) distributions/Emacs/reftex
	cp $(LISPFILES) reftex.texinfo etcNEWS distributions/Emacs/reftex
submit_emacs:
	make distfile_emacs
	cp -r distributions/Emacs/reftex distributions/Emacs/reftex-submitted
	cvs tag -F submit_emacs
patch_emacs:
	make distfile_emacs
	cp -r distributions/Emacs/reftex distributions/Emacs/reftex-submitted
	(cd distributions/Emacs; diff -c -r reftex.orig reftex>patch)
	cvs tag -F submit_emacs
accept_emacs:
	cp -r distributions/Emacs/reftex-submitted distributions/Emacs/reftex.orig
	cvs rtag -r submit_emacs -F accept_emacs

distfile_xemacs:
	rm -rf distributions/XEmacs/reftex
	$(MKDIR) distributions/XEmacs/reftex
	cp $(LISPFILES) reftex.texinfo etcNEWS distributions/XEmacs/reftex
submit_xemacs:
	make distfile_xemacs
	cp -r distributions/XEmacs/reftex distributions/XEmacs/reftex-submitted
	cvs tag -F submit_xemacs
patch_xemacs:
	make distfile_xemacs
	cp -r distributions/XEmacs/reftex distributions/XEmacs/reftex-submitted
	(cd distributions/XEmacs; diff -c -r reftex.orig reftex>patch)
	cvs tag -F submit_xemacs
accept_xemacs:
	cp -r distributions/XEmacs/reftex-submitted distributions/XEmacs/reftex.orig
	cvs rtag -r submit_xemacs -F accept_xemacs


package_xemacs:
	rm -rf distributions/XEmacs/package
	$(MKDIR) distributions/XEmacs/package
	$(MKDIR) distributions/XEmacs/package/lisp/reftex
	$(MKDIR) distributions/XEmacs/package/info/reftex
	$(MKDIR) distributions/XEmacs/package/pgkinfo
	$(MKDIR) distributions/XEmacs/package/man
	cp $(LISPFILES) $(ELCFILES) distributions/XEmacs/package/lisp/reftex
	cp $(INFOFILES) distributions/XEmacs/package/info/reftex
	cp $(TEXIFILES) distributions/XEmacs/package/man
	(cd distributions/XEmacs/package/;ls -1 > pgkinfo/MANIFEST.reftex)

clean:
	rm -f $(ELCFILES)
	rm -f *~ 
	rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs
	rm -f *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps

veryclean:
	rm -f $(LISPFILES) $(ELCFILES) REFTEX.elc
	rm -f *~ reftex reftex-[1-9]
	rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs
	rm -f *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps
	rm -f reftex-emacs.el reftex.el.orig reftex.texinfo.orig reftex.tar.gz
	rm -f reftex.info.tar.gz reftex.nutshell *-patch-*
	rm -f *.rel


linkelc:
	(cd ../lisp;ln -s ../reftex/reftex*.elc .)

unlinkelc:
	rm ../lisp/reftex*.elc

.el.elc:
	$(ELC) $<