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