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