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