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