428
|
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.
|
3062
|
4 ## Copyright (C) 2005 Ben Wing.
|
428
|
5
|
|
6 ## This file is part of XEmacs.
|
|
7
|
|
8 ## XEmacs is free software; you can redistribute it and/or modify it
|
|
9 ## under the terms of the GNU General Public License as published by the
|
|
10 ## Free Software Foundation; either version 2, or (at your option) any
|
|
11 ## later version.
|
|
12
|
|
13 ## XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
14 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
15 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
16 ## for more details.
|
|
17
|
|
18 ## You should have received a copy of the GNU General Public License
|
|
19 ## along with XEmacs; see the file COPYING. If not, write to
|
|
20 ## the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
21 ## Boston, MA 02111-1307, USA.
|
|
22
|
|
23 ## Note: FSF Makefile.in.in does something weird so that the comments
|
|
24 ## above a certain point in this file are in shell format instead of
|
|
25 ## in C format. How the hell is this supposed to work? */
|
|
26
|
|
27 ## For performance and consistency, no built-in rules
|
|
28 .SUFFIXES:
|
|
29 .SUFFIXES: .c .h .o
|
|
30 ## ==================== Things "configure" will edit ====================
|
|
31
|
|
32 @SET_MAKE@
|
|
33 SHELL = /bin/sh
|
|
34 RM = rm -f
|
|
35 pwd = /bin/pwd
|
|
36
|
|
37 CC=@CC@
|
|
38 CPP=@CPP@
|
|
39 CFLAGS=@CFLAGS@
|
|
40 CPPFLAGS=@CPPFLAGS@
|
|
41 LDFLAGS=@LDFLAGS@
|
|
42 ALLOCA=@ALLOCA@
|
|
43 LN_S=@LN_S@
|
|
44 version=@version@
|
3972
|
45 etags_xemacs_version=@verbose_version@
|
428
|
46
|
|
47 ## This will be the name of the generated binary and is set automatically
|
|
48 ## by configure.
|
|
49 PROGNAME=@PROGNAME@
|
|
50
|
|
51 ## ==================== Where To Install Things ====================
|
|
52
|
|
53 prefix=@prefix@
|
|
54 exec_prefix=@exec_prefix@
|
|
55 bindir=@bindir@
|
|
56 libdir=@libdir@
|
|
57 srcdir=@srcdir@
|
|
58 datadir=@datadir@
|
4118
|
59 datarootdir=@datarootdir@
|
428
|
60 instvardir=@instvardir@
|
|
61 top_srcdir=@top_srcdir@
|
|
62 archlibdir=@archlibdir@
|
|
63 configuration=@configuration@
|
|
64 moduledir=@moduledir@
|
|
65 sitemoduledir=@sitemoduledir@
|
|
66
|
|
67 ## ==================== Utility Programs for the Build =================
|
|
68
|
|
69 INSTALL = @install_pp@ @INSTALL@
|
|
70 INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
71 INSTALL_DATA = @INSTALL_DATA@
|
|
72
|
|
73 ## ========================== Lists of Files ===========================
|
|
74
|
|
75 #define NO_SHORTNAMES
|
|
76 #define NOT_C_CODE
|
|
77 #include "../src/config.h"
|
|
78
|
460
|
79 #ifndef WIN32_NATIVE
|
|
80 #define INSTALL_GNUSERV
|
428
|
81 #endif
|
|
82
|
460
|
83 ## ----------------------------------------------------------------
|
|
84 ## Things that a user might actually run directly,
|
|
85 ## which should be installed in ${bindir}.
|
428
|
86
|
460
|
87 PUBLIC_INSTALLABLE_EXES=\
|
|
88 #ifdef INSTALL_GNUSERV
|
|
89 gnuclient\
|
|
90 #endif
|
|
91 #ifdef HAVE_SHLIB
|
|
92 ellcc\
|
|
93 #endif
|
819
|
94 #ifdef HAVE_MS_WINDOWS
|
|
95 winclient\
|
|
96 #endif
|
460
|
97 etags ctags b2m ootags
|
|
98
|
|
99 PUBLIC_INSTALLABLE_SCRIPTS=\
|
|
100 #ifdef INSTALL_GNUSERV
|
|
101 gnudoit gnuattach\
|
|
102 #endif
|
|
103 rcs-checkin
|
|
104
|
|
105 PUBLIC_INSTALLABLES = ${PUBLIC_INSTALLABLE_EXES} ${PUBLIC_INSTALLABLE_SCRIPTS}
|
|
106
|
|
107 ## ----------------------------------------------------------------
|
|
108 ## Things that XEmacs runs internally on the user's behalf,
|
|
109 ## which should be installed in ${archlibdir}.
|
|
110
|
|
111 PRIVATE_INSTALLABLE_EXES=\
|
|
112 #ifdef INSTALL_GNUSERV
|
|
113 gnuserv\
|
|
114 #endif
|
442
|
115 #ifdef WIN32_NATIVE
|
460
|
116 i minitar\
|
428
|
117 #else
|
460
|
118 fakemail\
|
428
|
119 #endif
|
460
|
120 wakeup profile make-docfile digest-doc\
|
|
121 sorted-doc movemail cvtmail yow hexl mmencode
|
428
|
122
|
|
123 GEN_SCRIPTS = rcs2log vcdiff gzip-el.sh
|
|
124 PKG_SCRIPTS = add-big-package.sh
|
460
|
125 PRIVATE_INSTALLABLE_SCRIPTS = $(GEN_SCRIPTS) $(PKG_SCRIPTS)
|
|
126
|
|
127 PRIVATE_INSTALLABLES = ${PRIVATE_INSTALLABLE_EXES} ${PRIVATE_INSTALLABLE_SCRIPTS}
|
|
128
|
|
129 ## These need to be conditional on I18N3: make-msgfile make-po
|
428
|
130
|
460
|
131 ## ----------------------------------------------------------------
|
|
132 ## Things that XEmacs uses during the build process itself.
|
|
133 ## Not installed.
|
428
|
134
|
2720
|
135 #ifdef DUMP_IN_EXEC
|
2015
|
136 BUILD_UTILITIES = make-path make-dump-id insert-data-in-exec
|
2720
|
137 #else
|
|
138 BUILD_UTILITIES = make-path make-dump-id
|
|
139 #endif
|
460
|
140
|
|
141 EXES = ${PUBLIC_INSTALLABLE_EXES} ${PRIVATE_INSTALLABLE_EXES} ${BUILD_UTILITIES}
|
|
142 SCRIPTS = ${PUBLIC_INSTALLABLE_SCRIPTS} ${PRIVATE_INSTALLABLE_SCRIPTS}
|
|
143 PROGS = ${EXES} ${SCRIPTS}
|
|
144
|
428
|
145 ## Additional -D flags for movemail (add to MOVE_FLAGS if desired):
|
|
146 ## MAIL_USE_POP Support mail retrieval from a POP mailbox.
|
|
147 ## MAIL_USE_MMDF Support MMDF mailboxes.
|
|
148 ## MAIL_USE_FLOCK Use flock for file locking (see the comments
|
|
149 ## about locking in movemail.c)
|
|
150 ## MAIL_UNLINK_SPOOL Unlink the user spool mailbox after reading
|
|
151 ## it (instead of just emptying it).
|
|
152 ## KERBEROS Support Kerberized POP.
|
|
153 ## KRB5 Support Kerberos Version 5 pop instead of
|
|
154 ## Version 4 (define this in addition to
|
|
155 ## KERBEROS).
|
|
156 ## HESIOD Support Hesiod lookups of user mailboxes.
|
|
157 ## MAILHOST A string, the host name of the default POP
|
|
158 ## mail host for the site.
|
|
159
|
|
160 MOVE_FLAGS=
|
|
161 ##
|
|
162 ## Additional libraries for movemail:
|
|
163 ## For KERBEROS
|
|
164 ## MOVE_LIBS= -lkrb -ldes -lcom_err
|
|
165 ## For KERBEROS + KRB5
|
|
166 ## MOVE_LIBS= -lkrb5 -lcrypto -lisode -lcom_err
|
|
167 ## Add "-lhesiod" if HESIOD is defined.
|
|
168
|
|
169 MOVE_LIBS=
|
|
170
|
|
171 ## ========================== start of cpp stuff =======================
|
|
172
|
|
173 #ifdef USE_GNU_MAKE
|
|
174 vpath %.c @srcdir@
|
|
175 vpath %.h @srcdir@
|
|
176 #else
|
|
177 VPATH=@srcdir@
|
|
178 #endif
|
|
179
|
|
180 c_switch_general=@c_switch_general@
|
|
181 c_switch_all=@c_switch_all@
|
|
182 ld_switch_general=@ld_switch_general@
|
|
183 ld_switch_all=@ld_switch_all@
|
|
184 ld_libs_general=@ld_libs_general@
|
|
185
|
|
186 ## We need to #define emacs to get the right versions of some files.
|
|
187
|
438
|
188 ## To understand the order of -I flags, consider what happens if you run
|
|
189 ## ./configure in the source tree, and then run
|
|
190 ## $(srcdir).2.26/configure in some other build tree.
|
|
191 ## Where will the generated files like config.h be included from?
|
|
192 ## This is also why you _must_ use <...> instead of "..."
|
|
193 ## when #include'ing generated files.
|
446
|
194 cppflags = -I. -I../src -I$(srcdir) -I$(top_srcdir)/src $(CPPFLAGS)
|
428
|
195 cflags = $(CFLAGS) $(cppflags) $(c_switch_general)
|
|
196 ldflags = $(LDFLAGS) $(ld_switch_general) $(ld_libs_general)
|
|
197
|
|
198 ## This is the default compilation command.
|
|
199 ## But we should never rely on it, because some make version
|
|
200 ## failed to find it for getopt.o.
|
|
201 ## Using an explicit command made it work.
|
|
202 .c.o:
|
|
203 ${CC} -c $(cflags) $<
|
|
204
|
460
|
205 .PHONY : all maybe-blessmail install uninstall check
|
428
|
206
|
460
|
207 all: ${PROGS}
|
428
|
208
|
|
209 ## Make symlinks for shell scripts if using --srcdir
|
460
|
210 ${SCRIPTS}:
|
428
|
211 for f in ${SCRIPTS}; do \
|
|
212 if test ! -r $$f; then ${LN_S} ${srcdir}/$$f $$f; fi; \
|
460
|
213 done
|
428
|
214
|
|
215 #undef MOVEMAIL_NEEDS_BLESSING
|
|
216 #if !defined (MAIL_USE_FLOCK) && ! defined (MAIL_USE_LOCKF)
|
|
217 #define MOVEMAIL_NEEDS_BLESSING
|
|
218 blessmail = blessmail
|
|
219 blessmail:
|
776
|
220 ../src/xemacs -batch -no-packages -l ../lisp/blessmail.el
|
428
|
221 chmod +x $@
|
|
222 #endif /* movemail needs blessing */
|
|
223
|
|
224 maybe-blessmail: $(blessmail)
|
|
225 #ifdef MOVEMAIL_NEEDS_BLESSING
|
|
226 ## Do not charge ahead and do it! Let the installer decide.
|
|
227 ## ./blessmail ${archlibdir}/movemail
|
|
228 @if test `wc -l <blessmail` != 2; then \
|
|
229 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
|
|
230 echo "*************************************************************";\
|
|
231 echo "Assuming $$dir is really the mail spool directory, you should";\
|
|
232 echo "run lib-src/blessmail ${archlibdir}/movemail"; \
|
|
233 echo "as root, to give movemail appropriate permissions."; \
|
|
234 echo "Do that after running make install."; \
|
|
235 echo "You can also do make blessmail. "; \
|
|
236 echo "*************************************************************";\
|
|
237 fi
|
|
238 #endif
|
|
239
|
|
240 do-blessmail: $(blessmail)
|
|
241 #ifdef MOVEMAIL_NEEDS_BLESSING
|
|
242 ./blessmail ${archlibdir}/movemail
|
|
243 #endif
|
|
244
|
|
245 ## Install the internal utilities. Until they are installed, we can
|
|
246 ## just run them directly from lib-src.
|
|
247 ${archlibdir}: all
|
|
248 @echo; echo "Installing utilities run internally by XEmacs."
|
|
249 ./make-path ${archlibdir}
|
|
250 if test "`(cd ${archlibdir} && $(pwd))`" != "`$(pwd)`"; then \
|
460
|
251 for f in ${PRIVATE_INSTALLABLE_EXES}; do \
|
428
|
252 (cd .. && $(INSTALL_PROGRAM) lib-src/$$f ${archlibdir}/$$f) ; \
|
|
253 done ; \
|
|
254 fi
|
|
255 if test "`(cd ${archlibdir} && $(pwd))`" \
|
|
256 != "`(cd ${srcdir} && $(pwd))`"; then \
|
460
|
257 for f in ${PRIVATE_INSTALLABLE_SCRIPTS}; do \
|
428
|
258 (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$$f ${archlibdir}/$$f); \
|
|
259 done ; \
|
|
260 fi
|
|
261
|
|
262 install: ${archlibdir}
|
|
263 @echo; echo "Installing utilities for users to run."
|
460
|
264 for file in ${PUBLIC_INSTALLABLE_EXES} ; do \
|
428
|
265 (cd .. && $(INSTALL_PROGRAM) lib-src/$${file} ${bindir}/$${file}) ; \
|
|
266 done
|
460
|
267 for file in ${PUBLIC_INSTALLABLE_SCRIPTS} ; do \
|
428
|
268 (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file}) ; \
|
|
269 done
|
|
270
|
|
271 uninstall:
|
460
|
272 cd ${bindir} && $(RM) ${PUBLIC_INSTALLABLES}
|
|
273 cd ${archlibdir} && $(RM) ${PRIVATE_INSTALLABLES}
|
428
|
274
|
|
275 .PHONY: mostlyclean clean distclean realclean extraclean
|
3062
|
276 .PHONY: distclean-noconfig realclean-noconfig extraclean-noconfig
|
428
|
277 mostlyclean:
|
3083
|
278 -$(RM) *.o *.i core
|
428
|
279 clean: mostlyclean
|
3083
|
280 -$(RM) ${EXES} *.exe
|
3062
|
281 distclean-noconfig: clean
|
3083
|
282 -$(RM) DOC *.tab.c *.tab.h TAGS ellcc.h blessmail config.values
|
3062
|
283 ## This is used in making a distribution.
|
|
284 ## Do not use it on development directories!
|
|
285 distclean: distclean-noconfig
|
3083
|
286 -$(RM) GNUmakefile Makefile Makefile.in
|
3062
|
287 realclean-noconfig: distclean-noconfig
|
428
|
288 realclean: distclean
|
3062
|
289 extraclean-noconfig: realclean-noconfig
|
3083
|
290 -$(RM) *~ \#*
|
3062
|
291 extraclean: realclean
|
3083
|
292 -$(RM) *~ \#*
|
428
|
293
|
|
294 ## Test the contents of the directory.
|
|
295 check:
|
460
|
296 @echo "We don't have any tests for lib-src yet."
|
428
|
297
|
|
298 TAGS: etags
|
|
299 etags *.[ch]
|
|
300
|
|
301 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
|
|
302 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
|
|
303 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
|
|
304 ${CC} -c $(cflags) ${srcdir}/getopt.c
|
|
305 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
|
|
306 ${CC} -c $(cflags) ${srcdir}/getopt1.c
|
438
|
307 alloca.o: ${top_srcdir}/src/alloca.c
|
428
|
308 ${CC} -c $(cflags) ${srcdir}/../src/alloca.c
|
|
309
|
438
|
310 regex.o: ${srcdir}/../src/regex.c ${top_srcdir}/src/regex.h
|
446
|
311 $(CC) -c $(cflags) \
|
442
|
312 -DINHIBIT_STRING_HEADER ${top_srcdir}/src/regex.c
|
428
|
313
|
3972
|
314 etags_args = $(cflags) -DEMACS_NAME='"XEmacs"' -DVERSION='"${etags_xemacs_version}"' \
|
709
|
315 ${srcdir}/etags.c $(GETOPTOBJS) regex.o $(ldflags)
|
438
|
316 etags_deps = ${srcdir}/etags.c $(GETOPTDEPS) regex.o ../src/config.h
|
428
|
317
|
|
318 etags: ${etags_deps}
|
|
319 $(CC) ${etags_args} -o $@
|
|
320
|
438
|
321 ellcc_args = $(cflags) ${srcdir}/ellcc.c $(ldflags)
|
428
|
322 ellcc_deps = ${srcdir}/ellcc.c ellcc.h ../src/config.h
|
|
323
|
|
324 ellcc: ${ellcc_deps}
|
|
325 $(CC) ${ellcc_args} -o $@
|
|
326
|
3972
|
327 ## #### we should probably do the same as for pot's etags
|
438
|
328 ootags_args = $(cflags) -DVERSION='"${version}"' ${srcdir}/ootags.c \
|
428
|
329 $(GETOPTOBJS) regex.o $(ldflags)
|
438
|
330 ootags_deps = ${srcdir}/ootags.c $(GETOPTDEPS) regex.o ../src/config.h
|
428
|
331
|
|
332 ootags: ${ootags_deps}
|
|
333 $(CC) ${ootags_args} -o $@
|
|
334
|
|
335 ## ctags depends on etags to assure that parallel makes do not write
|
|
336 ## two etags.o files on top of each other.
|
|
337 ctags: ${etags_deps} etags
|
|
338 $(CC) -DCTAGS ${etags_args} -o $@
|
|
339
|
|
340 wakeup: ${srcdir}/wakeup.c
|
|
341 $(CC) $(cflags) ${srcdir}/wakeup.c $(ldflags) -o $@
|
|
342
|
|
343 profile: ${srcdir}/profile.c
|
|
344 $(CC) $(cflags) ${srcdir}/profile.c $(ldflags) -o $@
|
|
345
|
|
346 make-docfile: ${srcdir}/make-docfile.c
|
|
347 $(CC) $(cflags) ${srcdir}/make-docfile.c $(ldflags) -o $@
|
|
348
|
|
349 digest-doc: ${srcdir}/digest-doc.c
|
446
|
350 $(CC) -Demacs $(cflags) ${srcdir}/digest-doc.c $(ldflags) -o $@
|
428
|
351
|
|
352 sorted-doc: ${srcdir}/sorted-doc.c
|
|
353 $(CC) $(cflags) ${srcdir}/sorted-doc.c $(ldflags) -o $@
|
|
354
|
|
355 b2m: ${srcdir}/b2m.c ../src/config.h
|
|
356 $(CC) $(cflags) ${srcdir}/b2m.c $(ldflags) -o $@
|
|
357
|
|
358 movemail: ${srcdir}/movemail.c ${srcdir}/pop.c ${srcdir}/pop.h $(GETOPTDEPS) regex.o \
|
|
359 ../src/config.h
|
|
360 $(CC) $(cflags) ${MOVE_FLAGS} ${srcdir}/movemail.c ${srcdir}/pop.c \
|
|
361 $(GETOPTOBJS) regex.o $(ldflags) ${MOVE_LIBS} -o $@
|
|
362
|
|
363 cvtmail: ${srcdir}/cvtmail.c
|
|
364 $(CC) $(cflags) ${srcdir}/cvtmail.c $(ldflags) -o $@
|
|
365
|
|
366 fakemail: ${srcdir}/fakemail.c ../src/config.h
|
|
367 $(CC) $(cflags) ${srcdir}/fakemail.c $(ldflags) -o $@
|
|
368
|
|
369 yow: ${srcdir}/yow.c ../src/paths.h
|
|
370 $(CC) $(cflags) ${srcdir}/yow.c $(ldflags) -o $@
|
|
371
|
442
|
372 i: ${srcdir}/i.c
|
|
373 $(CC) $(cflags) ${srcdir}/i.c $(ldflags) -o $@
|
|
374
|
|
375 minitar: ${srcdir}/../nt/minitar.c
|
|
376 $(CC) $(cflags) ${srcdir}/../nt/minitar.c $(ldflags) -lz -o $@
|
|
377
|
819
|
378 winclient: ${srcdir}/winclient.c
|
|
379 $(CC) $(cflags) ${srcdir}/winclient.c $(ldflags) -o $@
|
|
380
|
428
|
381 hexl: ${srcdir}/hexl.c
|
|
382 $(CC) $(cflags) ${srcdir}/hexl.c $(ldflags) -o $@
|
|
383
|
|
384 make-msgfile: ${srcdir}/make-msgfile.c
|
|
385 $(CC) $(cflags) ${srcdir}/make-msgfile.c $(ldflags) -o $@
|
|
386
|
|
387 make-po: ${srcdir}/make-po.c
|
|
388 $(CC) $(cflags) ${srcdir}/make-po.c $(ldflags) -o $@
|
|
389
|
442
|
390 make-dump-id: ${srcdir}/make-dump-id.c
|
|
391 $(CC) $(cflags) ${srcdir}/make-dump-id.c $(ldflags) -o $@
|
|
392
|
2720
|
393 #ifndef DUMP_IN_EXEC
|
2015
|
394 insert-data-in-exec: ${srcdir}/insert-data-in-exec.c
|
|
395 $(CC) $(cflags) ${srcdir}/insert-data-in-exec.c $(ldflags) -o $@
|
2720
|
396 #endif /* not DUMP_IN_EXEC */
|
2015
|
397
|
428
|
398 cflags_gnuserv = $(CFLAGS) $(cppflags) $(c_switch_all)
|
|
399 ldflags_gnuserv = $(LDFLAGS) $(ld_switch_all) @libs_xauth@ $(ld_libs_general)
|
|
400 gnuslib.o: ${srcdir}/gnuslib.c ${srcdir}/gnuserv.h ../src/config.h
|
|
401 $(CC) -c $(cflags_gnuserv) ${srcdir}/gnuslib.c
|
|
402 gnuclient: ${srcdir}/gnuclient.c gnuslib.o ${srcdir}/gnuserv.h
|
|
403 $(CC) $(cflags_gnuserv) ${srcdir}/$@.c gnuslib.o ${ldflags_gnuserv} -o $@
|
|
404 gnuserv: ${srcdir}/gnuserv.c gnuslib.o ${srcdir}/gnuserv.h
|
|
405 $(CC) $(cflags_gnuserv) ${srcdir}/$@.c gnuslib.o ${ldflags_gnuserv} -o $@
|
|
406
|
|
407 ## mmencode binary is used by tm - but is really part of the metamail package
|
|
408 ## mmencode.c was merged copy of mmencode.c and codes.c of metamail
|
|
409 mmencode : ${srcdir}/mmencode.c
|
1886
|
410 $(CC) $(cflags) ${srcdir}/mmencode.c $(ldflags) -o $@
|
428
|
411
|
|
412
|
|
413 ## The timer utility (timer.c, getdate.y) is not used in XEmacs
|
|
414 ## because XEmacs provides built-in timer facilities.
|
|
415
|
|
416 make-path: ${srcdir}/make-path.c ../src/config.h
|
1886
|
417 $(CC) -Demacs $(cflags) ${srcdir}/make-path.c $(ldflags) -o $@
|