Provide a Windows manifest for update-game-score.exe.
[bpt/emacs.git] / lib-src / Makefile.in
... / ...
CommitLineData
1### @configure_input@
2
3# Copyright (C) 1985, 1987-1988, 1993-1994, 2001-2013
4# Free Software Foundation, Inc.
5
6# This file is part of GNU Emacs.
7
8# GNU Emacs is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12
13# GNU Emacs is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17
18# You should have received a copy of the GNU General Public License
19# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
20
21
22# Avoid trouble on systems where the `SHELL' variable might be
23# inherited from the environment.
24SHELL = /bin/sh
25
26# Following ../lisp/Makefile.in.
27EMACS = ../src/emacs
28EMACSOPT = -batch --no-site-file --no-site-lisp
29
30# ==================== Things `configure' will edit ====================
31
32CC=@CC@
33CFLAGS=@CFLAGS@
34version=@version@
35## Used in $archlibdir.
36configuration=@configuration@
37EXEEXT=@EXEEXT@
38C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
39C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
40PROFILING_CFLAGS = @PROFILING_CFLAGS@
41WARN_CFLAGS = @WARN_CFLAGS@
42WERROR_CFLAGS = @WERROR_CFLAGS@
43UPDATE_MANIFEST = @UPDATE_MANIFEST@
44
45# Program name transformation.
46TRANSFORM = @program_transform_name@
47
48# ==================== Where To Install Things ====================
49
50# Location to install Emacs.app under GNUstep / Mac OS X.
51# Later values may use this.
52ns_appbindir=@ns_appbindir@
53
54# The default location for installation. Everything is placed in
55# subdirectories of this directory. The default values for many of
56# the variables below are expressed in terms of this one, so you may
57# not need to change them. This is set with the --prefix option to
58# `../configure'.
59prefix=@prefix@
60
61# Like `prefix', but used for architecture-specific files. This is
62# set with the --exec-prefix option to `../configure'.
63exec_prefix=@exec_prefix@
64
65# Where to install Emacs and other binaries that people will want to
66# run directly (like etags). This is set with the --bindir option
67# to `../configure'.
68bindir=@bindir@
69
70# Where to install and expect executable files to be run by Emacs
71# rather than directly by users, and other architecture-dependent
72# data. ${archlibdir} is usually below this. This is set with the
73# --libexecdir option to `../configure'.
74libexecdir=@libexecdir@
75
76# Directory for local state files for all programs.
77localstatedir=@localstatedir@
78
79# Where to find the source code. This is set by the configure
80# script's `--srcdir' option. However, the value of ${srcdir} in
81# this makefile is not identical to what was specified with --srcdir,
82# since the variable here has `/lib-src' added at the end.
83
84# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
85srcdir=@srcdir@
86VPATH=@srcdir@
87
88# The top-level source directory, also set by configure.
89top_srcdir=@top_srcdir@
90
91# ==================== Emacs-specific directories ====================
92
93# These variables hold the values Emacs will actually use. They are
94# based on the values of the standard Make variables above.
95
96# Where to put executables to be run by Emacs rather than the user.
97# This path usually includes the Emacs version and configuration name,
98# so that multiple configurations for multiple versions of Emacs may
99# be installed at once. This can be set with the --archlibdir option
100# to `../configure'.
101archlibdir=@archlibdir@
102
103gamedir=@gamedir@
104gameuser=@gameuser@
105
106# ==================== Utility Programs for the Build =================
107
108# ../configure figures out the correct values for these.
109INSTALL = @INSTALL@
110INSTALL_PROGRAM = @INSTALL_PROGRAM@
111INSTALL_SCRIPT = @INSTALL_SCRIPT@
112# By default, we uphold the dignity of our programs.
113INSTALL_STRIP =
114MKDIR_P = @MKDIR_P@
115
116# ========================== Lists of Files ===========================
117
118# emacsclientw.exe for MinGW, empty otherwise
119CLIENTW = @CLIENTW@
120
121# Things that a user might actually run, which should be installed in bindir.
122INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} $(CLIENTW) \
123 ebrowse${EXEEXT}
124
125INSTALLABLE_SCRIPTS = grep-changelog
126
127# Things that Emacs runs internally, or during the build process,
128# which should not be installed in bindir.
129UTILITIES = profile${EXEEXT} movemail${EXEEXT} hexl${EXEEXT} \
130 update-game-score${EXEEXT}
131
132DONT_INSTALL= test-distrib${EXEEXT} make-docfile${EXEEXT}
133
134# Like UTILITIES, but they're not system-dependent, and should not be
135# deleted by the distclean target.
136SCRIPTS= rcs2log $(UPDATE_MANIFEST)
137
138# All files that are created by the linker, i.e., whose names end in ${EXEEXT}.
139EXE_FILES = ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
140
141# Specify additional -D flags for movemail. Options:
142# -DMAIL_USE_FLOCK or -DMAIL_USE_LOCKF (use flock or lockf for file locking).
143# See the comments about locking in movemail.c. Normally the values
144# set by configure should be correct and you should not need to do anything.
145# If neither flag is set, you need to use blessmail.
146MOVE_FLAGS=
147
148## Empty if either MAIL_USE_FLOCK or MAIL_USE_LOCKF, else need-blessmail.
149BLESSMAIL_TARGET=@BLESSMAIL_TARGET@
150
151## -lkrb or -lkrb4 if needed
152KRB4LIB=@KRB4LIB@
153## -ldes or -ldes425 if needed
154DESLIB=@DESLIB@
155## -lkrb5 if needed
156KRB5LIB=@KRB5LIB@
157## -lk5crypto or -lcrypto if needed
158CRYPTOLIB=@CRYPTOLIB@
159## -lcom_err if needed
160COM_ERRLIB=@COM_ERRLIB@
161## -lhesiod if needed
162LIBHESIOD=@LIBHESIOD@
163## -lresolv if HAVE_LIBRESOLV
164LIBRESOLV=@LIBRESOLV@
165## -llockfile if HAVE_LIBLOCKFILE or -lmail if HAVE_LIBMAIL
166LIBS_MAIL=@LIBS_MAIL@
167## empty or -lrt or -lposix4 if HAVE_CLOCK_GETTIME
168LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
169## empty or -lrt or -lposix4 if HAVE_FDATASYNC
170LIB_FDATASYNC = @LIB_FDATASYNC@
171## empty or -lwsock2 for MinGW
172LIB_WSOCK32=@LIB_WSOCK32@
173
174## Extra libraries to use when linking movemail.
175LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \
176 $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32)
177
178## Extra libraries when linking emacsclient
179## (empty or -lcomctl32 for MinGW)
180LIBS_ECLIENT = @LIBS_ECLIENT@
181
182## Extra object files for linking for MinGW
183NTLIB = @NTLIB@
184CLIENTRES = @CLIENTRES@
185WINDRES = @WINDRES@
186
187## Some systems define this to request special libraries.
188LIBS_SYSTEM = @LIBS_SYSTEM@
189
190BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \
191 $(WARN_CFLAGS) $(WERROR_CFLAGS) \
192 -I. -I../src -I../lib \
193 -I${srcdir} -I${srcdir}/../src -I${srcdir}/../lib
194
195ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
196LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
197CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
198
199# Configuration files for .o files to depend on.
200config_h = ../src/config.h $(srcdir)/../src/conf_post.h
201
202all: ${EXE_FILES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
203
204.PHONY: all need-blessmail maybe-blessmail
205
206LOADLIBES = ../lib/libgnu.a $(LIBS_SYSTEM)
207$(EXE_FILES): ../lib/libgnu.a
208
209## Only used if we need blessmail, but no harm in always defining.
210## This makes the actual blessmail executable.
211blessmail:
212 $(EMACS) $(EMACSOPT) -l $(srcdir)/../lisp/mail/blessmail.el
213 chmod +x blessmail
214
215## This checks if we need to run blessmail.
216## Do not charge ahead and do it! Let the installer decide.
217need-blessmail: blessmail
218 @if [ `wc -l <blessmail` != 2 ] ; then \
219 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
220 echo Assuming $$dir is really the mail spool directory, you should; \
221 echo run lib-src/blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT}; \
222 echo as root, to give movemail${EXEEXT} appropriate permissions.; \
223 echo Do that after running make install.; \
224 fi
225
226## This is the target invoked by the top-level Makefile.
227maybe-blessmail: $(BLESSMAIL_TARGET)
228
229## Install the internal utilities. Until they are installed, we can
230## just run them directly from lib-src.
231## If the chown/chmod commands fail, that is not a big deal.
232## update-game-score will detect at runtime that it is not setuid,
233## and handle things accordingly.
234$(DESTDIR)${archlibdir}: all
235 @echo
236 @echo "Installing utilities run internally by Emacs."
237 umask 022; ${MKDIR_P} $(DESTDIR)${archlibdir}
238 if [ `cd $(DESTDIR)${archlibdir} && /bin/pwd` != `/bin/pwd` ]; then \
239 for file in ${UTILITIES}; do \
240 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file $(DESTDIR)${archlibdir}/$$file ; \
241 done ; \
242 fi
243 umask 022; ${MKDIR_P} $(DESTDIR)${gamedir}; \
244 touch $(DESTDIR)${gamedir}/snake-scores; \
245 touch $(DESTDIR)${gamedir}/tetris-scores
246 -if chown ${gameuser} $(DESTDIR)${archlibdir}/update-game-score${EXEEXT} && chmod u+s $(DESTDIR)${archlibdir}/update-game-score${EXEEXT}; then \
247 chown ${gameuser} $(DESTDIR)${gamedir}; \
248 chmod u=rwx,g=rwx,o=rx $(DESTDIR)${gamedir}; \
249 fi
250 if [ `cd $(DESTDIR)${archlibdir} && /bin/pwd` \
251 != `cd ${srcdir} && /bin/pwd` ]; then \
252 for file in ${SCRIPTS}; do \
253 $(INSTALL_SCRIPT) ${srcdir}/$$file $(DESTDIR)${archlibdir}/$$file; \
254 done ; \
255 fi
256
257.PHONY: install uninstall mostlyclean clean distclean maintainer-clean
258.PHONY: extraclean check tags
259
260install: $(DESTDIR)${archlibdir}
261 @echo
262 @echo "Installing utilities for users to run."
263 umask 022; ${MKDIR_P} $(DESTDIR)${bindir}
264 for file in ${INSTALLABLES} ; do \
265 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(DESTDIR)${bindir}/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
266 done
267 for file in ${INSTALLABLE_SCRIPTS} ; do \
268 $(INSTALL_SCRIPT) ${srcdir}/$${file} $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
269 done
270
271uninstall:
272 for file in ${INSTALLABLES}; do \
273 rm -f $(DESTDIR)${bindir}/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
274 done
275 for file in ${INSTALLABLE_SCRIPTS}; do \
276 rm -f $(DESTDIR)${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
277 done
278 if [ -d $(DESTDIR)${archlibdir} ]; then \
279 (cd $(DESTDIR)${archlibdir} && rm -f ${UTILITIES} ${SCRIPTS}) \
280 fi
281
282mostlyclean:
283 -rm -f core *.o *.res
284
285clean: mostlyclean
286 -rm -f ${EXE_FILES}
287
288distclean: clean
289 -rm -f TAGS
290 -rm -f Makefile blessmail
291
292maintainer-clean: distclean
293 true
294
295extraclean: maintainer-clean
296 -rm -f *~ \#*
297
298## Test the contents of the directory.
299check:
300 @echo "We don't have any tests for the lib-src/ directory yet."
301
302tags: TAGS
303TAGS: etags${EXEEXT}
304 etags *.[ch]
305
306## This verifies that the non-ASCII characters in the file \`testfile\'
307## have not been clobbered by whatever means were used to copy and
308## distribute Emacs. If they were clobbered, all the .elc files were
309## clobbered too.
310test-distrib${EXEEXT}: ${srcdir}/test-distrib.c
311 $(CC) ${ALL_CFLAGS} -o test-distrib${EXEEXT} ${srcdir}/test-distrib.c
312 ./test-distrib ${srcdir}/testfile
313
314../lib/libgnu.a: $(config_h)
315 cd ../lib && $(MAKE) libgnu.a
316
317regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h)
318 ${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
319 ${srcdir}/../src/regex.c
320
321etags${EXEEXT}: ${srcdir}/etags.c regex.o $(NTLIB) $(config_h)
322 $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \
323 -DVERSION="\"${version}\"" ${srcdir}/etags.c \
324 regex.o $(LOADLIBES) $(NTLIB) -o etags${EXEEXT}
325
326ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \
327 $(config_h)
328 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
329 ${srcdir}/ebrowse.c $(LOADLIBES) $(NTLIB) -o ebrowse${EXEEXT}
330
331## We depend on etags to assure that parallel makes do not write two
332## etags.o files on top of each other.
333ctags${EXEEXT}: etags${EXEEXT}
334 $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \
335 -DVERSION="\"${version}\"" ${srcdir}/etags.c \
336 regex.o $(LOADLIBES) $(NTLIB) -o ctags${EXEEXT}
337
338profile${EXEEXT}: ${srcdir}/profile.c $(NTLIB) $(config_h)
339 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \
340 $(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o profile${EXEEXT}
341
342make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h)
343 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) $(NTLIB) \
344 -o make-docfile${EXEEXT}
345
346movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB) $(config_h)
347 $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \
348 $(LOADLIBES) $(NTLIB) $(LIBS_MOVE) -o movemail${EXEEXT}
349
350pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h)
351 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
352
353emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h)
354 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \
355 -DVERSION="\"${version}\"" $(NTLIB) $(LOADLIBES) $(LIB_FDATASYNC) \
356 $(LIB_WSOCK32) $(LIBS_ECLIENT) -o emacsclient${EXEEXT}
357
358emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h)
359 $(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows ${srcdir}/emacsclient.c \
360 -DVERSION="\"${version}\"" $(LOADLIBES) $(LIB_FDATASYNC) \
361 $(LIB_WSOCK32) $(LIBS_ECLIENT) -o emacsclientw${EXEEXT}
362
363NTINC = ${srcdir}/../nt/inc
364NTDEPS = $(NTINC)/ms-w32.h $(NTINC)/sys/stat.h $(NTINC)/inttypes.h \
365 $(NTINC)/stdint.h $(NTINC)/pwd.h $(NTINC)/sys/time.h $(NTINC)/stdbool.h \
366 $(NTINC)/sys/wait.h $(NTINC)/unistd.h $(NTINC)/sys/file.h $(NTINC)/netdb.h
367
368# The dependency on $(NTDEPS) is a trick intended to cause recompile of
369# programs on MinGW whenever some private header in nt/inc is modified.
370ntlib.o: ${srcdir}/ntlib.c ${srcdir}/ntlib.h $(NTDEPS)
371 $(CC) -c ${CPP_CFLAGS} ${srcdir}/ntlib.c
372
373hexl${EXEEXT}: ${srcdir}/hexl.c $(NTLIB) $(config_h)
374 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl${EXEEXT}
375
376update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h)
377 $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
378 ${srcdir}/update-game-score.c $(LOADLIBES) $(NTLIB) \
379 -o update-game-score${EXEEXT}
380
381emacsclient.res: $(NTINC)/../emacsclient.rc
382 $(WINDRES) -O coff --include-dir=$(NTINC)/.. -o emacsclient.res \
383 $(NTINC)/../emacsclient.rc
384
385## Makefile ends here.