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.
|
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_window_system=@c_switch_window_system@
|
|
126 c_switch_all=@c_switch_all@
|
|
127 ld_switch_general=@ld_switch_general@
|
|
128 ld_switch_window_system=@ld_switch_window_system@
|
|
129 ld_switch_all=@ld_switch_all@
|
|
130 ld_libs_general=@ld_libs_general@
|
|
131 ld_libs_window_system=@ld_libs_window_system@
|
|
132 ld_libs_all=@ld_libs_all@
|
0
|
133
|
163
|
134 ## We need to #define emacs to get the right versions of some files.
|
149
|
135
|
151
|
136 lib_src_cppflags = -Demacs -I../src -I${srcdir} -I${srcdir}/../src $(CPPFLAGS)
|
157
|
137 lib_src_cppflags = -Demacs -I../src $(CPPFLAGS)
|
|
138 cflags = $(CFLAGS) $(lib_src_cppflags) $(c_switch_all)
|
|
139 ldflags = $(LDFLAGS) $(ld_switch_all) $(ld_libs_general)
|
0
|
140
|
163
|
141 ## This is the default compilation command.
|
|
142 ## But we should never rely on it, because some make version
|
|
143 ## failed to find it for getopt.o.
|
|
144 ## Using an explicit command made it work.
|
0
|
145 .c.o:
|
149
|
146 ${CC} -c $(cflags) $<
|
0
|
147
|
193
|
148 all: ${UTILITIES} ${INSTALLABLES} srcdir-symlink.stamp
|
0
|
149
|
193
|
150 ## Make symlinks for shell scripts if using --srcdir
|
|
151 srcdir-symlink.stamp:
|
|
152 for f in ${SCRIPTS}; do \
|
|
153 if test ! -r $$f; then ${LN_S} ${srcdir}/$$f $$f; fi; \
|
|
154 done; \
|
|
155 touch $@;
|
163
|
156
|
|
157 #undef MOVEMAIL_NEEDS_BLESSING
|
|
158 #if !defined (MAIL_USE_FLOCK) && ! defined (MAIL_USE_LOCKF)
|
|
159 #define MOVEMAIL_NEEDS_BLESSING
|
|
160 blessmail = blessmail
|
0
|
161 blessmail:
|
219
|
162 ../src/xemacs -batch -l ../lisp/blessmail.el
|
163
|
163 chmod +x $@
|
|
164 #endif /* movemail needs blessing */
|
0
|
165
|
163
|
166 maybe-blessmail: $(blessmail)
|
0
|
167 #ifdef MOVEMAIL_NEEDS_BLESSING
|
163
|
168 ## Do not charge ahead and do it! Let the installer decide.
|
183
|
169 ## ./blessmail ${archlibdir}/movemail
|
163
|
170 @if test `wc -l <blessmail` != 2; then \
|
0
|
171 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
|
183
|
172 echo "*************************************************************";\
|
|
173 echo "Assuming $$dir is really the mail spool directory, you should";\
|
163
|
174 echo "run lib-src/blessmail ${archlibdir}/movemail"; \
|
|
175 echo "as root, to give movemail appropriate permissions."; \
|
|
176 echo "Do that after running make install."; \
|
183
|
177 echo "You can also do make blessmail. "; \
|
|
178 echo "*************************************************************";\
|
0
|
179 fi
|
|
180 #endif
|
|
181
|
183
|
182 do-blessmail: $(blessmail)
|
|
183 #ifdef MOVEMAIL_NEEDS_BLESSING
|
|
184 ./blessmail ${archlibdir}/movemail
|
|
185 #endif
|
|
186
|
163
|
187 ## Install the internal utilities. Until they are installed, we can
|
|
188 ## just run them directly from lib-src.
|
0
|
189 ${archlibdir}: all
|
163
|
190 @echo; echo "Installing utilities run internally by XEmacs."
|
0
|
191 ./make-path ${archlibdir}
|
193
|
192 if test `(cd ${archlibdir} && $(pwd))` != `$(pwd)`; then \
|
|
193 for f in ${UTILITIES}; do \
|
|
194 (cd .. && $(INSTALL_PROGRAM) lib-src/$$f ${archlibdir}/$$f) ; \
|
0
|
195 done ; \
|
|
196 fi
|
193
|
197 if test `(cd ${archlibdir} && $(pwd))` \
|
|
198 != `(cd ${srcdir} && $(pwd))`; then \
|
|
199 for f in ${SCRIPTS}; do \
|
|
200 (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$$f ${archlibdir}/$$f); \
|
0
|
201 done ; \
|
|
202 fi
|
|
203
|
163
|
204 ## We do not need to install "wakeup" explicitly, because it will be
|
|
205 ## copied when this whole directory is copied.
|
|
206 .PHONY : all maybe-blessmail install uninstall
|
0
|
207 install: ${archlibdir}
|
163
|
208 @echo; echo "Installing utilities for users to run."
|
0
|
209 for file in ${INSTALLABLES} ; do \
|
80
|
210 (cd .. && $(INSTALL_PROGRAM) lib-src/$${file} ${bindir}/$${file}) ; \
|
0
|
211 done
|
|
212 for file in ${INSTALLABLE_SCRIPTS} ; do \
|
80
|
213 (cd .. && $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file}) ; \
|
0
|
214 done
|
|
215
|
|
216 uninstall:
|
80
|
217 (cd ${bindir} && \
|
163
|
218 $(RM) ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
|
80
|
219 (cd ${archlibdir} && \
|
163
|
220 $(RM) ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
|
0
|
221
|
171
|
222 .PHONY: mostlyclean clean distclean realclean extraclean
|
0
|
223 mostlyclean:
|
171
|
224 $(RM) *.o *.i core
|
0
|
225 clean: mostlyclean
|
259
|
226 $(RM) ${INSTALLABLES} ${UTILITIES} *.exe
|
0
|
227 distclean: clean
|
163
|
228 $(RM) DOC *.tab.c *.tab.h aixcc.c TAGS
|
181
|
229 $(RM) Makefile Makefile.in blessmail config.values
|
0
|
230 realclean: distclean
|
171
|
231 extraclean: distclean
|
163
|
232 $(RM) *~ \#*
|
0
|
233
|
171
|
234 .PHONY: unlock relock check
|
0
|
235 unlock:
|
|
236 chmod u+w $(SOURCES)
|
|
237 relock:
|
|
238 chmod u-w $(SOURCES)
|
|
239
|
163
|
240 ## Test the contents of the directory.
|
0
|
241 check:
|
|
242 @echo "We don't have any tests for XEmacs yet."
|
|
243
|
|
244 TAGS: etags
|
|
245 etags *.[ch]
|
|
246
|
|
247 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
|
|
248 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
|
|
249 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
|
149
|
250 ${CC} -c $(cflags) ${srcdir}/getopt.c
|
0
|
251 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
|
149
|
252 ${CC} -c $(cflags) ${srcdir}/getopt1.c
|
0
|
253 alloca.o: ${srcdir}/../src/alloca.c
|
175
|
254 ${CC} -c $(cflags) ${srcdir}/../src/alloca.c
|
0
|
255
|
|
256 regex.o: ${srcdir}/../src/regex.c ${srcdir}/../src/regex.h
|
149
|
257 $(CC) -c `echo ${cflags} | sed 's/-Demacs/ /'` \
|
155
|
258 -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
|
0
|
259
|
173
|
260 etags_args = -I. ${cflags} -I${srcdir} -I${srcdir}/../src \
|
|
261 -DVERSION='"${version}"' ${srcdir}/etags.c \
|
193
|
262 $(GETOPTOBJS) regex.o $(ldflags)
|
|
263 etags_deps = ${srcdir}/etags.c $(GETOPTDEPS) regex.o ../src/config.h
|
0
|
264
|
173
|
265 etags: ${etags_deps}
|
|
266 $(CC) ${etags_args} -o $@
|
|
267 ## ctags depends on etags to assure that parallel makes do not write
|
|
268 ## two etags.o files on top of each other.
|
|
269 ctags: ${etags_deps} etags
|
|
270 $(CC) -DCTAGS ${etags_args} -o $@
|
0
|
271
|
|
272 wakeup: ${srcdir}/wakeup.c
|
173
|
273 $(CC) ${cflags} ${srcdir}/wakeup.c $(ldflags) -o $@
|
0
|
274
|
|
275 profile: ${srcdir}/profile.c
|
173
|
276 $(CC) ${cflags} ${srcdir}/profile.c $(ldflags) -o $@
|
0
|
277
|
|
278 make-docfile: ${srcdir}/make-docfile.c
|
173
|
279 $(CC) ${cflags} ${srcdir}/make-docfile.c $(ldflags) -o $@
|
0
|
280
|
|
281 digest-doc: ${srcdir}/digest-doc.c
|
173
|
282 $(CC) ${cflags} ${srcdir}/digest-doc.c $(ldflags) -o $@
|
0
|
283
|
175
|
284 sorted-doc: ${srcdir}/sorted-doc.c
|
|
285 $(CC) ${cflags} ${srcdir}/sorted-doc.c $(ldflags) -o $@
|
0
|
286
|
|
287 b2m: ${srcdir}/b2m.c ../src/config.h
|
173
|
288 $(CC) ${cflags} ${srcdir}/b2m.c $(ldflags) -o $@
|
0
|
289
|
118
|
290 movemail: ${srcdir}/movemail.c ${srcdir}/pop.c ${srcdir}/pop.h ../src/config.h
|
173
|
291 $(CC) ${cflags} ${MOVE_FLAGS} ${srcdir}/movemail.c ${srcdir}/pop.c $(ldflags) ${MOVE_LIBS} -o $@
|
0
|
292
|
|
293 cvtmail: ${srcdir}/cvtmail.c
|
173
|
294 $(CC) ${cflags} ${srcdir}/cvtmail.c $(ldflags) -o $@
|
0
|
295
|
|
296 fakemail: ${srcdir}/fakemail.c ../src/config.h
|
173
|
297 $(CC) ${cflags} ${srcdir}/fakemail.c $(ldflags) -o $@
|
0
|
298
|
|
299 yow: ${srcdir}/yow.c ../src/paths.h
|
173
|
300 $(CC) ${cflags} ${srcdir}/yow.c $(ldflags) -o $@
|
0
|
301
|
|
302 hexl: ${srcdir}/hexl.c
|
173
|
303 $(CC) ${cflags} ${srcdir}/hexl.c $(ldflags) -o $@
|
0
|
304
|
70
|
305 make-msgfile: ${srcdir}/make-msgfile.c
|
173
|
306 $(CC) $(cflags) ${srcdir}/make-msgfile.c $(ldflags) -o $@
|
70
|
307
|
|
308 make-po: ${srcdir}/make-po.c
|
173
|
309 $(CC) $(cflags) ${srcdir}/make-po.c $(ldflags) -o $@
|
70
|
310
|
163
|
311 ## Why oh why does HP not include half of the standard X distribution?
|
0
|
312
|
159
|
313 ldflags_gnuserv = $(LDFLAGS) $(ld_switch_all) @libs_xauth@ $(ld_libs_general)
|
0
|
314 gnuslib.o: ${srcdir}/gnuslib.c ${srcdir}/gnuserv.h ../src/config.h
|
159
|
315 $(CC) -c ${cflags} ${srcdir}/gnuslib.c
|
155
|
316 gnuclient: ${srcdir}/gnuclient.c gnuslib.o ${srcdir}/gnuserv.h
|
173
|
317 $(CC) ${cflags} ${srcdir}/$@.c gnuslib.o ${ldflags_gnuserv} -o $@
|
0
|
318 gnuserv: ${srcdir}/gnuserv.c gnuslib.o ${srcdir}/gnuserv.h
|
173
|
319 $(CC) ${cflags} ${srcdir}/$@.c gnuslib.o ${ldflags_gnuserv} -o $@
|
70
|
320
|
163
|
321 ## mmencode binary is used by tm - but is really part of the metamail package
|
|
322 ## mmencode.c was merged copy of mmencode.c and codes.c of metamail
|
14
|
323 mmencode : ${srcdir}/mmencode.c
|
173
|
324 $(CC) ${cflags} ${srcdir}/mmencode.c -o $@
|
14
|
325
|
70
|
326
|
163
|
327 ## The timer utility (timer.c, getdate.y) is not used in XEmacs
|
|
328 ## because XEmacs provides built-in timer facilities.
|
0
|
329
|
|
330 make-path: ${srcdir}/make-path.c ../src/config.h
|
173
|
331 $(CC) $(cflags) ${srcdir}/make-path.c -o $@
|
0
|
332
|
163
|
333 ## These are NOT included in INSTALLABLES or UTILITIES.
|
|
334 ## See ../src/Makefile.in.in.
|
0
|
335 aixcc: ${srcdir}/aixcc.c
|
173
|
336 $(CC) $(cflags) ${srcdir}/aixcc.c -o $@
|
0
|
337
|
|
338 aixcc.c: ${srcdir}/aixcc.lex
|
|
339 lex ${srcdir}/aixcc.lex
|
|
340 mv lex.yy.c aixcc.c
|