(install, ${archlibdir}): Switch back to .. before running INSTALL_PROGRAM.
[bpt/emacs.git] / lib-src / Makefile.in
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.
4
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
10
11 # Avoid trouble on systems where the `SHELL' variable might be
12 # inherited from the environment.
13 SHELL = /bin/sh
14
15 # ==================== Things `configure' will edit ====================
16
17 CC=@CC@
18 CFLAGS=@CFLAGS@
19 ALLOCA=@ALLOCA@
20 C_SWITCH_SYSTEM=@c_switch_system@
21 C_SWITCH_MACHINE=@c_switch_machine@
22 LOADLIBES=@libsrc_libs@
23 YACC=@YACC@
24 version=@version@
25 configname=@configuration@
26
27 # ==================== Where To Install Things ====================
28
29 # The default location for installation. Everything is placed in
30 # subdirectories of this directory. The default values for many of
31 # the variables below are expressed in terms of this one, so you may
32 # not need to change them. This is set with the --prefix option to
33 # `../configure'.
34 prefix=@prefix@
35
36 # Like `prefix', but used for architecture-specific files. This is
37 # set with the --exec-prefix option to `../configure'.
38 exec_prefix=@exec_prefix@
39
40 # Where to install Emacs and other binaries that people will want to
41 # run directly (like etags). This is set with the --bindir option
42 # to `../configure'.
43 bindir=@bindir@
44
45 # Where to install and expect executable files to be run by Emacs
46 # rather than directly by users, and other architecture-dependent
47 # data. ${archlibdir} is usually below this. This is set with the
48 # --libdir option to `../configure'.
49 libdir=@libdir@
50
51 # Where to find the source code. This is set by the configure
52 # script's `--srcdir' option. However, the value of ${srcdir} in
53 # this makefile is not identical to what was specified with --srcdir,
54 # since the variable here has `/lib-src' added at the end.
55 srcdir=@srcdir@
56 VPATH=@srcdir@
57
58 # ==================== Emacs-specific directories ====================
59
60 # These variables hold the values Emacs will actually use. They are
61 # based on the values of the standard Make variables above.
62
63 # Where to put executables to be run by Emacs rather than the user.
64 # This path usually includes the Emacs version and configuration name,
65 # so that multiple configurations for multiple versions of Emacs may
66 # be installed at once. This can be set with the --archlibdir option
67 # to `../configure'.
68 archlibdir=@archlibdir@
69
70 # ==================== Utility Programs for the Build ====================
71
72 # ../configure figures out the correct values for these.
73 INSTALL = @INSTALL@
74 INSTALL_PROGRAM = @INSTALL_PROGRAM@
75 INSTALL_DATA = @INSTALL_DATA@
76
77 # ============================= Targets ==============================
78
79 # Things that a user might actually run, which should be installed in bindir.
80 INSTALLABLES = etags ctags emacsclient b2m
81 INSTALLABLE_SCRIPTS = rcs-checkin
82
83 # Things that Emacs runs internally, or during the build process,
84 # which should not be installed in bindir.
85 UTILITIES= test-distrib make-path wakeup profile make-docfile digest-doc \
86 sorted-doc movemail cvtmail fakemail yow env emacsserver hexl timer
87
88 # Like UTILITIES, but they're not system-dependent, and should not be
89 # deleted by the distclean target.
90 SCRIPTS= rcs2log vcdiff
91
92 EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
93
94 SOURCES = COPYING ChangeLog Makefile.in README aixcc.lex emacs.csh \
95 makedoc.com *.[chy] rcs2log vcdiff
96
97 ### We need to #define emacs to get the right versions of some files.
98 ### Some other files - those shared with other GNU utilities - need
99 ### HAVE_CONFIG_H #defined before they know they can take advantage of
100 ### the information in ../src/config.h.
101 ALL_CFLAGS = ${C_SWITCH_SYSTEM} ${C_SWITCH_MACHINE} -Demacs -DHAVE_CONFIG_H \
102 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
103 LINK_CFLAGS = ${C_SWITCH_SYSTEM} ${C_SWITCH_MACHINE} -Demacs -DHAVE_CONFIG_H \
104 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
105 CPP_CFLAGS = ${C_SWITCH_SYSTEM} ${C_SWITCH_MACHINE} -Demacs -DHAVE_CONFIG_H \
106 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
107 # This is the default compilation command.
108 # But we should never rely on it, because some make version
109 # failed to find it for getopt.o. Using an explicit command made it work.
110 .c.o:
111 ${CC} -c ${CPP_CFLAGS} $<
112
113 all: ${UTILITIES} ${INSTALLABLES}
114
115 ### Install the internal utilities. Until they are installed, we can
116 ### just run them directly from lib-src.
117 ${archlibdir}: all
118 @echo
119 @echo "Installing utilities run internally by Emacs."
120 ./make-path ${archlibdir}
121 if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
122 for file in ${UTILITIES}; do \
123 (cd ..; $(INSTALL_PROGRAM) lib-src/$$file ${archlibdir}/$$file) ; \
124 done ; \
125 for file in ${SCRIPTS}; do \
126 (cd ..; $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file); \
127 done ; \
128 fi
129
130 # We don't need to install `wakeup' explicitly, because it will be copied when
131 # this whole directory is copied.
132 install: ${archlibdir}
133 @echo
134 @echo "Installing utilities for users to run."
135 for file in ${INSTALLABLES} ; do \
136 (cd ..; $(INSTALL_PROGRAM) lib-src/$${file} ${bindir}/$${file}) ; \
137 done
138 for file in ${INSTALLABLE_SCRIPTS} ; do \
139 (cd ..; $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file}) ; \
140 done
141
142 uninstall:
143 (cd ${bindir}; \
144 rm -f ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
145 (cd ${archlibdir}; \
146 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
147
148 mostlyclean:
149 -rm -f core *.o
150
151 clean: mostlyclean
152 -rm -f ${INSTALLABLES} ${UTILITIES}
153
154 distclean: clean
155 -rm -f ../etc/DOC* *.tab.c *.tab.h aixcc.c TAGS
156
157 realclean: distclean
158 true
159
160 extraclean: realclean
161 -rm -f *~ \#*
162
163 unlock:
164 chmod u+w $(SOURCES)
165
166 relock:
167 chmod u-w $(SOURCES)
168
169 # Test the contents of the directory.
170 check:
171 @echo "We don't have any tests for GNU Emacs yet."
172
173 TAGS: etags
174 etags *.[ch]
175
176 # This verifies that the non-ASCII characters in the file `testfile'
177 # have not been clobbered by whatever means were used to copy and
178 # distribute Emacs. If they were clobbered, all the .elc files were
179 # clobbered too.
180 test-distrib: ${srcdir}/test-distrib.c
181 $(CC) -o test-distrib ${srcdir}/test-distrib.c
182 ./test-distrib ${srcdir}/testfile
183
184 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
185 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
186 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
187 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
188 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
189 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
190
191 etags: ${srcdir}/etags.c $(GETOPTDEPS) ../src/config.h
192 $(CC) ${ALL_CFLAGS} -DETAGS ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o etags
193
194 # We depend on etags to assure that parallel makes don't write two
195 # etags.o files on top of each other.
196 ctags: ${srcdir}/etags.c $(GETOPTDEPS) etags
197 $(CC) ${ALL_CFLAGS} -DCTAGS ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o ctags
198
199 wakeup: ${srcdir}/wakeup.c
200 $(CC) ${ALL_CFLAGS} ${srcdir}/wakeup.c $(LOADLIBES) -o wakeup
201
202 profile: ${srcdir}/profile.c
203 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
204
205 make-docfile: ${srcdir}/make-docfile.c
206 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
207
208 digest-doc: ${srcdir}/digest-doc.c
209 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
210
211 sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
212 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
213
214 b2m: ${srcdir}/b2m.c ../src/config.h
215 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m
216
217 movemail: ${srcdir}/movemail.c ../src/config.h
218 $(CC) ${ALL_CFLAGS} ${srcdir}/movemail.c $(LOADLIBES) -o movemail
219
220 cvtmail: ${srcdir}/cvtmail.c
221 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
222
223 fakemail: ${srcdir}/fakemail.c ../src/config.h
224 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
225
226 yow: ${srcdir}/yow.c ../src/paths.h
227 $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
228
229 env: ${srcdir}/env.c ../src/config.h
230 $(CC) -DEMACS ${ALL_CFLAGS} ${srcdir}/env.c $(LOADLIBES) -o env
231
232 emacsserver: ${srcdir}/emacsserver.c ../src/config.h
233 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver
234
235 emacsclient: ${srcdir}/emacsclient.c ../src/config.h
236 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(LOADLIBES) -o emacsclient
237
238 hexl: ${srcdir}/hexl.c
239 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
240
241 TIMEROBJS=getdate.o timer.o $(ALLOCA)
242 getdate.o: ${srcdir}/getdate.y ../src/config.h
243 ${YACC} ${YFLAGS} ${srcdir}/getdate.y
244 $(CC) $(CPP_CFLAGS) -c y.tab.c
245 mv y.tab.o getdate.o
246 timer.o: ${srcdir}/timer.c ../src/config.h
247 $(CC) -c $(CPP_CFLAGS) ${srcdir}/timer.c
248 timer: ${TIMEROBJS}
249 $(CC) $(LINK_CFLAGS) ${TIMEROBJS} $(LOADLIBES) -o timer
250
251 make-path: ${srcdir}/make-path.c ../src/config.h
252 $(CC) $(ALL_CFLAGS) ${srcdir}/make-path.c -o make-path
253
254 # These are NOT included in INSTALLABLES or UTILITIES.
255 # See ../src/ymakefile.
256 emacstool: ${srcdir}/emacstool.c
257 $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
258 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
259
260 # For SUN Japanese Language Environment
261 nemacstool: ${srcdir}/emacstool.c
262 $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
263 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
264
265 xvetool: ${srcdir}/emacstool.c
266 $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
267 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
268 $(LOADLIBES)
269
270 xveterm: ${srcdir}/emacstool.c
271 $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
272 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
273 $(LOADLIBES)
274
275 aixcc: ${srcdir}/aixcc.c
276 $(CC) $(ALL_CFLAGS) -o aixcc ${srcdir}/aixcc.c
277
278 aixcc.c: ${srcdir}/aixcc.lex
279 lex ${srcdir}/aixcc.lex
280 mv lex.yy.c aixcc.c