]> code.delx.au - gnu-emacs/blob - lib-src/Makefile.in
mawk, SunOS 4.1.3 nawk, and Ultrix/MKS nawk all barf on /[/]/, so change
[gnu-emacs] / 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' might edit ====================
16
17 CC=cc
18 DEFS=-g
19 C_SWITCH_SYSTEM=
20 LOADLIBES=
21 version=version-not-set
22 configname=configuration-name-not-set
23
24 # ==================== Where To Install Things ====================
25
26 # The default location for installation. Everything is placed in
27 # subdirectories of this directory. The default values for many of
28 # the variables below are expressed in terms of this one, so you may
29 # not need to change them.
30 prefix=/usr/local
31
32 # Like `prefix', but used for architecture-specific files.
33 exec_prefix=${prefix}
34
35 # Where to install Emacs and other binaries that people will want to
36 # run directly (like etags).
37 bindir=${exec_prefix}/bin
38
39 # Where to install and expect executable files to be run by Emacs
40 # rather than directly by users, and other architecture-dependent
41 # data. ${archlibdir} is usually below this.
42 libdir=${exec_prefix}/lib
43
44 # Where to find the source code - setting this to anything but
45 # . doesn't work yet. The source code for Emacs's C kernel is
46 # expected to be in ${srcdir}/src, and the source code for Emacs's
47 # utility programs is expected to be in ${srcdir}/lib-src. This is
48 # set by the configure script's `--srcdir' option.
49 srcdir=.
50
51 # ==================== Emacs-specific directories ====================
52
53 # These variables hold the values Emacs will actually use. They are
54 # based on the values of the standard Make variables above.
55
56 # Where to put executables to be run by Emacs rather than the user.
57 # This path usually includes the Emacs version and configuration name,
58 # so that multiple configurations for multiple versions of Emacs may
59 # be installed at once.
60 archlibdir=${libdir}/emacs/${version}/${configname}
61
62 # ====================== Developer's configuration =======================
63
64 # The following assignments make sense if you're running Emacs on a single
65 # machine, one version at a time, and you want changes to the lisp and etc
66 # directories in the source tree to show up immediately in your working
67 # environment. It saves a great deal of disk space by not duplicating the
68 # lisp and etc directories.
69 #
70 # archlibdir=${srcdir}/bin
71
72 # ==================== Utility Programs for the Build ====================
73
74 # Allow the user to specify the install program.
75 INSTALL = install
76 INSTALLFLAGS = -c
77 INSTALL_PROGRAM = ${INSTALL}
78 INSTALL_DATA = ${INSTALL}
79
80 # ============================= Targets ==============================
81
82 # Things that a user might actually run, which should be installed in bindir.
83 INSTALLABLES = etags ctags emacsclient b2m rcs-checkin
84
85 # Things that Emacs runs internally, or during the build process,
86 # which should not be installed in bindir.
87 UTILITIES= test-distrib make-path wakeup make-docfile digest-doc sorted-doc \
88 movemail cvtmail fakemail yow env emacsserver hexl timer
89
90 # Like UTILITIES, but they're not system-dependent, and should not be
91 # deleted by the distclean target.
92 SCRIPTS= rcs2log vcdiff
93
94 EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS}
95
96 SOURCES = COPYING ChangeLog Makefile.in README aixcc.lex emacs.csh \
97 makedoc.com *.[chy] rcs2log vcdiff
98
99 ### We need to #define emacs to get the right versions of some files.
100 ### Some other files - those shared with other GNU utilities - need
101 ### HAVE_CONFIG_H #defined before they know they can take advantage of
102 ### the information in ../src/config.h.
103 CFLAGS=${DEFS} ${C_SWITCH_SYSTEM} -Demacs -DHAVE_CONFIG_H -I../src
104
105 all: ${EXECUTABLES}
106
107 ### Install the internal utilities. Until they are installed, we can
108 ### just run them directly from lib-src.
109 ${archlibdir}: all
110 @echo
111 @echo "Installing utilities run internally by Emacs."
112 ./make-path ${archlibdir}
113 if [ `(cd ${archlibdir};/bin/pwd)` != `/bin/pwd` ]; then \
114 for file in ${EXECUTABLES} ; do \
115 cp $${file} ${archlibdir} ; \
116 chmod 755 ${archlibdir}/$${file} ; \
117 done ; \
118 fi
119 @echo
120 @echo "Changing the owner and group of Emacs's utility programs to \`bin'."
121 @echo "(You may ignore errors here if you don't care about this.)"
122 -for file in ${EXECUTABLES} ; do \
123 chgrp bin ${archlibdir}/$${file} ; \
124 chown bin ${archlibdir}/$${file} ; \
125 done
126
127 # We don't need to install `wakeup' explicitly, because it will be copied when
128 # this whole directory is copied.
129 install: ${archlibdir}
130 @echo
131 @echo "Installing utilities for users to run."
132 for file in emacsclient etags ctags b2m ; do \
133 cp $${file} ${bindir}/$${file}.new ; \
134 chmod 755 ${bindir}/$${file}.new ; \
135 done
136 @echo
137 @echo "Changing the owner and group of utility programs to \`bin'."
138 @echo "(You may ignore errors here if you don't care about this.)"
139 -for file in emacsclient etags ctags b2m ; do \
140 chgrp bin ${bindir}/$${file}.new ; \
141 chown bin ${bindir}/$${file}.new ; \
142 mv ${bindir}/$${file}.new ${bindir}/$${file} ; \
143 done
144
145 clean mostlyclean:
146 -rm -f ${INSTALLABLES} ${UTILITIES} core *.o
147
148 distclean:
149 -rm -f ${INSTALLABLES} ${UTILITIES} ../etc/DOC* core *.o
150
151 realclean: distclean
152 -rm TAGS aixcc.c
153
154 extraclean: realclean
155 -rm -f *~ \#*
156
157 unlock:
158 chmod u+w $(SOURCES)
159
160 relock:
161 chmod u-w $(SOURCES)
162
163 # Test the contents of the directory.
164 check:
165 @echo "We don't have any tests for GNU Emacs yet."
166
167 TAGS: etags
168 etags *.[ch]
169
170 # This verifies that the non-ASCII characters in the file `testfile'
171 # have not been clobbered by whatever means were used to copy and
172 # distribute Emacs. If they were clobbered, all the .elc files were
173 # clobbered too.
174 test-distrib: test-distrib.c
175 $(CC) -o test-distrib test-distrib.c
176 ./test-distrib
177
178 GETOPTOBJS = getopt.o getopt1.o
179 GETOPTDEPS = $(GETOPTOBJS) getopt.h
180 getopt.o: getopt.c getopt.h
181 getopt1.o: getopt1.c getopt.h
182
183 etags: etags.c $(GETOPTDEPS)
184 $(CC) ${CFLAGS} -DETAGS etags.c $(GETOPTOBJS) $(LOADLIBES) -o etags
185
186 ctags: etags.c $(GETOPTDEPS)
187 $(CC) ${CFLAGS} -DCTAGS etags.c $(GETOPTOBJS) $(LOADLIBES) -o ctags
188
189 wakeup: wakeup.c
190 $(CC) ${CFLAGS} wakeup.c $(LOADLIBES) -o wakeup
191
192 make-docfile: make-docfile.c
193 $(CC) ${CFLAGS} make-docfile.c $(LOADLIBES) -o make-docfile
194
195 digest-doc: digest-doc.c
196 $(CC) ${CFLAGS} digest-doc.c $(LOADLIBES) -o digest-doc
197
198 sorted-doc: sorted-doc.c
199 $(CC) ${CFLAGS} sorted-doc.c $(LOADLIBES) -o sorted-doc
200
201 b2m: b2m.c ../src/config.h
202 $(CC) ${CFLAGS} b2m.c $(LOADLIBES) -o b2m
203
204 movemail: movemail.c ../src/config.h
205 $(CC) ${CFLAGS} movemail.c $(LOADLIBES) -o movemail
206
207 cvtmail: cvtmail.c
208 $(CC) ${CFLAGS} cvtmail.c $(LOADLIBES) -o cvtmail
209
210 fakemail: fakemail.c ../src/config.h
211 $(CC) ${CFLAGS} fakemail.c $(LOADLIBES) -o fakemail
212
213 yow: yow.c ../src/paths.h
214 $(CC) ${CFLAGS} yow.c $(LOADLIBES) -o yow
215
216 env: env.c ../src/config.h
217 $(CC) -DEMACS ${CFLAGS} env.c $(LOADLIBES) -o env
218
219 emacsserver: emacsserver.c ../src/config.h
220 $(CC) ${CFLAGS} emacsserver.c $(LOADLIBES) -o emacsserver
221
222 emacsclient: emacsclient.c ../src/config.h
223 $(CC) ${CFLAGS} emacsclient.c $(LOADLIBES) -o emacsclient
224
225 hexl: hexl.c
226 $(CC) ${CFLAGS} hexl.c $(LOADLIBES) -o hexl
227
228 getdate.o: getdate.y ../src/config.h
229 ${YACC} ${YFLAGS} getdate.y
230 $(CC) $(CFLAGS) -c y.tab.c
231 mv y.tab.o getdate.o
232 timer: getdate.o timer.o
233 $(CC) $(CFLAGS) getdate.o timer.o -o timer
234
235 make-path: make-path.c
236 $(CC) $(CFLAGS) make-path.c -o make-path
237
238 # These are NOT included in INSTALLABLES or UTILITIES.
239 # See ../src/ymakefile.
240 emacstool: emacstool.c
241 $(CC) emacstool.c -o emacstool ${CFLAGS} \
242 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
243
244 # For SUN Japanese Language Environment
245 nemacstool: emacstool.c
246 $(CC) -o nemacstool -DJLE ${CFLAGS} emacstool.c \
247 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
248
249 xvetool: emacstool.c
250 $(CC) -o xvetool -DXVIEW ${CFLAGS} emacstool.c \
251 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
252 $(LOADLIBES)
253
254 xveterm: emacstool.c
255 $(CC) -o xveterm -DXVIEW -DTTERM ${CFLAGS} emacstool.c \
256 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
257 $(LOADLIBES)
258
259 aixcc: aixcc.c
260 $(CC) $(CFLAGS) -o aixcc aixcc.c
261
262 aixcc.c: aixcc.lex
263 lex aixcc.lex
264 mv lex.yy.c aixcc.c