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