1 # Makefile for emacs-lisp package
3 #ident "@(#)v3_9_5:Makefile,v 1.11 2000/12/24 20:06:28 monnier Exp"
5 # Copyright (C) 1998-1999 Stefan Monnier <monnier@cs.yale.edu>
7 # This file is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by the
9 # Free Software Foundation; either version 2, or (at your option) any
12 # This file is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Emacs; see the file COPYING. If not, write to
19 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
21 # load the package-specific settings
24 # set up the usual installation paths
26 datadir = $(prefix)/share
28 # the directory where you install third-party emacs packges
29 lispdir = $(datadir)/emacs/site-lisp
31 # the directory where the .elc files will be installed
32 elcdir = $(lispdir)/$(PACKAGE)
33 # the directory where the .el files will be installed
36 # the file where the initialization goes.
37 #startupfile = $(HOME/.emacs
38 startupfile = $(lispdir)/site-start.el
40 # the directory where you installed the elib .elc files.
41 # This is only needed if your site-start.el (or default.el) does not
42 # set up elib correctly.
43 elibdir = $(lispdir)/elib
45 # the directory where you install the info doc
46 infodir = $(prefix)/info
47 docdir = $(prefix)/doc
59 ######################################################################
60 ### No changes below this line should be necessary ###
61 ######################################################################
63 ELFLAGS = --eval '(setq load-path (append (list "." "$(elibdir)" "$(lispdir)") load-path))'
64 ELC = $(EMACS) -batch $(ELFLAGS) -f batch-byte-compile
66 ELCFILES = $(ELFILES:.el=.elc)
68 TEXEXTS = *.cps *.fns *.kys *.vr *.tp *.pg *.log *.aux *.toc *.cp *.ky *.fn
70 .SUFFIXES: .elc .el .info .ps .dvi .texi
71 .PHONY: elcfiles info clean distclean default
72 .PHONY: install_startup install_elc install install_el install_info
73 .PHONY: dvi postscript
87 ######################################################################
94 install_elc: $(ELCFILES) $(PACKAGE)-startup.el
96 for f in $(ELCFILES) $(PACKAGE)-startup.el; do \
97 $(CP) $$f $(elcdir)/$$f ;\
102 for f in $(ELFILES); do \
103 $(CP) $$f $(eldir)/$$f ;\
106 install_info: $(PACKAGE).info
108 $(CP) *.info* $(infodir)/
109 -[ ! -w $(infodir)/dir ] \
110 || install-info --info-dir=$(infodir)/dir $(PACKAGE).info
114 @if grep $(PACKAGE) $(lispdir)/site-start.el >/dev/null 2>&1 || \
115 grep $(PACKAGE) $(startupfile) >/dev/null 2>&1 || \
116 grep $(PACKAGE) $(lispdir)/default.el >/dev/null 2>&1; then \
117 echo "**********************************************************" ;\
118 echo "*** It seems you already have some setup code" ;\
119 echo "*** for $(PACKAGE) in your startup files." ;\
120 echo "*** Check that it properly loads \"$(PACKAGE)-startup\"" ;\
121 echo "**********************************************************" ;\
123 echo 'echo ";; load $(PACKAGE) setup code" >>$(startupfile)' ;\
124 echo ";; load $(PACKAGE) setup code" >>$(startupfile) ;\
125 echo 'echo "(add-to-list '\''load-path \"$(elcdir)\")" >>$(startupfile)' ;\
126 echo "(add-to-list 'load-path \"$(elcdir)\")" >>$(startupfile) ;\
127 echo 'echo "(load \"$(PACKAGE)-startup\")" >>$(startupfile)' ;\
128 echo "(load \"$(PACKAGE)-startup\")" >>$(startupfile) ;\
131 postscript: $(PACKAGE).ps
135 $(CP) `find . -type f -name '*.dvi' -print` $(docdir)/
137 install: install_elc install_info install_startup install_el
140 $(RM) *~ core .\#* $(TEXEXTS)
146 $(RM) *.elc *.dvi *.info* *.ps
148 ######################################################################
149 ### don't look below ###
150 ######################################################################
152 $(PACKAGE)-startup.el: $(ELFILES)
153 [ -f $@ ] || echo '
\f' >$@
154 $(EMACS) --batch --eval '(setq generated-autoload-file "'`pwd`'/$@")' -f batch-update-autoloads "."
158 TAG = $(shell echo v$(VERSION) | tr '.' '_')
159 ftpdir=/home/ftp/pub/monnier/$(PACKAGE)
160 cvsmodule=$(shell cat CVS/Repository)
161 cvsroot=$(shell cat CVS/Root)
164 cvs tag -F $(TAG) &&\
166 cvs -d $(cvsroot) export -r $(TAG) -d $(PACKAGE)-$(VERSION) $(cvsmodule) &&\
167 cd $(PACKAGE)-$(VERSION) &&\
168 gmake info $(PACKAGE)-startup.el &&\
170 ztar $(PACKAGE)-$(VERSION) &&\
171 rm -rf $(PACKAGE)-$(VERSION)
172 mv $(TMP)/$(PACKAGE)-$(VERSION).tar.gz $(ftpdir)/
173 ln -sf $(PACKAGE)-$(VERSION).tar.gz $(ftpdir)/$(PACKAGE).tar.gz