summaryrefslogtreecommitdiff
path: root/Makefile
blob: 410dec52caec04e070d8a8c0971b431e9e654d46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# Makefile for the Insidious Big Brother Database.
# Original Author: Jamie Zawinski (jwz@netscape.com)
#
# $Id$
#
# $Log$
# Revision 1.60  2000/04/12 23:37:06  waider
# Cleanup work
#
# Revision 1.59  1998/04/11 07:23:03  simmonmt
# Fix for compatibility with more makes
#
# Revision 1.58  1998/03/10 07:27:02  simmonmt
# Removed my paths, added comments about the Custom requirement for
# building Gnus support under 19.34
#
# Revision 1.57  1998/02/23 07:08:48  simmonmt
# Alphabetized MUA directory variables, added OTHERDIR variable
#
# Revision 1.56  1997/11/02 06:35:43  simmonmt
# Fixed package install - `foo 'bar` (as opposed to `foo 'bar'`) works
# in Bourne shell, but not in others.  That and it's not exactly
# intuitive.
#
# Revision 1.55  1997/10/26 05:11:20  simmonmt
# Installation timing change: .el before .elc.  Tried to optimize
# install
#
# Revision 1.54  1997/10/11 23:48:40  simmonmt
# Removed my paths from VMDIR and MHEDIR.  Seems I had broken the
# documented 'if these are blank and the packages live on load-path,
# Emacs will find them' behavior by dying if VMDIR, MHEDIR and GNUSDIR
# weren't set.  It's fixed now.
#
# Revision 1.53  1997/10/06 01:15:13  simmonmt
# Fixed for new grand reorg.  Rewrote XEmacs package installation code.
#
#

# ************************
# MUA-specific definitions
# ************************

# If the VM, GNUS, or MH-E source is not in the standard emacs library 
# (that is, it's not on the load-path by default in a -q emacs) then
# set these variables to point at them.  You need to do this because
# otherwise "require" won't work in the batch emacs.
#
# Set the ones you've got, and comment out the rest.
GNUSDIR         = 
MHEDIR 	        = 
VMDIR           = 

# ***************************
# Locations of other packages
# ***************************
#
# Add the directories (if any) containing the optional packages you
# will use with the BBDB (see the "Byte Compiling the Lisp files"
# section of the BBDB manual for more information).  If more than one
# directory is to be used, separate the directories with spaces.  Do
# not quote the directory names.  GNU Emacs 19.34 should put the path
# to Custom 1.9962 here if they plan to build Gnus support.
OTHERDIR	=

# **************************
# XEmacs Packagization (sp?)
# **************************

# If you're installing this as an XEmacs package, either set the following
# variable to point to the root of the package directory, or set it on the
# command line ( 'make PACKAGEROOT=foo' )
#PACKAGEROOT=

# Uncomment this definition if you want the lisp and info files to be linked
# in (as opposed to being copied)
#LINKTOPACKAGE=yes

# If you uncommented the above, the lisp and info directories will be linked
# from this directory to PACKAGEROOT.  For example, lisp will be linked with:
#
#   ln -s `pwd`/lisp $(PACKAGEROOT)/bbdb/lisp
#
# If `pwd` will not return the correct path, set LINKPATH below to the correct
# path.
#LINKPATH=

# *******************************
# Other important things to check
# *******************************

        EMACS = xemacs -no-site-file -no-init-file
     MAKEINFO = makeinfo

# Uncomment one of the below
#  SYSVINSTALL = /usr/sbin/install
   BSDINSTALL = /usr/ucb/install

          TAR = tar
     COMPRESS = gzip --verbose --best
 COMPRESS_EXT = gz

   BUILDFLAGS = $(MAKEFLAGS) "EMACS=$(EMACS)" "MAKEINFO=$(MAKEINFO)" \
		"VMDIR=$(VMDIR)" "GNUSDIR=$(GNUSDIR)" "MHEDIR=$(MHEDIR)" \
		"OTHERDIR=$(OTHERDIR)"

#    COMPRESS = compress
#COMPRESS_EXT = Z

# You shouldn't need to change anything after this point.

syntax:
	@echo "" ;\
	echo "*** make one or more of: rmail vm mhe gnus all bbdb" ;\
	echo "" 

all: bbdb rmail vm mhe gnus info

bbdb:
	cd lisp; $(MAKE) $(BUILDFLAGS) bbdb

rmail:
	cd lisp; $(MAKE) $(BUILDFLAGS) rmail

vm:
	cd lisp; $(MAKE) $(BUILDFLAGS) vm

mhe:
	cd lisp; $(MAKE) $(BUILDFLAGS) mhe

gnus:
	cd lisp; $(MAKE) $(BUILDFLAGS) gnus

autoloads:
	cd lisp; $(MAKE) $(BUILDFLAGS) autoloads

install-pkg: bbdb autoloads info
	if [ -z "$(PACKAGEROOT)" ] ; then \
	   echo "You must specify PACKAGEROOT (see Makefile)"; \
	   exit 1 ; \
	else \
	   rm -fr $(PACKAGEROOT)/lisp/bbdb $(PACKAGEROOT)/info/bbdb \
		  $(PACKAGEROOT)/etc/bbdb; \
           if [ -z "$(LINKTOPACKAGE)" ] ; then \
	      mkdir -p -m 0755 $(PACKAGEROOT)/lisp/bbdb; \
	      if [ -z "$(SYSVINSTALL)" ] ; then \
		for i in `ls lisp/*.elc` ; do \
		   $(BSDINSTALL) -c -m 0644 `echo $$i | sed 's/c$$//g'` \
			$(PACKAGEROOT)/lisp/bbdb ; \
		   $(BSDINSTALL) -c -m 0644 $$i $(PACKAGEROOT)/lisp/bbdb ; \
		done ; \
	      else \
		for i in `ls lisp/*.elc` ; do \
		   $(SYSVINSTALL) -c $(PACKAGEROOT)/lisp/bbdb -s -m 0644 \
			`echo $$i | sed 's/c$$//g'` $(PACKAGEROOT)/lisp/bbdb ; \
		   $(SYSVINSTALL) -c $(PACKAGEROOT)/lisp/bbdb -s -m 0644 $$i ; \
		done ; \
	      fi ; \
	      mkdir -p -m 0755 $(PACKAGEROOT)/info/bbdb ; \
	      if [ -z "$(SYSVINSTALL)" ] ; then \
		for i in `ls texinfo/*.info* ` ; do \
		   $(BSDINSTALL) -c -m 0644 $$i $(PACKAGEROOT)/info/bbdb ; \
		done ; \
	      else \
		for i in `ls texinfo/*.info* ` ; do \
		   $(SYSVINSTALL) -c $(PACKAGEROOT)/info/bbdb -s -m 0644 $$i ; \
		done ; \
	      fi ; \
	      mkdir -p -m 0755 $(PACKAGEROOT)/etc/bbdb/tex \
			       $(PACKAGEROOT)/etc/bbdb/utils ; \
	      if [ -z "$(SYSVINSTALL)" ] ; then \
		for i in `ls tex/*.tex` ; do \
		   $(BSDINSTALL) -c -m 0644 $$i $(PACKAGEROOT)/etc/bbdb/tex ; \
		done ; \
		for i in `ls -d utils/* |egrep -v '(RCS|SCCS)'` ; do \
		   $(BSDINSTALL) -c -m 0644 $$i $(PACKAGEROOT)/etc/bbdb/utils ; \
		done ; \
	      else \
		for i in `ls tex/*.tex` ; do \
		   $(SYSVINSTALL) -c $(PACKAGEROOT)/etc/bbdb/tex -s -m 0644 $$i; \
		done ; \
		for i in `ls -d utils/* |egrep -v '(RCS|SCCS)'` ; do \
		   $(SYSVINSTALL) -c $(PACKAGEROOT)/etc/bbdb/utils -s -m 0644 $$i; \
		done ; \
	      fi ; \
	   else \
	      if [ -z "$(LINKPATH)" ] ; then \
		 ln -s `pwd`/lisp $(PACKAGEROOT)/lisp/bbdb ; \
		 ln -s `pwd`/texinfo $(PACKAGEROOT)/info/bbdb ; \
	      else \
		 ln -s $(LINKPATH)/lisp $(PACKAGEROOT)/lisp/bbdb ; \
		 ln -s $(LINKPATH)/texinfo $(PACKAGEROOT)/info/bbdb ; \
	      fi ; \
	   fi ; \
	fi

info:
	cd texinfo; $(MAKE)

clean:
	cd lisp; $(MAKE) clean
	cd texinfo; $(MAKE) clean

reallyclean: clean
	cd texinfo; $(MAKE) reallyclean

# Testing
test: test-setup test-bbdb

test-setup:
	cp $$HOME/.bbdb $$HOME/.bbdb-test

test-bbdb:
	emacs -l $$HOME/bbdb-test.el

# FSF Emacs 19.34

emacs19.34-test: emacs19.34-test-setup emacs19.34-test-bbdb
emacs19.34-test: emacs19.34-test-rmail emacs19.34-test-vm
emacs19.34-test: emacs19.34-test-mhe   emacs19.34-test-gnus
emacs19.34-test: emacs19.34-test-all

emacs19.34-test-setup:
	@echo '--- TESTING BBDB WITH FSF EMACS 19.34 ---'
	@echo
	@echo '** Setting up **'
	make clean
	rm -f /local/downloads/emacs-19.34/*
	cp /home/simmonmt/gnus/lisp/*.el /p/local/elisp-19.34/gnus/lisp

emacs19.34-test-bbdb:
	@echo
	@echo '** Testing build of "bbdb" **'
	@echo
	-make EMACS=emacs-19.34 GNUSDIR=/p/local/elisp-19.34/gnus/lisp \
	      OTHERDIR=/p/local/elisp-19.34/custom-1.9962 bbdb

emacs19.34-test-rmail:
	@echo
	@echo '** Testing build of "rmail" **'
	@echo
	-make EMACS=emacs-19.34 GNUSDIR=/p/local/elisp-19.34/gnus/lisp \
	      OTHERDIR=/p/local/elisp-19.34/custom-1.9962 rmail

emacs19.34-test-vm:
	@echo
	@echo '** Testing build of "vm" **'
	@echo
	-make EMACS=emacs-19.34 GNUSDIR=/p/local/elisp-19.34/gnus/lisp \
	      OTHERDIR=/p/local/elisp-19.34/custom-1.9962 vm

emacs19.34-test-mhe:
	@echo
	@echo '** Testing build of "mhe" **'
	@echo
	-make EMACS=emacs-19.34 GNUSDIR=/p/local/elisp-19.34/gnus/lisp \
	      OTHERDIR=/p/local/elisp-19.34/custom-1.9962 mhe

emacs19.34-test-gnus:
	@echo
	@echo '** Testing build of "gnus" **'
	@echo
	-make EMACS=emacs-19.34 GNUSDIR=/p/local/elisp-19.34/gnus/lisp \
	      OTHERDIR=/p/local/elisp-19.34/custom-1.9962 gnus

emacs19.34-test-all:
	@echo
	@echo '** Testing build of "all" **'
	@echo
	-make clean
	-make EMACS=emacs-19.34 GNUSDIR=/p/local/elisp-19.34/gnus/lisp \
	      OTHERDIR=/p/local/elisp-19.34/custom-1.9962 all

# FSF Emacs 20.2

emacs20.2-test: emacs20.2-test-setup emacs20.2-test-bbdb
emacs20.2-test: emacs20.2-test-rmail emacs20.2-test-vm
emacs20.2-test: emacs20.2-test-mhe   emacs20.2-test-gnus
emacs20.2-test: emacs20.2-test-all

emacs20.2-test-setup:
	@echo '--- TESTING BBDB WITH FSF EMACS 20.2 ---'
	@echo
	@echo '** Setting up **'
	make clean
	rm -f /p/local/elisp-20.2/gnus/lisp/*
	cp /home/simmonmt/gnus/lisp/*.el /p/local/elisp-20.2/gnus/lisp

emacs20.2-test-bbdb:
	@echo
	@echo '** Testing build of "bbdb" **'
	@echo
	-make EMACS=emacs-20.2 GNUSDIR=/p/local/elisp-20.2/gnus/lisp bbdb

emacs20.2-test-rmail:
	@echo
	@echo '** Testing build of "rmail" **'
	@echo
	-make EMACS=emacs-20.2 GNUSDIR=/p/local/elisp-20.2/gnus/lisp rmail

emacs20.2-test-vm:
	@echo
	@echo '** Testing build of "vm" **'
	@echo
	-make EMACS=emacs-20.2 GNUSDIR=/p/local/elisp-20.2/gnus/lisp vm

emacs20.2-test-mhe:
	@echo
	@echo '** Testing build of "mhe" **'
	@echo
	-make EMACS=emacs-20.2 GNUSDIR=/p/local/elisp-20.2/gnus/lisp mhe

emacs20.2-test-gnus:
	@echo
	@echo '** Testing build of "gnus" **'
	@echo
	-make EMACS=emacs-20.2 GNUSDIR=/p/local/elisp-20.2/gnus/lisp gnus

emacs20.2-test-all:
	@echo
	@echo '** Testing build of "all" **'
	@echo
	-make clean
	-make EMACS=emacs-20.2 GNUSDIR=/p/local/elisp-20.2/gnus/lisp all


# Deployment
TARFILES=Makefile ChangeLog INSTALL README lisp misc tex texinfo utils

tar: $(TARFILES)
	@NAME=`sed -n							     \
  's/^(defconst bbdb-version "\([0-9]\.[0-9][0-9]*\).*/bbdb-\1/p' lisp/bbdb.el` ; \
  rm -f $$NAME ; ln -s . $$NAME ;					    \
  echo creating tar file $${NAME}.tar.$(COMPRESS_EXT)... ;		    \
   $(TAR) --exclude=CVS -vchf - `echo $(TARFILES)				    	    \
   | sed "s|^|$$NAME/|g; s| | $$NAME/|g" `				    \
   | $(COMPRESS) > $${NAME}.tar.$(COMPRESS_EXT) ;			    \
  rm $$NAME

dist: clean info tar

TAGS: tags

tags:
	etags */*.el