1 # Makefile for emacs-lisp package
3 # Copyright (C) 1998, 1999, 2004, 2007, 2010 Stefan Monnier <monnier@gnu.org>
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
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
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.
19 # load the package-specific settings
22 # set up the usual installation paths
24 datadir = $(prefix)/share
26 # the directory where you install third-party emacs packges
27 lispdir
= $(datadir)/emacs
/site-lisp
29 # the directory where the .elc files will be installed
30 elcdir
= $(lispdir
)/$(PACKAGE
)
31 # the directory where the .el files will be installed
34 # the file where the initialization goes.
35 #startupfile = $(HOME/.emacs
36 startupfile
= $(lispdir
)/site-start.el
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
43 # the directory where you install the info doc
44 infodir = $(prefix)/info
45 docdir
= $(prefix)/doc
57 ######################################################################
58 ### No changes below this line should be necessary ###
59 ######################################################################
61 ELFLAGS
= --eval
'(setq load-path (append (list "." "$(elibdir)" "$(lispdir)") load-path))'
62 ELC
= $(EMACS
) -batch
$(ELFLAGS
) -f batch-byte-compile
64 ELCFILES
= $(ELFILES
:.el
=.elc
)
66 TEXEXTS
= *.cps
*.fns
*.kys
*.vr
*.tp
*.pg
*.log
*.aux
*.toc
*.cp
*.ky
*.fn
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
85 ######################################################################
92 install_elc
: $(ELCFILES
) $(PACKAGE
)-startup.el
94 for f in
$(ELCFILES
) $(PACKAGE
)-startup.el
; do \
95 $(CP
) $$f $(elcdir
)/$$f ;\
100 for f in
$(ELFILES
); do \
101 $(CP
) $$f $(eldir
)/$$f ;\
104 install_info
: $(PACKAGE
).
info
106 $(CP
) *.
info* $(infodir)/
107 -[ ! -w
$(infodir)/dir ] \
108 || install-info
--info-dir
=$(infodir)/dir $(PACKAGE
).
info
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; \
116 echo
"**********************************************************" ;\
117 echo
"*** It seems you already have some setup code" ;\
118 echo
"*** for $(PACKAGE) in your startup files." ;\
119 echo
"*** Check that it properly loads \"$(PACKAGE)-startup\"" ;\
120 echo
"**********************************************************" ;\
122 echo
'echo ";; load $(PACKAGE) setup code" >>$(startupfile)' ;\
123 echo
";; load $(PACKAGE) setup code" >>$(startupfile
) ;\
124 echo
'echo "(load \"$(elcdir)/$(PACKAGE)-startup\")" >>$(startupfile)' ;\
125 echo
"(load \"$(elcdir)/$(PACKAGE)-startup\")" >>$(startupfile
) ;\
128 postscript
: $(PACKAGE
).ps
132 $(CP
) `find . -type f -name '*.dvi' -print` $(docdir
)/
134 install: install_elc install_info install_startup install_el
137 $(RM
) *~ core .\
#* $(TEXEXTS)
143 $(RM
) *.elc
*.
dvi *.
info* *.ps
145 ######################################################################
146 ### don't look below ###
147 ######################################################################
149 $(PACKAGE
)-startup.el
: $(ELFILES
)
151 ;;; $@ --- automatically extracted autoloads\n\
153 (add-to-list 'load-path\n\
154 (or (file-name-directory load-file-name) (car load-path)))\n\
156 $(EMACS
) --batch
--eval
'(setq generated-autoload-file "'`pwd`'/$@")' -f batch-update-autoloads
"."
160 #TAG = $(shell echo v$(VERSION) | tr '.' '_')
161 URL
=$(shell sed
-n
-e
'5p' .svn
/entries
)
162 TAG
=$(shell dirname
"$(URL)")/releases
/$(PACKAGE
)-$(VERSION
)
163 ftpdir
=/u
/monnier
/html
/elisp
/
164 cvsmodule
=$(shell cat CVS
/Repository
)
165 cvsroot
=$(shell cat CVS
/Root
)
168 svn cp .
"$(TAG)" &&\
169 svn
export "$(TAG)" "$(TMP)/$(PACKAGE)-$(VERSION)" &&\
170 cd
"$(TMP)/$(PACKAGE)-$(VERSION)" &&\
171 $(MAKE
) info $(PACKAGE
)-startup.el
&&\
173 ztar
$(PACKAGE
)-$(VERSION
) &&\
174 rm -rf
$(PACKAGE
)-$(VERSION
)
175 mv
$(TMP
)/$(PACKAGE
)-$(VERSION
).
tar.gz
$(ftpdir
)/
176 ln
-sf
$(PACKAGE
)-$(VERSION
).
tar.gz
$(ftpdir
)/$(PACKAGE
).
tar.gz