Initial Commit
[packages] / xemacs-packages / sml-mode / Makefile.upstream
1 # Makefile for emacs-lisp package
2
3 #ident "@(#)v3_9_5:Makefile,v 1.11 2000/12/24 20:06:28 monnier Exp"
4
5 # Copyright (C) 1998-1999  Stefan Monnier <monnier@cs.yale.edu>
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         for f in $(ELCFILES) $(PACKAGE)-startup.el; do \
97             $(CP) $$f $(elcdir)/$$f ;\
98         done
99
100 install_el:
101         $(MKDIR) $(eldir)
102         for f in $(ELFILES); do \
103             $(CP) $$f $(eldir)/$$f ;\
104         done
105
106 install_info: $(PACKAGE).info
107         $(MKDIR) $(infodir)
108         $(CP) *.info* $(infodir)/
109         -[ ! -w $(infodir)/dir ] \
110             || install-info --info-dir=$(infodir)/dir $(PACKAGE).info
111
112 install_startup:
113         $(MKDIR) $(lispdir)
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 "**********************************************************" ;\
122         else \
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) ;\
129         fi
130
131 postscript: $(PACKAGE).ps
132 dvi: $(PACKAGE).dvi
133 install_dvi: dvi
134         $(MKDIR) $(docdir)
135         $(CP) `find . -type f -name '*.dvi' -print` $(docdir)/
136
137 install: install_elc install_info install_startup install_el
138
139 clean:
140         $(RM) *~ core .\#* $(TEXEXTS)
141
142 TAGS tags:
143         $(ETAGS) $(ELFILES)
144
145 distclean: clean
146         $(RM) *.elc *.dvi *.info* *.ps
147
148 ######################################################################
149 ###                    don't look below                            ###
150 ######################################################################
151
152 $(PACKAGE)-startup.el: $(ELFILES)
153         [ -f $@ ] || echo '\f' >$@
154         $(EMACS) --batch --eval '(setq generated-autoload-file "'`pwd`'/$@")' -f batch-update-autoloads "."
155
156 ##
157
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)
162
163 dist:
164         cvs tag -F $(TAG) &&\
165         cd $(TMP) &&\
166         cvs -d $(cvsroot) export -r $(TAG) -d $(PACKAGE)-$(VERSION) $(cvsmodule) &&\
167         cd $(PACKAGE)-$(VERSION) &&\
168         gmake info $(PACKAGE)-startup.el &&\
169         cd .. &&\
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