Import XE riece pkg Makefile/package-info.in
[packages] / xemacs-packages / pcomplete / Makefile.upstream
1 # Makefile for pcomplete lisp code
2
3 # Copyright (C) 1998-1999  John Wiegley <johnw@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 2, 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 prefix  = /usr/local
20 datadir = $(prefix)/share
21
22 # the directory where you install third-party emacs packges
23 lispdir = $(datadir)/emacs/site-lisp
24
25 # the directory where you install the info doc
26 infodir = $(prefix)/info
27 docdir = $(prefix)/doc
28
29 EMACS   = emacs
30 MAKEINFO= makeinfo
31 TEXI2DVI= texi2dvi
32 SHELL   = /bin/sh
33 DVIPS   = dvips
34 CP      = cp
35 MKDIR   = mkdir -p
36 ETAGS   = etags
37
38 ######################################################################
39 ###        No changes below this line should be necessary          ###
40 ######################################################################
41
42 PACKAGE = pcomplete
43
44 # the directory where the .elc files will be installed
45 elcdir  = $(lispdir)/$(PACKAGE)
46 eldir   = $(elcdir)
47
48 MARGS   = --no-init-file --no-site-file -l ./pcmpl-maint.el -batch
49 BEMACS  = $(EMACS) $(MARGS)
50 ELC     = $(BEMACS) -f batch-byte-compile
51
52 ELFILES =               \
53         pcomplete.el    \
54         pcmpl-cvs.el    \
55         pcmpl-gnu.el    \
56         pcmpl-linux.el  \
57         pcmpl-rpm.el    \
58         pcmpl-unix.el
59
60 ELCFILES = $(ELFILES:.el=.elc)
61
62 TEXEXTS =  *.cps *.fns *.kys *.vr *.tp *.pg *.log *.aux *.toc *.cp *.ky *.fn
63
64 .SUFFIXES: .elc .el
65 .PHONY: elcfiles clean distclean default
66 .PHONY: install_elc install install_el
67
68 .el.elc:
69         $(ELC) $<
70
71 ######################################################################
72
73 default: pcmpl-auto.el elcfiles
74
75 elcfiles: Makefile $(ELCFILES)
76
77 install_elc: $(ELCFILES) pcmpl-auto.el _pkg.el
78         $(MKDIR) $(elcdir)
79         $(CP) $(ELCFILES) auto-autoloads.el pcmpl-auto.el _pkg.el $(elcdir)/
80
81 install_el:
82         $(MKDIR) $(eldir)
83         $(CP) $(ELFILES) $(eldir)/
84
85 install: install_elc install_el
86
87 clean:
88         $(RM) *~ core .\#* $(TEXEXTS)
89
90 TAGS tags:
91         $(ETAGS) $(ELFILES)
92
93 distclean: clean
94         $(RM) *.elc TAGS
95         $(RM) pcmpl-auto.el* auto-autoloads.el*
96
97 pcmpl-auto.el: $(ELFILES)
98         echo ";;; DO NOT MODIFY THIS FILE" > pcmpl-auto.el
99         echo "(if (featurep 'pcmpl-auto) (error \"Already loaded\"))" \
100                 >> pcmpl-auto.el
101         $(BEMACS) -f pcomplete-generate-autoloads ./pcmpl-auto.el .
102         echo "(provide 'pcmpl-auto)" >> pcmpl-auto.el
103         ln pcmpl-auto.el auto-autoloads.el
104
105 TAG = $(shell echo v$(VERSION) | tr '.' '_')
106 ftpdir=/home/johnw/public_html/Emacs/packages
107
108 dist:
109         cvs tag -F $(TAG) &&\
110         cd /tmp &&\
111         cvs export -r $(TAG) -d $(PACKAGE)-$(VERSION) $(PACKAGE) &&\
112         cd $(PACKAGE)-$(VERSION) &&\
113         make pcmpl-auto.el &&\
114         chmod ugo+rX * &&\
115         cd .. &&\
116         tar cvzf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION) &&\
117         zip -r $(PACKAGE)-$(VERSION).zip $(PACKAGE)-$(VERSION) &&\
118         rm -rf $(PACKAGE)-$(VERSION)
119         mv /tmp/$(PACKAGE)-$(VERSION).tar.gz $(ftpdir)/
120         mv /tmp/$(PACKAGE)-$(VERSION).zip $(ftpdir)/
121         ln -sf $(PACKAGE)-$(VERSION).tar.gz $(ftpdir)/$(PACKAGE).tar.gz
122         ln -sf $(PACKAGE)-$(VERSION).zip $(ftpdir)/$(PACKAGE).zip