163
|
1 ## Makefile for lib-src subdirectory in XEmacs.
|
|
2 ## Copyright (C) 1985, 1987, 1988, 1993, 1994 Free Software Foundation, Inc.
|
|
3 ## Copyright (C) 1996, 1997 Sun Microsystems, Inc.
|
0
|
4
|
163
|
5 ## This file is part of XEmacs.
|
0
|
6
|
163
|
7 ## XEmacs 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.
|
0
|
11
|
163
|
12 ## XEmacs 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.
|
0
|
16
|
163
|
17 ## You should have received a copy of the GNU General Public License
|
|
18 ## along with XEmacs; see the file COPYING. If not, write to
|
|
19 ## the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
20 ## Boston, MA 02111-1307, USA.
|
0
|
21
|
163
|
22 ## Note: FSF Makefile.in.in does something weird so that the comments
|
|
23 ## above a certain point in this file are in shell format instead of
|
|
24 ## in C format. How the hell is this supposed to work? */
|
|
25
|
|
26 SHELL = /bin/sh
|
|
27 RM = rm -f
|
|
28
|
|
29 ## For performance and consistency, no built-in rules
|
155
|
30 .SUFFIXES:
|
|
31 .SUFFIXES: .c .o .i .h
|
163
|
32 ## ==================== Things "configure" will edit ====================
|
0
|
33
|
|
34 CC=@CC@
|
149
|
35 CPP=@CPP@
|
0
|
36 CFLAGS=@CFLAGS@
|
149
|
37 CPPFLAGS=@CPPFLAGS@
|
|
38 LDFLAGS=@LDFLAGS@
|
0
|
39 ALLOCA=@ALLOCA@
|
|
40 YACC=@YACC@
|
|
41 LN_S=@LN_S@
|
|
42 version=@version@
|
|
43
|
163
|
44 ## ==================== Where To Install Things ====================
|
0
|
45
|
163
|
46 prefix=@prefix@
|
|
47 exec_prefix=@exec_prefix@
|
|
48 bindir=@bindir@
|
0
|
49 libdir=@libdir@
|
|
50 srcdir=@srcdir@
|
|
51 archlibdir=@archlibdir@
|
|
52
|
163
|
53 ## ==================== Utility Programs for the Build =================
|
0
|
54
|
|
55 INSTALL = @INSTALL@
|
|
56 INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
57 INSTALL_DATA = @INSTALL_DATA@
|
|
58
|
163
|
59 ## ========================== Lists of Files ===========================
|
0
|
60
|
163
|
61 ## Things that a user might actually run,
|
|
62 ## which should be installed in bindir.
|
151
|
63 INSTALLABLES = etags ctags b2m gnuclient
|
163
|
64 INSTALLABLE_SCRIPTS = rcs-checkin pstogif install-sid send-pr gnudoit gnuattach
|
0
|
65
|
163
|
66 ## Things that Emacs runs internally, or during the build process,
|
|
67 ## which should not be installed in bindir.
|
0
|
68 UTILITIES= make-path wakeup profile make-docfile digest-doc \
|
149
|
69 sorted-doc movemail cvtmail fakemail yow hexl \
|
14
|
70 gnuserv mmencode
|
163
|
71 ## These need to be conditional on I18N3 make-msgfile make-po
|
0
|
72
|
163
|
73 ## Like UTILITIES, but they are not system-dependent, and should not be
|
|
74 ## deleted by the distclean target.
|
14
|
75 TM_SCRIPTS=tm-au tm-file tm-html tm-image tm-mpeg tm-plain tm-ps tmdecode
|
114
|
76 SCRIPTS= rcs2log vcdiff gzip-el.sh install-sid send-pr $(TM_SCRIPTS)
|
0
|
77
|
|
78 EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
|
|
79
|
|
80 SOURCES = COPYING ChangeLog Makefile.in.in README aixcc.lex emacs.csh \
|
26
|
81 makedoc.com *.[chy] $(SCRIPTS)
|
163
|
82 ## Additional -D flags for movemail (add to MOVE_FLAGS if desired):
|
|
83 ## MAIL_USE_POP Support mail retrieval from a POP mailbox.
|
|
84 ## MAIL_USE_MMDF Support MMDF mailboxes.
|
|
85 ## MAIL_USE_FLOCK Use flock for file locking (see the comments
|
|
86 ## about locking in movemail.c)
|
|
87 ## MAIL_UNLINK_SPOOL Unlink the user spool mailbox after reading
|
|
88 ## it (instead of just emptying it).
|
|
89 ## KERBEROS Support Kerberized POP.
|
|
90 ## KRB5 Support Kerberos Version 5 pop instead of
|
|
91 ## Version 4 (define this in addition to
|
|
92 ## KERBEROS).
|
|
93 ## HESIOD Support Hesiod lookups of user mailboxes.
|
|
94 ## MAILHOST A string, the host name of the default POP
|
|
95 ## mail host for the site.
|
|
96
|
118
|
97 MOVE_FLAGS=
|
163
|
98 ##
|
|
99 ## Additional libraries for movemail:
|
|
100 ## For KERBEROS
|
|
101 ## MOVE_LIBS= -lkrb -ldes -lcom_err
|
|
102 ## For KERBEROS + KRB5
|
|
103 ## MOVE_LIBS= -lkrb5 -lcrypto -lisode -lcom_err
|
|
104 ## Add "-lhesiod" if HESIOD is defined.
|
|
105
|
118
|
106 MOVE_LIBS=
|
|
107
|
163
|
108 ## ========================== start of cpp stuff =======================
|
0
|
109
|
|
110 #define NO_SHORTNAMES
|
|
111 #define NOT_C_CODE
|
|
112 #include "../src/config.h"
|
|
113
|
|
114 #ifdef USE_GNU_MAKE
|
|
115 vpath %.c @srcdir@
|
|
116 vpath %.h @srcdir@
|
|
117 #else
|
|
118 VPATH=@srcdir@
|
|
119 #endif
|
|
120
|
149
|
121 c_switch_general=@c_switch_general@
|
|
122 c_switch_window_system=@c_switch_window_system@
|
|
123 c_switch_all=@c_switch_all@
|
|
124 ld_switch_general=@ld_switch_general@
|
|
125 ld_switch_window_system=@ld_switch_window_system@
|
|
126 ld_switch_all=@ld_switch_all@
|
|
127 ld_libs_general=@ld_libs_general@
|
|
128 ld_libs_window_system=@ld_libs_window_system@
|
|
129 ld_libs_all=@ld_libs_all@
|
0
|
130
|
149
|
131 LOADLIBES=$(ld_switch_general) $(ld_libs_general)
|
|
132 LOAD_X_LIBES=$(ld_switch_window_system)
|
|
133 C_SWITCH_X=$(c_switch_window_system)
|
|
134
|
163
|
135 ## We need to #define emacs to get the right versions of some files.
|
149
|
136
|
151
|
137 lib_src_cppflags = -Demacs -I../src -I${srcdir} -I${srcdir}/../src $(CPPFLAGS)
|
157
|
138 lib_src_cppflags = -Demacs -I../src $(CPPFLAGS)
|
|
139 cflags = $(CFLAGS) $(lib_src_cppflags) $(c_switch_all)
|
|
140 ldflags = $(LDFLAGS) $(ld_switch_all) $(ld_libs_general)
|
0
|
141
|
163
|
142 ## This is the default compilation command.
|
|
143 ## But we should never rely on it, because some make version
|
|
144 ## failed to find it for getopt.o.
|
|
145 ## Using an explicit command made it work.
|
0
|
146 .c.o:
|
149
|
147 ${CC} -c $(cflags) $<
|
0
|
148
|
|
149 all: ${UTILITIES} ${INSTALLABLES} ${SCRIPTS}
|
|
150
|
163
|
151 ## Make symlinks for shell scripts if using --srcdir */
|
70
|
152 rcs2log:
|
|
153 ${LN_S} ${srcdir}/$@ $@
|
155
|
154 vcdiff:
|
70
|
155 ${LN_S} ${srcdir}/$@ $@
|
26
|
156 tm-au :
|
|
157 ${LN_S} ${srcdir}/$@ $@
|
|
158 tm-file :
|
|
159 ${LN_S} ${srcdir}/$@ $@
|
|
160 tm-html :
|
|
161 ${LN_S} ${srcdir}/$@ $@
|
|
162 tm-image :
|
|
163 ${LN_S} ${srcdir}/$@ $@
|
|
164 tm-mpeg :
|
|
165 ${LN_S} ${srcdir}/$@ $@
|
|
166 tm-plain :
|
|
167 ${LN_S} ${srcdir}/$@ $@
|
|
168 tm-ps :
|
|
169 ${LN_S} ${srcdir}/$@ $@
|
|
170 tmdecode :
|
|
171 ${LN_S} ${srcdir}/$@ $@
|
114
|
172 gzip-el.sh:
|
|
173 ${LN_S} ${srcdir}/$@ $@
|
|
174 install-sid:
|
|
175 ${LN_S} ${srcdir}/$@ $@
|
|
176 send-pr:
|
|
177 ${LN_S} ${srcdir}/$@ $@
|
0
|
178
|
163
|
179
|
|
180 #undef MOVEMAIL_NEEDS_BLESSING
|
|
181 #if !defined (MAIL_USE_FLOCK) && ! defined (MAIL_USE_LOCKF)
|
|
182 #define MOVEMAIL_NEEDS_BLESSING
|
|
183 blessmail = blessmail
|
0
|
184 blessmail:
|
|
185 ../src/emacs -batch -l ../lisp/blessmail.el
|
163
|
186 chmod +x $@
|
|
187 #endif /* movemail needs blessing */
|
0
|
188
|
163
|
189 maybe-blessmail: $(blessmail)
|
0
|
190 #ifdef MOVEMAIL_NEEDS_BLESSING
|
163
|
191 ## Do not charge ahead and do it! Let the installer decide.
|
0
|
192 ./blessmail ${archlibdir}/movemail */
|
163
|
193 @if test `wc -l <blessmail` != 2; then \
|
0
|
194 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
|
163
|
195 echo "Assuming $$dir is really the mail spool directory, you should"; \
|
|
196 echo "run lib-src/blessmail ${archlibdir}/movemail"; \
|
|
197 echo "as root, to give movemail appropriate permissions."; \
|
|
198 echo "Do that after running make install."; \
|
0
|
199 fi
|
|
200 #endif
|
|
201
|
163
|
202 ## Install the internal utilities. Until they are installed, we can
|
|
203 ## just run them directly from lib-src.
|
0
|
204 ${archlibdir}: all
|
163
|
205 @echo; echo "Installing utilities run internally by XEmacs."
|
0
|
206 ./make-path ${archlibdir}
|
163
|
207 if test `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd`; then \
|
0
|
208 for file in ${UTILITIES}; do \
|
80
|
209 (cd .. && $(INSTALL_PROGRAM) lib-src/$$file ${archlibdir}/$$file) ; \
|
0
|
210 done ; \
|
|
211 fi
|
163
|
212 if test `(cd ${archlibdir} && /bin/pwd)` \
|
|
213 != `(cd ${srcdir} && /bin/pwd)`; then \
|
0
|
214 for file in ${SCRIPTS}; do \
|
80
|
215 (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file); \
|
0
|
216 done ; \
|
|
217 fi
|
|
218
|
163
|
219 ## We do not need to install "wakeup" explicitly, because it will be
|
|
220 ## copied when this whole directory is copied.
|
|
221 .PHONY : all maybe-blessmail install uninstall
|
0
|
222 install: ${archlibdir}
|
163
|
223 @echo; echo "Installing utilities for users to run."
|
0
|
224 for file in ${INSTALLABLES} ; do \
|
80
|
225 (cd .. && $(INSTALL_PROGRAM) lib-src/$${file} ${bindir}/$${file}) ; \
|
0
|
226 done
|
|
227 for file in ${INSTALLABLE_SCRIPTS} ; do \
|
80
|
228 (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file}) ; \
|
0
|
229 done
|
|
230
|
|
231 uninstall:
|
80
|
232 (cd ${bindir} && \
|
163
|
233 $(RM) ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
|
80
|
234 (cd ${archlibdir} && \
|
163
|
235 $(RM) ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
|
0
|
236
|
163
|
237 .PHONY : mostlyclean clean distclean realclean extraclean unlock relock check
|
0
|
238 mostlyclean:
|
163
|
239 $(RM) core *.o *.i
|
0
|
240
|
|
241 clean: mostlyclean
|
163
|
242 $(RM) ${INSTALLABLES} ${UTILITIES}
|
0
|
243
|
|
244 distclean: clean
|
163
|
245 $(RM) DOC *.tab.c *.tab.h aixcc.c TAGS
|
|
246 $(RM) Makefile Makefile.in blessmail
|
0
|
247
|
|
248 realclean: distclean
|
163
|
249 @true
|
0
|
250
|
|
251 extraclean: realclean
|
163
|
252 $(RM) *~ \#*
|
0
|
253
|
|
254 unlock:
|
|
255 chmod u+w $(SOURCES)
|
|
256
|
|
257 relock:
|
|
258 chmod u-w $(SOURCES)
|
|
259
|
163
|
260 ## Test the contents of the directory.
|
0
|
261 check:
|
|
262 @echo "We don't have any tests for XEmacs yet."
|
|
263
|
|
264 TAGS: etags
|
|
265 etags *.[ch]
|
|
266
|
|
267 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
|
|
268 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
|
|
269 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
|
149
|
270 ${CC} -c $(cflags) ${srcdir}/getopt.c
|
0
|
271 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
|
149
|
272 ${CC} -c $(cflags) ${srcdir}/getopt1.c
|
0
|
273 alloca.o: ${srcdir}/../src/alloca.c
|
|
274 ${CC} -c ${ALLOCA_CFLAGS} ${srcdir}/../src/alloca.c
|
|
275
|
|
276 #ifdef REGEXP_IN_LIBC
|
|
277 REGEXOBJ =
|
|
278 REGEXDEPS =
|
|
279 #else
|
|
280 REGEXOBJ = regex.o
|
|
281 REGEXDEPS = $(REGEXOBJ) ${srcdir}/../src/regex.h
|
|
282 #endif
|
|
283
|
|
284 regex.o: ${srcdir}/../src/regex.c ${srcdir}/../src/regex.h
|
149
|
285 $(CC) -c `echo ${cflags} | sed 's/-Demacs/ /'` \
|
155
|
286 -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
|
0
|
287
|
|
288 etags: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXDEPS) ../src/config.h
|
155
|
289 $(CC) ${cflags} -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXOBJ) $(ldflags) -o etags
|
0
|
290
|
163
|
291 ## We depend on etags to assure that parallel makes do not write two
|
|
292 ## etags.o files on top of each other.
|
155
|
293 ctags: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXDEPS) etags
|
|
294 $(CC) ${cflags} -DCTAGS -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXOBJ) $(ldflags) -o ctags
|
0
|
295
|
|
296 wakeup: ${srcdir}/wakeup.c
|
149
|
297 $(CC) ${cflags} ${srcdir}/wakeup.c $(ldflags) -o wakeup
|
0
|
298
|
|
299 profile: ${srcdir}/profile.c
|
149
|
300 $(CC) ${cflags} ${srcdir}/profile.c $(ldflags) -o profile
|
0
|
301
|
|
302 make-docfile: ${srcdir}/make-docfile.c
|
149
|
303 $(CC) ${cflags} ${srcdir}/make-docfile.c $(ldflags) -o make-docfile
|
0
|
304
|
|
305 digest-doc: ${srcdir}/digest-doc.c
|
155
|
306 $(CC) ${cflags} ${srcdir}/digest-doc.c $(ldflags) -o digest-doc
|
0
|
307
|
|
308 sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
|
149
|
309 $(CC) ${cflags} ${srcdir}/sorted-doc.c ${ALLOCA} $(ldflags) -o sorted-doc
|
0
|
310
|
|
311 b2m: ${srcdir}/b2m.c ../src/config.h
|
155
|
312 $(CC) ${cflags} ${srcdir}/b2m.c $(ldflags) -o b2m
|
0
|
313
|
118
|
314 movemail: ${srcdir}/movemail.c ${srcdir}/pop.c ${srcdir}/pop.h ../src/config.h
|
149
|
315 $(CC) ${cflags} ${MOVE_FLAGS} ${srcdir}/movemail.c ${srcdir}/pop.c $(ldflags) ${MOVE_LIBS} -o movemail
|
0
|
316
|
|
317 cvtmail: ${srcdir}/cvtmail.c
|
149
|
318 $(CC) ${cflags} ${srcdir}/cvtmail.c $(ldflags) -o cvtmail
|
0
|
319
|
|
320 fakemail: ${srcdir}/fakemail.c ../src/config.h
|
149
|
321 $(CC) ${cflags} ${srcdir}/fakemail.c $(ldflags) -o fakemail
|
0
|
322
|
|
323 yow: ${srcdir}/yow.c ../src/paths.h
|
149
|
324 $(CC) ${cflags} ${srcdir}/yow.c $(ldflags) -o yow
|
0
|
325
|
|
326 hexl: ${srcdir}/hexl.c
|
149
|
327 $(CC) ${cflags} ${srcdir}/hexl.c $(ldflags) -o hexl
|
0
|
328
|
70
|
329 make-msgfile: ${srcdir}/make-msgfile.c
|
149
|
330 $(CC) $(cflags) ${srcdir}/make-msgfile.c $(ldflags) -o make-msgfile
|
70
|
331
|
|
332 make-po: ${srcdir}/make-po.c
|
149
|
333 $(CC) $(cflags) ${srcdir}/make-po.c $(ldflags) -o make-po
|
70
|
334
|
163
|
335 ## Why oh why does HP not include half of the standard X distribution?
|
0
|
336
|
159
|
337 ldflags_gnuserv = $(LDFLAGS) $(ld_switch_all) @libs_xauth@ $(ld_libs_general)
|
0
|
338 gnuslib.o: ${srcdir}/gnuslib.c ${srcdir}/gnuserv.h ../src/config.h
|
159
|
339 $(CC) -c ${cflags} ${srcdir}/gnuslib.c
|
155
|
340 gnuclient: ${srcdir}/gnuclient.c gnuslib.o ${srcdir}/gnuserv.h
|
159
|
341 $(CC) ${cflags} -o $@ ${srcdir}/$@.c gnuslib.o ${ldflags_gnuserv}
|
0
|
342 gnuserv: ${srcdir}/gnuserv.c gnuslib.o ${srcdir}/gnuserv.h
|
159
|
343 $(CC) ${cflags} -o $@ ${srcdir}/$@.c gnuslib.o ${ldflags_gnuserv}
|
70
|
344
|
163
|
345 ## mmencode binary is used by tm - but is really part of the metamail package
|
|
346 ## mmencode.c was merged copy of mmencode.c and codes.c of metamail
|
14
|
347 mmencode : ${srcdir}/mmencode.c
|
149
|
348 $(CC) ${cflags} ${srcdir}/mmencode.c -o mmencode
|
14
|
349
|
70
|
350
|
163
|
351 ## The timer utility (timer.c, getdate.y) is not used in XEmacs
|
|
352 ## because XEmacs provides built-in timer facilities.
|
0
|
353
|
|
354 make-path: ${srcdir}/make-path.c ../src/config.h
|
149
|
355 $(CC) $(cflags) ${srcdir}/make-path.c -o make-path
|
0
|
356
|
163
|
357 ## These are NOT included in INSTALLABLES or UTILITIES.
|
|
358 ## See ../src/Makefile.in.in.
|
0
|
359 aixcc: ${srcdir}/aixcc.c
|
149
|
360 $(CC) $(cflags) -o aixcc ${srcdir}/aixcc.c
|
0
|
361
|
|
362 aixcc.c: ${srcdir}/aixcc.lex
|
|
363 lex ${srcdir}/aixcc.lex
|
|
364 mv lex.yy.c aixcc.c
|