Makefile.in 9.84 KB
Newer Older
Jim Blandy's avatar
Jim Blandy committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# DIST: This is the distribution Makefile for Emacs.  configure can
# DIST: make most of the changes to this file you might want, so try
# DIST: that first.

# add -DUSG for SysV movemail and timer
# For Xenix, add the following for movemail:
#  LOADLIBES= -lx
# For Mips, the following is needed for who knows what.
#  LOADLIBES = -lmld /usr/bsd43/usr/lib/libc.a

# Avoid trouble on systems where the `SHELL' variable might be
# inherited from the environment.
SHELL = /bin/sh

15
# ==================== Things `configure' will edit ====================
16

17 18 19 20 21 22 23 24
CC=@CC@
CFLAGS=@CFLAGS@
ALLOCA=@ALLOCA@
C_SWITCH_SYSTEM=@c_switch_system@
LOADLIBES=@libsrc_libs@
YACC=@YACC@
version=@version@
configname=@configuration@
25 26 27 28 29 30

# ==================== Where To Install Things ====================

# The default location for installation.  Everything is placed in
# subdirectories of this directory.  The default values for many of
# the variables below are expressed in terms of this one, so you may
31
# not need to change them.  This is set with the --prefix option to
32
# `../configure'.
33
prefix=@prefix@
34

35 36 37
# Like `prefix', but used for architecture-specific files.  This is
# set with the --exec-prefix option to `../configure'.
exec_prefix=@exec_prefix@
38 39

# Where to install Emacs and other binaries that people will want to
40 41 42
# run directly (like etags).  This is set with the --bindir option
# to `../configure'.
bindir=@bindir@
43 44 45

# Where to install and expect executable files to be run by Emacs
# rather than directly by users, and other architecture-dependent
46 47 48
# data.  ${archlibdir} is usually below this.  This is set with the
# --libdir option to `../configure'.
libdir=@libdir@
49

50 51 52 53 54 55
# Where to find the source code.  This is set by the configure
# script's `--srcdir' option.  However, the value of ${srcdir} in
# this makefile is not identical to what was specified with --srcdir,
# since the variable here has `/lib-src' added at the end.
srcdir=@srcdir@
VPATH=@srcdir@
56 57 58 59 60 61 62 63 64

# ==================== Emacs-specific directories ====================

# These variables hold the values Emacs will actually use.  They are
# based on the values of the standard Make variables above.

# Where to put executables to be run by Emacs rather than the user.
# This path usually includes the Emacs version and configuration name,
# so that multiple configurations for multiple versions of Emacs may
65 66 67
# be installed at once.  This can be set with the --archlibdir option
# to `../configure'.
archlibdir=@archlibdir@
Eric S. Raymond's avatar
Eric S. Raymond committed
68

69 70
# ==================== Utility Programs for the Build ====================

71
# ../configure figures out the correct values for these.
72 73 74
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
75 76

# ============================= Targets ==============================
Jim Blandy's avatar
Jim Blandy committed
77

Jim Blandy's avatar
Jim Blandy committed
78
# Things that a user might actually run, which should be installed in bindir.
79 80
INSTALLABLES = etags ctags emacsclient b2m
INSTALLABLE_SCRIPTS = rcs-checkin
Jim Blandy's avatar
Jim Blandy committed
81

Jim Blandy's avatar
Jim Blandy committed
82 83
# Things that Emacs runs internally, or during the build process,
# which should not be installed in bindir.
84
UTILITIES= test-distrib make-path wakeup make-docfile digest-doc sorted-doc \
Jim Blandy's avatar
Jim Blandy committed
85
	movemail cvtmail fakemail yow env emacsserver hexl timer
Jim Blandy's avatar
Jim Blandy committed
86

Jim Blandy's avatar
Jim Blandy committed
87 88 89 90
# Like UTILITIES, but they're not system-dependent, and should not be
# deleted by the distclean target.
SCRIPTS= rcs2log vcdiff

91
EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
Jim Blandy's avatar
Jim Blandy committed
92

Eric S. Raymond's avatar
Eric S. Raymond committed
93 94 95
SOURCES = COPYING ChangeLog Makefile.in README aixcc.lex emacs.csh \
	makedoc.com *.[chy] rcs2log vcdiff

96 97 98 99
### We need to #define emacs to get the right versions of some files.
### Some other files - those shared with other GNU utilities - need
### HAVE_CONFIG_H #defined before they know they can take advantage of
### the information in ../src/config.h.
100
ALL_CFLAGS = ${C_SWITCH_SYSTEM} -Demacs -DHAVE_CONFIG_H \
101
   -I. -I../src -I${srcdir} -I${srcdir}/../src ${CFLAGS}
102
CPP_CFLAGS = ${C_SWITCH_SYSTEM} -Demacs -DHAVE_CONFIG_H \
103
   -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
104 105 106
# This is the default compilation command.
# But we should never rely on it, because some make version
# failed to find it for getopt.o.  Using an explicit command made it work.
107
.c.o:
108
	${CC} -c ${CPP_CFLAGS} $<
109

110
all: ${UTILITIES} ${INSTALLABLES}
111 112 113 114 115 116 117

### Install the internal utilities.  Until they are installed, we can
### just run them directly from lib-src.
${archlibdir}: all
	@echo
	@echo "Installing utilities run internally by Emacs."
	./make-path ${archlibdir}
118
	if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
119 120 121 122 123
	  for file in ${UTILITIES}; do \
	    $(INSTALL_PROGRAM) $$file ${archlibdir}/$$file ; \
	    chmod 755 ${archlibdir}/$$file ; \
	  done ; \
	  for file in ${SCRIPTS}; do \
124
	    $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file ; \
125
	    chmod 755 ${archlibdir}/$$file ; \
126
	  done ; \
127
	fi
128 129 130
	@echo
	@echo "Changing the owner and group of Emacs's utility programs to \`bin'."
	@echo "(You may ignore errors here if you don't care about this.)"
131
	-for file in ${UTILITIES} ${SCRIPTS} ; do \
132 133
	  chgrp bin ${archlibdir}/$${file} ; \
	  chown bin ${archlibdir}/$${file} ; \
Jim Blandy's avatar
Jim Blandy committed
134 135 136 137
	done

# We don't need to install `wakeup' explicitly, because it will be copied when
# this whole directory is copied.
138
# We use .n, not .new as before, to avoid exceeding the 14-character limit.
139 140 141
install: ${archlibdir}
	@echo
	@echo "Installing utilities for users to run."
142
	for file in ${INSTALLABLES} ; do \
143 144
	  cp $${file} ${bindir}/$${file}.n ; \
	  chmod 755 ${bindir}/$${file}.n ; \
145
	done
146
	for file in ${INSTALLABLE_SCRIPTS} ; do \
147 148
	  cp ${srcdir}/$${file} ${bindir}/$${file}.n ; \
	  chmod 755 ${bindir}/$${file}.n ; \
149
	done
150
	-for file in ${INSTALLABLES}  ${INSTALLABLE_SCRIPTS} ; do \
151
	  rm -f ${bindir}/$${file} ; \
152
	  mv ${bindir}/$${file}.n ${bindir}/$${file} ; \
153
	done
Jim Blandy's avatar
Jim Blandy committed
154

155 156 157 158 159 160
uninstall:
	(cd ${bindir}; \
	 rm -f ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
	(cd ${archlibdir}; \
	 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})

Jim Blandy's avatar
Jim Blandy committed
161
clean mostlyclean:
Jim Blandy's avatar
Jim Blandy committed
162
	-rm -f ${INSTALLABLES} ${UTILITIES} core *.o
Jim Blandy's avatar
Jim Blandy committed
163

164 165
distclean: clean
	-rm -f ../etc/DOC* *.tab.c *.tab.h aixcc.c TAGS
Jim Blandy's avatar
Jim Blandy committed
166 167

realclean: distclean
168
	true
169 170 171

extraclean: realclean
	-rm -f *~ \#*
Jim Blandy's avatar
Jim Blandy committed
172

Eric S. Raymond's avatar
Eric S. Raymond committed
173 174 175 176 177 178
unlock:
	chmod u+w $(SOURCES)

relock:
	chmod u-w $(SOURCES)

Jim Blandy's avatar
Jim Blandy committed
179 180 181 182 183 184 185 186 187 188 189
# Test the contents of the directory.
check:
	@echo "We don't have any tests for GNU Emacs yet."

TAGS: etags
	etags *.[ch]

# This verifies that the non-ASCII characters in the file `testfile'
# have not been clobbered by whatever means were used to copy and
# distribute Emacs.  If they were clobbered, all the .elc files were
# clobbered too.
190 191 192
test-distrib: ${srcdir}/test-distrib.c
	$(CC) -o test-distrib ${srcdir}/test-distrib.c
	./test-distrib ${srcdir}/testfile
Jim Blandy's avatar
Jim Blandy committed
193

194
GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
195
GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
196
getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
197
	${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
198
getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
199
	${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
Jim Blandy's avatar
Jim Blandy committed
200

201
etags: ${srcdir}/etags.c $(GETOPTDEPS) ../src/config.h
202
	$(CC) ${CPP_CFLAGS} -DETAGS ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o etags
Jim Blandy's avatar
Jim Blandy committed
203

204 205 206
# We depend on etags to assure that parallel makes don't write two
# etags.o files on top of each other.
ctags: ${srcdir}/etags.c $(GETOPTDEPS) etags
207
	$(CC) ${CPP_CFLAGS} -DCTAGS ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o ctags
Jim Blandy's avatar
Jim Blandy committed
208

209
wakeup: ${srcdir}/wakeup.c
210
	$(CC) ${CPP_CFLAGS} ${srcdir}/wakeup.c $(LOADLIBES) -o wakeup
Jim Blandy's avatar
Jim Blandy committed
211

212
make-docfile: ${srcdir}/make-docfile.c
213
	$(CC) ${CPP_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
Jim Blandy's avatar
Jim Blandy committed
214

215
digest-doc: ${srcdir}/digest-doc.c
216
	$(CC) ${CPP_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc 
Jim Blandy's avatar
Jim Blandy committed
217

218
sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
219
	$(CC) ${CPP_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
Jim Blandy's avatar
Jim Blandy committed
220

221
b2m: ${srcdir}/b2m.c ../src/config.h
222
	$(CC) ${CPP_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m 
Jim Blandy's avatar
Jim Blandy committed
223

224
movemail: ${srcdir}/movemail.c ../src/config.h
225
	$(CC) ${CPP_CFLAGS} ${srcdir}/movemail.c $(LOADLIBES) -o movemail
Jim Blandy's avatar
Jim Blandy committed
226

227
cvtmail: ${srcdir}/cvtmail.c
228
	$(CC) ${CPP_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
Jim Blandy's avatar
Jim Blandy committed
229

230
fakemail: ${srcdir}/fakemail.c ../src/config.h
231
	$(CC) ${CPP_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
Jim Blandy's avatar
Jim Blandy committed
232

233
yow: ${srcdir}/yow.c ../src/paths.h
234
	$(CC) ${CPP_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
Jim Blandy's avatar
Jim Blandy committed
235

236
env: ${srcdir}/env.c ../src/config.h
237
	$(CC) -DEMACS ${CPP_CFLAGS} ${srcdir}/env.c $(LOADLIBES) -o env
Jim Blandy's avatar
Jim Blandy committed
238

239
emacsserver: ${srcdir}/emacsserver.c ../src/config.h
240
	$(CC) ${CPP_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver
Jim Blandy's avatar
Jim Blandy committed
241

242
emacsclient: ${srcdir}/emacsclient.c ../src/config.h
243
	$(CC) ${CPP_CFLAGS} ${srcdir}/emacsclient.c $(LOADLIBES) -o emacsclient
Jim Blandy's avatar
Jim Blandy committed
244

245
hexl: ${srcdir}/hexl.c
246
	$(CC) ${CPP_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
Jim Blandy's avatar
Jim Blandy committed
247

248
TIMEROBJS=getdate.o timer.o $(ALLOCA)
249 250
getdate.o: ${srcdir}/getdate.y ../src/config.h
	${YACC} ${YFLAGS} ${srcdir}/getdate.y
251
	$(CC) $(CPP_CFLAGS) -c y.tab.c
252
	mv y.tab.o getdate.o
253
timer.o: ${srcdir}/timer.c ../src/config.h
254
	$(CC) -c $(CPP_CFLAGS) ${srcdir}/timer.c
255
timer: ${TIMEROBJS}
256
	$(CC) $(ALL_CFLAGS) ${TIMEROBJS} $(LOADLIBES) -o timer
Jim Blandy's avatar
Jim Blandy committed
257

258
make-path: ${srcdir}/make-path.c ../src/config.h
259
	$(CC) $(CPP_CFLAGS) ${srcdir}/make-path.c -o make-path
260

Jim Blandy's avatar
Jim Blandy committed
261 262
# These are NOT included in INSTALLABLES or UTILITIES.
# See ../src/ymakefile.
263
emacstool: ${srcdir}/emacstool.c
264
	$(CC) ${srcdir}/emacstool.c -o emacstool ${CPP_CFLAGS} \
Jim Blandy's avatar
Jim Blandy committed
265 266 267
	  -lsuntool -lsunwindow -lpixrect $(LOADLIBES)

# For SUN Japanese Language Environment
268
nemacstool: ${srcdir}/emacstool.c
269
	$(CC) -o nemacstool -DJLE ${CPP_CFLAGS} ${srcdir}/emacstool.c \
Jim Blandy's avatar
Jim Blandy committed
270 271
	  -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)

272
xvetool: ${srcdir}/emacstool.c
273
	$(CC) -o xvetool -DXVIEW ${CPP_CFLAGS} ${srcdir}/emacstool.c \
Jim Blandy's avatar
Jim Blandy committed
274 275 276
	  -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
	  $(LOADLIBES)

277
xveterm: ${srcdir}/emacstool.c
278
	$(CC) -o xveterm -DXVIEW -DTTERM ${CPP_CFLAGS} ${srcdir}/emacstool.c \
Jim Blandy's avatar
Jim Blandy committed
279 280 281
	  -lxview -lolgx -lX  -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
	  $(LOADLIBES)

282
aixcc: ${srcdir}/aixcc.c
283
	$(CC) $(CPP_CFLAGS) -o aixcc ${srcdir}/aixcc.c
Jim Blandy's avatar
Jim Blandy committed
284

285 286
aixcc.c: ${srcdir}/aixcc.lex
	lex ${srcdir}/aixcc.lex
Jim Blandy's avatar
Jim Blandy committed
287
	mv lex.yy.c aixcc.c