]> code.delx.au - gnu-emacs-elpa/blob - Makefile
(no commit message)
[gnu-emacs-elpa] / Makefile
1 # Makefile for emacs-lisp package
2
3 # Copyright (C) 1998, 1999, 2004, 2007 Stefan Monnier <monnier@gnu.org>
4
5 # This file is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the
7 # Free Software Foundation; either version 3, or (at your option) any
8 # later version.
9
10 # This file is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 # for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with GNU Emacs; see the file COPYING. If not, write to
17 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18
19 # load the package-specific settings
20 include makefile.pkg
21
22 # set up the usual installation paths
23 prefix = /usr/local
24 datadir = $(prefix)/share
25
26 # the directory where you install third-party emacs packges
27 lispdir = $(datadir)/emacs/site-lisp
28
29 # the directory where the .elc files will be installed
30 elcdir = $(lispdir)/$(PACKAGE)
31 # the directory where the .el files will be installed
32 eldir = $(elcdir)
33
34 # the file where the initialization goes.
35 #startupfile = $(HOME/.emacs
36 startupfile = $(lispdir)/site-start.el
37
38 # the directory where you installed the elib .elc files.
39 # This is only needed if your site-start.el (or default.el) does not
40 # set up elib correctly.
41 elibdir = $(lispdir)/elib
42
43 # the directory where you install the info doc
44 infodir = $(prefix)/info
45 docdir = $(prefix)/doc
46
47 EMACS = emacs
48 MAKEINFO= makeinfo
49 TEXI2DVI= texi2dvi
50 SHELL = /bin/sh
51 DVIPS = dvips
52 CP = cp
53 RM = rm -f
54 MKDIR = mkdir -p
55 ETAGS = etags
56
57 ######################################################################
58 ### No changes below this line should be necessary ###
59 ######################################################################
60
61 ELFLAGS = --eval '(setq load-path (append (list "." "$(elibdir)" "$(lispdir)") load-path))'
62 ELC = $(EMACS) -batch $(ELFLAGS) -f batch-byte-compile
63
64 ELCFILES = $(ELFILES:.el=.elc)
65
66 TEXEXTS = *.cps *.fns *.kys *.vr *.tp *.pg *.log *.aux *.toc *.cp *.ky *.fn
67
68 .SUFFIXES: .elc .el .info .ps .dvi .texi
69 .PHONY: elcfiles info clean distclean default
70 .PHONY: install_startup install_elc install install_el install_info
71 .PHONY: dvi postscript
72
73 .el.elc:
74 $(ELC) $<
75
76 .texi.info:
77 $(MAKEINFO) $<
78
79 .texi.dvi:
80 $(TEXI2DVI) $<
81
82 .dvi.ps:
83 $(DVIPS) -f $< >$@
84
85 ######################################################################
86
87 default: elcfiles
88
89 elcfiles: $(ELCFILES)
90 info: $(PACKAGE).info
91
92 install_elc: $(ELCFILES) $(PACKAGE)-startup.el
93 $(MKDIR) $(elcdir)
94 for f in $(ELCFILES) $(PACKAGE)-startup.el; do \
95 $(CP) $$f $(elcdir)/$$f ;\
96 done
97
98 install_el:
99 $(MKDIR) $(eldir)
100 for f in $(ELFILES); do \
101 $(CP) $$f $(eldir)/$$f ;\
102 done
103
104 install_info: $(PACKAGE).info
105 $(MKDIR) $(infodir)
106 $(CP) *.info* $(infodir)/
107 -[ ! -w $(infodir)/dir ] \
108 || install-info --info-dir=$(infodir)/dir $(PACKAGE).info
109
110 install_startup:
111 $(MKDIR) $(lispdir)
112 @if grep $(PACKAGE) $(lispdir)/site-start.el >/dev/null 2>&1 || \
113 grep $(PACKAGE) $(startupfile) >/dev/null 2>&1 || \
114 grep $(PACKAGE) $(lispdir)/default.el >/dev/null 2>&1; then \
115 echo "**********************************************************" ;\
116 echo "*** It seems you already have some setup code" ;\
117 echo "*** for $(PACKAGE) in your startup files." ;\
118 echo "*** Check that it properly loads \"$(PACKAGE)-startup\"" ;\
119 echo "**********************************************************" ;\
120 else \
121 echo 'echo ";; load $(PACKAGE) setup code" >>$(startupfile)' ;\
122 echo ";; load $(PACKAGE) setup code" >>$(startupfile) ;\
123 echo 'echo "(load \"$(elcdir)/$(PACKAGE)-startup\")" >>$(startupfile)' ;\
124 echo "(load \"$(elcdir)/$(PACKAGE)-startup\")" >>$(startupfile) ;\
125 fi
126
127 postscript: $(PACKAGE).ps
128 dvi: $(PACKAGE).dvi
129 install_dvi: dvi
130 $(MKDIR) $(docdir)
131 $(CP) `find . -type f -name '*.dvi' -print` $(docdir)/
132
133 install: install_elc install_info install_startup install_el
134
135 clean:
136 $(RM) *~ core .\#* $(TEXEXTS)
137
138 TAGS tags:
139 $(ETAGS) $(ELFILES)
140
141 distclean: clean
142 $(RM) *.elc *.dvi *.info* *.ps
143
144 ######################################################################
145 ### don't look below ###
146 ######################################################################
147
148 $(PACKAGE)-startup.el: $(ELFILES)
149 [ -f $@ ] || echo '\f' >$@
150 $(EMACS) --batch --eval '(setq generated-autoload-file "'`pwd`'/$@")' -f batch-update-autoloads "."
151
152 ##
153
154 TAG = $(shell echo v$(VERSION) | tr '.' '_')
155 ftpdir=/u/monnier/html/elisp/
156 cvsmodule=$(shell cat CVS/Repository)
157 cvsroot=$(shell cat CVS/Root)
158
159 dist:
160 cvs tag -F $(TAG) &&\
161 cd $(TMP) &&\
162 cvs -d $(cvsroot) export -r $(TAG) -d $(PACKAGE)-$(VERSION) $(cvsmodule) &&\
163 cd $(PACKAGE)-$(VERSION) &&\
164 gmake info $(PACKAGE)-startup.el &&\
165 cd .. &&\
166 ztar $(PACKAGE)-$(VERSION) &&\
167 rm -rf $(PACKAGE)-$(VERSION)
168 mv $(TMP)/$(PACKAGE)-$(VERSION).tar.gz $(ftpdir)/
169 ln -sf $(PACKAGE)-$(VERSION).tar.gz $(ftpdir)/$(PACKAGE).tar.gz