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