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