EasyPG 1.07 Released
[packages] / xemacs-packages / pcl-cvs / Makefile.upstream
1 # Makefile for emacs-lisp package
2
3 #ident "@(#)v2_9_9:Makefile,v 1.28 2000/03/05 21:32:20 monnier Exp"
4
5 # Copyright (C) 1998-2000  Free Software Foundation, Inc.
6
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
10 # later version.
11
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
15 # for more details.
16
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.
20
21 # load the package-specific settings
22 include makefile.pkg
23
24 # set up the usual installation paths
25 prefix  = /usr/local
26 datadir = $(prefix)/share
27
28 # the directory where you install third-party emacs packges
29 lispdir = $(datadir)/emacs/site-lisp
30
31 # the directory where the .elc files will be installed
32 elcdir  = $(lispdir)/$(PACKAGE)
33 # the directory where the .el files will be installed
34 eldir   = $(elcdir)
35
36 # the file where the initialization goes.
37 #startupfile = $(HOME/.emacs
38 startupfile = $(lispdir)/site-start.el
39
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
44
45 # the directory where you install the info doc
46 infodir = $(prefix)/info
47 docdir = $(prefix)/doc
48
49 EMACS   = emacs
50 MAKEINFO= makeinfo
51 TEXI2DVI= texi2dvi
52 SHELL   = /bin/sh
53 DVIPS   = dvips
54 CP      = cp
55 RM      = rm -f
56 MKDIR   = mkdir -p
57 ETAGS   = etags
58
59 ######################################################################
60 ###        No changes below this line should be necessary          ###
61 ######################################################################
62
63 ELFLAGS = --eval '(setq load-path (append (list "." "$(elibdir)" "$(lispdir)") load-path))'
64 ELC     = $(EMACS) -batch $(ELFLAGS) -f batch-byte-compile
65
66 ELCFILES = $(ELFILES:.el=.elc)
67
68 TEXEXTS =  *.cps *.fns *.kys *.vr *.tp *.pg *.log *.aux *.toc *.cp *.ky *.fn
69
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
74
75 .el.elc:
76         $(ELC) $<
77
78 .texi.info:
79         $(MAKEINFO) $<
80
81 .texi.dvi:
82         $(TEXI2DVI) $<
83
84 .dvi.ps:
85         $(DVIPS) -f $< >$@
86
87 ######################################################################
88
89 default: elcfiles
90
91 elcfiles: $(ELCFILES)
92 info: $(PACKAGE).info
93
94 install_elc: $(ELCFILES) $(PACKAGE)-startup.el
95         $(MKDIR) $(elcdir)
96         $(CP) $(ELCFILES) $(PACKAGE)-startup.el $(elcdir)/
97
98 install_el:
99         $(MKDIR) $(eldir)
100         $(CP) $(ELFILES) $(eldir)/
101
102 install_info: $(PACKAGE).info
103         $(MKDIR) $(infodir)
104         $(CP) *.info* $(infodir)/
105         -[ ! -w $(infodir)/dir ] \
106             || install-info --info-dir=$(infodir) $(PACKAGE).info
107
108 install_startup:
109         $(MKDIR) $(lispdir)
110         @if grep $(PACKAGE) $(lispdir)/site-start.el >/dev/null 2>&1 || \
111            grep $(PACKAGE) $(startupfile) >/dev/null 2>&1 || \
112            grep $(PACKAGE) $(lispdir)/default.el >/dev/null 2>&1; then \
113             echo "**********************************************************" ;\
114             echo "*** It seems you already have some setup code" ;\
115             echo "*** for $(PACKAGE) in your startup files." ;\
116             echo "*** Check that it properly loads \"$(PACKAGE)-startup\"" ;\
117             echo "**********************************************************" ;\
118         else \
119             echo 'echo ";; load $(PACKAGE) setup code" >>$(startupfile)' ;\
120             echo ";; load $(PACKAGE) setup code" >>$(startupfile) ;\
121             echo 'echo "(add-to-list '\''load-path \"$(elcdir)\")" >>$(startupfile)' ;\
122             echo "(add-to-list 'load-path \"$(elcdir)\")" >>$(startupfile) ;\
123             echo 'echo "(load \"$(PACKAGE)-startup\")" >>$(startupfile)' ;\
124             echo "(load \"$(PACKAGE)-startup\")" >>$(startupfile) ;\
125         fi
126
127 postscript: $(PACKAGE).ps
128 dvi: $(PACKAGE).dvi
129 install_dvi: dvi
130         $(MKDIR) $(docdir)
131         $(CP) *.dvi $(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=/home/ftp/pub/monnier/$(PACKAGE)
156
157 dist:
158         cvs tag -F $(TAG) &&\
159         cd $(TMP) &&\
160         cvs export -r $(TAG) -d $(PACKAGE)-$(VERSION) elisp/$(PACKAGE) &&\
161         cd $(PACKAGE)-$(VERSION) &&\
162         gmake info $(PACKAGE)-startup.el &&\
163         cd .. &&\
164         ztar $(PACKAGE)-$(VERSION) &&\
165         rm -rf $(PACKAGE)-$(VERSION)
166         mv $(TMP)/$(PACKAGE)-$(VERSION).tar.gz $(ftpdir)/
167         ln -sf $(PACKAGE)-$(VERSION).tar.gz $(ftpdir)/$(PACKAGE).tar.gz