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