Initial revision
[emacs.git] / lib-src / Makefile.in
blob91c041b73e0fc70e6ad33e69a123cc511822899f
1 # DIST: This is the distribution Makefile for Emacs. configure can
2 # DIST: make most of the changes to this file you might want, so try
3 # DIST: that first.
5 # add -DUSG for SysV movemail and timer
6 # For Xenix, add the following for movemail:
7 # LOADLIBES= -lx
8 # For Mips, the following is needed for who knows what.
9 # LOADLIBES = -lmld /usr/bsd43/usr/lib/libc.a
11 # Avoid trouble on systems where the `SHELL' variable might be
12 # inherited from the environment.
13 SHELL = /bin/sh
15 # ==================== Things `configure' might edit ====================
17 CC=cc
18 CFLAGS=-g
19 ALLOCA=
20 C_SWITCH_SYSTEM=
21 LOADLIBES=
22 YACC=yacc
23 version=version-not-set
24 configname=configuration-name-not-set
26 # ==================== Where To Install Things ====================
28 # The default location for installation. Everything is placed in
29 # subdirectories of this directory. The default values for many of
30 # the variables below are expressed in terms of this one, so you may
31 # not need to change them.
32 prefix=/usr/local
34 # Like `prefix', but used for architecture-specific files.
35 exec_prefix=${prefix}
37 # Where to install Emacs and other binaries that people will want to
38 # run directly (like etags).
39 bindir=${exec_prefix}/bin
41 # Where to install and expect executable files to be run by Emacs
42 # rather than directly by users, and other architecture-dependent
43 # data. ${archlibdir} is usually below this.
44 libdir=${exec_prefix}/lib
46 # Where to find the source code. This is
47 # set by the configure script's `--srcdir' option.
48 # However, the value of ${srcdir} in this makefile
49 # is not identical to what was specified with --srcdir.
50 # The variable here has `/lib-src' added at the end.
51 srcdir=@srcdir@/lib-src
52 VPATH=@srcdir@/lib-src
54 # ==================== Emacs-specific directories ====================
56 # These variables hold the values Emacs will actually use. They are
57 # based on the values of the standard Make variables above.
59 # Where to put executables to be run by Emacs rather than the user.
60 # This path usually includes the Emacs version and configuration name,
61 # so that multiple configurations for multiple versions of Emacs may
62 # be installed at once.
63 archlibdir=${libdir}/emacs/${version}/${configname}
65 # ====================== Developer's configuration =======================
67 # The following assignments make sense if you're running Emacs on a single
68 # machine, one version at a time, and you want changes to the lisp and etc
69 # directories in the source tree to show up immediately in your working
70 # environment. It saves a great deal of disk space by not duplicating the
71 # lisp and etc directories.
73 # archlibdir=${srcdir}/bin
75 # ==================== Utility Programs for the Build ====================
77 # Allow the user to specify the install program.
78 INSTALL = install
79 INSTALLFLAGS = -c
80 INSTALL_PROGRAM = ${INSTALL}
81 INSTALL_DATA = ${INSTALL}
83 # ============================= Targets ==============================
85 # Things that a user might actually run, which should be installed in bindir.
86 INSTALLABLES = etags ctags emacsclient b2m
87 INSTALLABLE_SCRIPTS = rcs-checkin
89 # Things that Emacs runs internally, or during the build process,
90 # which should not be installed in bindir.
91 UTILITIES= test-distrib make-path wakeup make-docfile digest-doc sorted-doc \
92 movemail cvtmail fakemail yow env emacsserver hexl timer
94 # Like UTILITIES, but they're not system-dependent, and should not be
95 # deleted by the distclean target.
96 SCRIPTS= rcs2log vcdiff
98 EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
100 SOURCES = COPYING ChangeLog Makefile.in README aixcc.lex emacs.csh \
101 makedoc.com *.[chy] rcs2log vcdiff
103 ### We need to #define emacs to get the right versions of some files.
104 ### Some other files - those shared with other GNU utilities - need
105 ### HAVE_CONFIG_H #defined before they know they can take advantage of
106 ### the information in ../src/config.h.
107 ALL_CFLAGS = ${C_SWITCH_SYSTEM} -Demacs -DHAVE_CONFIG_H \
108 -I${srcdir} -I${srcdir}/../src -I. -I../src ${CFLAGS}
109 CPP_CFLAGS = ${C_SWITCH_SYSTEM} -Demacs -DHAVE_CONFIG_H \
110 -I${srcdir} -I${srcdir}/../src -I. -I../src ${CPPFLAGS} ${CFLAGS}
111 # This is the default compilation command.
112 # But we should never rely on it, because some make version
113 # failed to find it for getopt.o. Using an explicit command made it work.
114 .c.o:
115 ${CC} -c ${CPP_CFLAGS} $<
117 all: ${UTILITIES} ${INSTALLABLES}
119 ### Install the internal utilities. Until they are installed, we can
120 ### just run them directly from lib-src.
121 ${archlibdir}: all
122 @echo
123 @echo "Installing utilities run internally by Emacs."
124 ./make-path ${archlibdir}
125 if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
126 for file in ${UTILITIES} ${INSTALLABLES}; do \
127 cp $${file} ${archlibdir} ; \
128 chmod 755 ${archlibdir}/$${file} ; \
129 done ; \
130 cd ${srcdir}; for file in ${SCRIPTS} ${INSTALLABLE_SCRIPTS}; do \
131 cp $${file} ${archlibdir} ; \
132 chmod 755 ${archlibdir}/$${file} ; \
133 done ; \
135 @echo
136 @echo "Changing the owner and group of Emacs's utility programs to \`bin'."
137 @echo "(You may ignore errors here if you don't care about this.)"
138 -for file in ${EXECUTABLES} ; do \
139 chgrp bin ${archlibdir}/$${file} ; \
140 chown bin ${archlibdir}/$${file} ; \
141 done
143 # We don't need to install `wakeup' explicitly, because it will be copied when
144 # this whole directory is copied.
145 install: ${archlibdir}
146 @echo
147 @echo "Installing utilities for users to run."
148 for file in ${INSTALLABLES} ; do \
149 cp $${file} ${bindir}/$${file}.new ; \
150 chmod 755 ${bindir}/$${file}.new ; \
151 done
152 for file in ${INSTALLABLE_SCRIPTS} ; do \
153 cp ${srcdir}/$${file} ${bindir}/$${file}.new ; \
154 chmod 755 ${bindir}/$${file}.new ; \
155 done
156 @echo
157 @echo "Changing the owner and group of utility programs to \`bin'."
158 @echo "(You may ignore errors here if you don't care about this.)"
159 -for file in ${INSTALLABLES} ${INSTALLABLE_SCRIPTS} ; do \
160 chgrp bin ${bindir}/$${file}.new ; \
161 chown bin ${bindir}/$${file}.new ; \
162 rm -f ${bindir}/$${file} ; \
163 mv ${bindir}/$${file}.new ${bindir}/$${file} ; \
164 done
166 uninstall:
167 (cd ${bindir}; \
168 rm -f ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
169 (cd ${archlibdir}; \
170 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
172 clean mostlyclean:
173 -rm -f ${INSTALLABLES} ${UTILITIES} core *.o
175 distclean: clean
176 -rm -f ../etc/DOC* *.tab.c *.tab.h aixcc.c TAGS
178 realclean: distclean
179 true
181 extraclean: realclean
182 -rm -f *~ \#*
184 unlock:
185 chmod u+w $(SOURCES)
187 relock:
188 chmod u-w $(SOURCES)
190 # Test the contents of the directory.
191 check:
192 @echo "We don't have any tests for GNU Emacs yet."
194 TAGS: etags
195 etags *.[ch]
197 # This verifies that the non-ASCII characters in the file `testfile'
198 # have not been clobbered by whatever means were used to copy and
199 # distribute Emacs. If they were clobbered, all the .elc files were
200 # clobbered too.
201 test-distrib: ${srcdir}/test-distrib.c
202 $(CC) -o test-distrib ${srcdir}/test-distrib.c
203 ./test-distrib ${srcdir}/testfile
205 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
206 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
207 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
208 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
209 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
210 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
212 etags: ${srcdir}/etags.c $(GETOPTDEPS)
213 $(CC) ${CPP_CFLAGS} -DETAGS ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o etags
215 # We depend on etags to assure that parallel makes don't write two
216 # etags.o files on top of each other.
217 ctags: ${srcdir}/etags.c $(GETOPTDEPS) etags
218 $(CC) ${CPP_CFLAGS} -DCTAGS ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o ctags
220 wakeup: ${srcdir}/wakeup.c
221 $(CC) ${CPP_CFLAGS} ${srcdir}/wakeup.c $(LOADLIBES) -o wakeup
223 make-docfile: ${srcdir}/make-docfile.c
224 $(CC) ${CPP_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
226 digest-doc: ${srcdir}/digest-doc.c
227 $(CC) ${CPP_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
229 sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
230 $(CC) ${CPP_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
232 b2m: ${srcdir}/b2m.c ../src/config.h
233 $(CC) -I${srcdir}/../src ${CPP_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m
235 movemail: ${srcdir}/movemail.c ../src/config.h
236 $(CC) -I${srcdir}/../src ${CPP_CFLAGS} ${srcdir}/movemail.c $(LOADLIBES) -o movemail
238 cvtmail: ${srcdir}/cvtmail.c
239 $(CC) ${CPP_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
241 fakemail: ${srcdir}/fakemail.c ../src/config.h
242 $(CC) -I${srcdir}/../src ${CPP_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
244 yow: ${srcdir}/yow.c ../src/paths.h
245 $(CC) ${CPP_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
247 env: ${srcdir}/env.c ../src/config.h
248 $(CC) -DEMACS -I${srcdir}/../src ${CPP_CFLAGS} ${srcdir}/env.c $(LOADLIBES) -o env
250 emacsserver: ${srcdir}/emacsserver.c ../src/config.h
251 $(CC) -I${srcdir}/../src ${CPP_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver
253 emacsclient: ${srcdir}/emacsclient.c ../src/config.h
254 $(CC) -I${srcdir}/../src ${CPP_CFLAGS} ${srcdir}/emacsclient.c $(LOADLIBES) -o emacsclient
256 hexl: ${srcdir}/hexl.c
257 $(CC) ${CPP_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
259 TIMEROBJS=getdate.o timer.o $(ALLOCA)
260 getdate.o: ${srcdir}/getdate.y ../src/config.h
261 ${YACC} ${YFLAGS} ${srcdir}/getdate.y
262 $(CC) -I${srcdir}/../src $(CPP_CFLAGS) -c y.tab.c
263 mv y.tab.o getdate.o
264 timer.o: ${srcdir}/timer.c ../src/config.h
265 $(CC) -c -I${srcdir}/../src $(CPP_CFLAGS) ${srcdir}/timer.c
266 timer: ${TIMEROBJS}
267 $(CC) -I${srcdir}/../src $(ALL_CFLAGS) ${TIMEROBJS} $(LOADLIBES) -o timer
269 make-path: ${srcdir}/make-path.c
270 $(CC) $(CPP_CFLAGS) ${srcdir}/make-path.c -o make-path
272 # These are NOT included in INSTALLABLES or UTILITIES.
273 # See ../src/ymakefile.
274 emacstool: ${srcdir}/emacstool.c
275 $(CC) ${srcdir}/emacstool.c -o emacstool ${CPP_CFLAGS} \
276 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
278 # For SUN Japanese Language Environment
279 nemacstool: ${srcdir}/emacstool.c
280 $(CC) -o nemacstool -DJLE ${CPP_CFLAGS} ${srcdir}/emacstool.c \
281 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
283 xvetool: ${srcdir}/emacstool.c
284 $(CC) -o xvetool -DXVIEW ${CPP_CFLAGS} ${srcdir}/emacstool.c \
285 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
286 $(LOADLIBES)
288 xveterm: ${srcdir}/emacstool.c
289 $(CC) -o xveterm -DXVIEW -DTTERM ${CPP_CFLAGS} ${srcdir}/emacstool.c \
290 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
291 $(LOADLIBES)
293 aixcc: ${srcdir}/aixcc.c
294 $(CC) $(CPP_CFLAGS) -o aixcc ${srcdir}/aixcc.c
296 aixcc.c: ${srcdir}/aixcc.lex
297 lex ${srcdir}/aixcc.lex
298 mv lex.yy.c aixcc.c