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 ## For performance and consistency, no built-in rules
|
155
|
27 .SUFFIXES:
|
|
28 .SUFFIXES: .c .o .i .h
|
163
|
29 ## ==================== Things "configure" will edit ====================
|
0
|
30
|
173
|
31 @SET_MAKE@
|
|
32 SHELL = /bin/sh
|
|
33 RM = rm -f
|
|
34
|
0
|
35 CC=@CC@
|
149
|
36 CPP=@CPP@
|
0
|
37 CFLAGS=@CFLAGS@
|
149
|
38 CPPFLAGS=@CPPFLAGS@
|
|
39 LDFLAGS=@LDFLAGS@
|
0
|
40 ALLOCA=@ALLOCA@
|
|
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 \
|
179
|
70 gnuserv mmencode config.values
|
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
|
163
|
131 ## We need to #define emacs to get the right versions of some files.
|
149
|
132
|
151
|
133 lib_src_cppflags = -Demacs -I../src -I${srcdir} -I${srcdir}/../src $(CPPFLAGS)
|
157
|
134 lib_src_cppflags = -Demacs -I../src $(CPPFLAGS)
|
|
135 cflags = $(CFLAGS) $(lib_src_cppflags) $(c_switch_all)
|
|
136 ldflags = $(LDFLAGS) $(ld_switch_all) $(ld_libs_general)
|
0
|
137
|
163
|
138 ## This is the default compilation command.
|
|
139 ## But we should never rely on it, because some make version
|
|
140 ## failed to find it for getopt.o.
|
|
141 ## Using an explicit command made it work.
|
0
|
142 .c.o:
|
149
|
143 ${CC} -c $(cflags) $<
|
0
|
144
|
|
145 all: ${UTILITIES} ${INSTALLABLES} ${SCRIPTS}
|
|
146
|
163
|
147 ## Make symlinks for shell scripts if using --srcdir */
|
70
|
148 rcs2log:
|
|
149 ${LN_S} ${srcdir}/$@ $@
|
155
|
150 vcdiff:
|
70
|
151 ${LN_S} ${srcdir}/$@ $@
|
26
|
152 tm-au :
|
|
153 ${LN_S} ${srcdir}/$@ $@
|
|
154 tm-file :
|
|
155 ${LN_S} ${srcdir}/$@ $@
|
|
156 tm-html :
|
|
157 ${LN_S} ${srcdir}/$@ $@
|
|
158 tm-image :
|
|
159 ${LN_S} ${srcdir}/$@ $@
|
|
160 tm-mpeg :
|
|
161 ${LN_S} ${srcdir}/$@ $@
|
|
162 tm-plain :
|
|
163 ${LN_S} ${srcdir}/$@ $@
|
|
164 tm-ps :
|
|
165 ${LN_S} ${srcdir}/$@ $@
|
|
166 tmdecode :
|
|
167 ${LN_S} ${srcdir}/$@ $@
|
114
|
168 gzip-el.sh:
|
|
169 ${LN_S} ${srcdir}/$@ $@
|
|
170 install-sid:
|
|
171 ${LN_S} ${srcdir}/$@ $@
|
|
172 send-pr:
|
|
173 ${LN_S} ${srcdir}/$@ $@
|
0
|
174
|
163
|
175
|
|
176 #undef MOVEMAIL_NEEDS_BLESSING
|
|
177 #if !defined (MAIL_USE_FLOCK) && ! defined (MAIL_USE_LOCKF)
|
|
178 #define MOVEMAIL_NEEDS_BLESSING
|
|
179 blessmail = blessmail
|
0
|
180 blessmail:
|
|
181 ../src/emacs -batch -l ../lisp/blessmail.el
|
163
|
182 chmod +x $@
|
|
183 #endif /* movemail needs blessing */
|
0
|
184
|
163
|
185 maybe-blessmail: $(blessmail)
|
0
|
186 #ifdef MOVEMAIL_NEEDS_BLESSING
|
163
|
187 ## Do not charge ahead and do it! Let the installer decide.
|
0
|
188 ./blessmail ${archlibdir}/movemail */
|
163
|
189 @if test `wc -l <blessmail` != 2; then \
|
0
|
190 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
|
163
|
191 echo "Assuming $$dir is really the mail spool directory, you should"; \
|
|
192 echo "run lib-src/blessmail ${archlibdir}/movemail"; \
|
|
193 echo "as root, to give movemail appropriate permissions."; \
|
|
194 echo "Do that after running make install."; \
|
0
|
195 fi
|
|
196 #endif
|
|
197
|
163
|
198 ## Install the internal utilities. Until they are installed, we can
|
|
199 ## just run them directly from lib-src.
|
0
|
200 ${archlibdir}: all
|
163
|
201 @echo; echo "Installing utilities run internally by XEmacs."
|
0
|
202 ./make-path ${archlibdir}
|
163
|
203 if test `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd`; then \
|
0
|
204 for file in ${UTILITIES}; do \
|
80
|
205 (cd .. && $(INSTALL_PROGRAM) lib-src/$$file ${archlibdir}/$$file) ; \
|
0
|
206 done ; \
|
|
207 fi
|
163
|
208 if test `(cd ${archlibdir} && /bin/pwd)` \
|
|
209 != `(cd ${srcdir} && /bin/pwd)`; then \
|
0
|
210 for file in ${SCRIPTS}; do \
|
80
|
211 (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file); \
|
0
|
212 done ; \
|
|
213 fi
|
|
214
|
163
|
215 ## We do not need to install "wakeup" explicitly, because it will be
|
|
216 ## copied when this whole directory is copied.
|
|
217 .PHONY : all maybe-blessmail install uninstall
|
0
|
218 install: ${archlibdir}
|
163
|
219 @echo; echo "Installing utilities for users to run."
|
0
|
220 for file in ${INSTALLABLES} ; do \
|
80
|
221 (cd .. && $(INSTALL_PROGRAM) lib-src/$${file} ${bindir}/$${file}) ; \
|
0
|
222 done
|
|
223 for file in ${INSTALLABLE_SCRIPTS} ; do \
|
80
|
224 (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file}) ; \
|
0
|
225 done
|
|
226
|
|
227 uninstall:
|
80
|
228 (cd ${bindir} && \
|
163
|
229 $(RM) ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
|
80
|
230 (cd ${archlibdir} && \
|
163
|
231 $(RM) ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
|
0
|
232
|
171
|
233 .PHONY: mostlyclean clean distclean realclean extraclean
|
0
|
234 mostlyclean:
|
171
|
235 $(RM) *.o *.i core
|
0
|
236 clean: mostlyclean
|
163
|
237 $(RM) ${INSTALLABLES} ${UTILITIES}
|
0
|
238 distclean: clean
|
163
|
239 $(RM) DOC *.tab.c *.tab.h aixcc.c TAGS
|
|
240 $(RM) Makefile Makefile.in blessmail
|
0
|
241 realclean: distclean
|
171
|
242 extraclean: distclean
|
163
|
243 $(RM) *~ \#*
|
0
|
244
|
171
|
245 .PHONY: unlock relock check
|
0
|
246 unlock:
|
|
247 chmod u+w $(SOURCES)
|
|
248 relock:
|
|
249 chmod u-w $(SOURCES)
|
|
250
|
163
|
251 ## Test the contents of the directory.
|
0
|
252 check:
|
|
253 @echo "We don't have any tests for XEmacs yet."
|
|
254
|
|
255 TAGS: etags
|
|
256 etags *.[ch]
|
|
257
|
|
258 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
|
|
259 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
|
|
260 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
|
149
|
261 ${CC} -c $(cflags) ${srcdir}/getopt.c
|
0
|
262 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
|
149
|
263 ${CC} -c $(cflags) ${srcdir}/getopt1.c
|
0
|
264 alloca.o: ${srcdir}/../src/alloca.c
|
175
|
265 ${CC} -c $(cflags) ${srcdir}/../src/alloca.c
|
0
|
266
|
|
267 #ifdef REGEXP_IN_LIBC
|
|
268 REGEXOBJ =
|
|
269 REGEXDEPS =
|
|
270 #else
|
|
271 REGEXOBJ = regex.o
|
|
272 REGEXDEPS = $(REGEXOBJ) ${srcdir}/../src/regex.h
|
|
273 #endif
|
|
274
|
|
275 regex.o: ${srcdir}/../src/regex.c ${srcdir}/../src/regex.h
|
149
|
276 $(CC) -c `echo ${cflags} | sed 's/-Demacs/ /'` \
|
155
|
277 -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
|
0
|
278
|
173
|
279 etags_args = -I. ${cflags} -I${srcdir} -I${srcdir}/../src \
|
|
280 -DVERSION='"${version}"' ${srcdir}/etags.c \
|
|
281 $(GETOPTOBJS) $(REGEXOBJ) $(ldflags)
|
|
282 etags_deps = ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXDEPS) ../src/config.h
|
0
|
283
|
173
|
284 etags: ${etags_deps}
|
|
285 $(CC) ${etags_args} -o $@
|
|
286 ## ctags depends on etags to assure that parallel makes do not write
|
|
287 ## two etags.o files on top of each other.
|
|
288 ctags: ${etags_deps} etags
|
|
289 $(CC) -DCTAGS ${etags_args} -o $@
|
0
|
290
|
|
291 wakeup: ${srcdir}/wakeup.c
|
173
|
292 $(CC) ${cflags} ${srcdir}/wakeup.c $(ldflags) -o $@
|
0
|
293
|
|
294 profile: ${srcdir}/profile.c
|
173
|
295 $(CC) ${cflags} ${srcdir}/profile.c $(ldflags) -o $@
|
0
|
296
|
|
297 make-docfile: ${srcdir}/make-docfile.c
|
173
|
298 $(CC) ${cflags} ${srcdir}/make-docfile.c $(ldflags) -o $@
|
0
|
299
|
|
300 digest-doc: ${srcdir}/digest-doc.c
|
173
|
301 $(CC) ${cflags} ${srcdir}/digest-doc.c $(ldflags) -o $@
|
0
|
302
|
175
|
303 sorted-doc: ${srcdir}/sorted-doc.c
|
|
304 $(CC) ${cflags} ${srcdir}/sorted-doc.c $(ldflags) -o $@
|
0
|
305
|
|
306 b2m: ${srcdir}/b2m.c ../src/config.h
|
173
|
307 $(CC) ${cflags} ${srcdir}/b2m.c $(ldflags) -o $@
|
0
|
308
|
118
|
309 movemail: ${srcdir}/movemail.c ${srcdir}/pop.c ${srcdir}/pop.h ../src/config.h
|
173
|
310 $(CC) ${cflags} ${MOVE_FLAGS} ${srcdir}/movemail.c ${srcdir}/pop.c $(ldflags) ${MOVE_LIBS} -o $@
|
0
|
311
|
|
312 cvtmail: ${srcdir}/cvtmail.c
|
173
|
313 $(CC) ${cflags} ${srcdir}/cvtmail.c $(ldflags) -o $@
|
0
|
314
|
|
315 fakemail: ${srcdir}/fakemail.c ../src/config.h
|
173
|
316 $(CC) ${cflags} ${srcdir}/fakemail.c $(ldflags) -o $@
|
0
|
317
|
|
318 yow: ${srcdir}/yow.c ../src/paths.h
|
173
|
319 $(CC) ${cflags} ${srcdir}/yow.c $(ldflags) -o $@
|
0
|
320
|
|
321 hexl: ${srcdir}/hexl.c
|
173
|
322 $(CC) ${cflags} ${srcdir}/hexl.c $(ldflags) -o $@
|
0
|
323
|
70
|
324 make-msgfile: ${srcdir}/make-msgfile.c
|
173
|
325 $(CC) $(cflags) ${srcdir}/make-msgfile.c $(ldflags) -o $@
|
70
|
326
|
|
327 make-po: ${srcdir}/make-po.c
|
173
|
328 $(CC) $(cflags) ${srcdir}/make-po.c $(ldflags) -o $@
|
70
|
329
|
163
|
330 ## Why oh why does HP not include half of the standard X distribution?
|
0
|
331
|
159
|
332 ldflags_gnuserv = $(LDFLAGS) $(ld_switch_all) @libs_xauth@ $(ld_libs_general)
|
0
|
333 gnuslib.o: ${srcdir}/gnuslib.c ${srcdir}/gnuserv.h ../src/config.h
|
159
|
334 $(CC) -c ${cflags} ${srcdir}/gnuslib.c
|
155
|
335 gnuclient: ${srcdir}/gnuclient.c gnuslib.o ${srcdir}/gnuserv.h
|
173
|
336 $(CC) ${cflags} ${srcdir}/$@.c gnuslib.o ${ldflags_gnuserv} -o $@
|
0
|
337 gnuserv: ${srcdir}/gnuserv.c gnuslib.o ${srcdir}/gnuserv.h
|
173
|
338 $(CC) ${cflags} ${srcdir}/$@.c gnuslib.o ${ldflags_gnuserv} -o $@
|
70
|
339
|
163
|
340 ## mmencode binary is used by tm - but is really part of the metamail package
|
|
341 ## mmencode.c was merged copy of mmencode.c and codes.c of metamail
|
14
|
342 mmencode : ${srcdir}/mmencode.c
|
173
|
343 $(CC) ${cflags} ${srcdir}/mmencode.c -o $@
|
14
|
344
|
70
|
345
|
163
|
346 ## The timer utility (timer.c, getdate.y) is not used in XEmacs
|
|
347 ## because XEmacs provides built-in timer facilities.
|
0
|
348
|
|
349 make-path: ${srcdir}/make-path.c ../src/config.h
|
173
|
350 $(CC) $(cflags) ${srcdir}/make-path.c -o $@
|
0
|
351
|
163
|
352 ## These are NOT included in INSTALLABLES or UTILITIES.
|
|
353 ## See ../src/Makefile.in.in.
|
0
|
354 aixcc: ${srcdir}/aixcc.c
|
173
|
355 $(CC) $(cflags) ${srcdir}/aixcc.c -o $@
|
0
|
356
|
|
357 aixcc.c: ${srcdir}/aixcc.lex
|
|
358 lex ${srcdir}/aixcc.lex
|
|
359 mv lex.yy.c aixcc.c
|