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