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