Merge from mh-e; up to 2012-01-03T19:41:14Z!larsi@gnus.org.
[bpt/emacs.git] / nt / Makefile.in
CommitLineData
bbece175 1### @configure_input@
095bf253 2
ba318903 3# Copyright (C) 2013-2014 Free Software Foundation, Inc.
095bf253
EZ
4
5# This file is part of GNU Emacs.
6
7# GNU Emacs is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11
12# GNU Emacs is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16
17# You should have received a copy of the GNU General Public License
18# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
19
20# Avoid trouble on systems where the `SHELL' variable might be
21# inherited from the environment.
22SHELL = /bin/sh
23
24# ==================== Things `configure' will edit ====================
25
26CC=@CC@
27CFLAGS=@CFLAGS@
28version=@version@
29## Used in $archlibdir.
30configuration=@configuration@
31EXEEXT=@EXEEXT@
32C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
33C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
34PROFILING_CFLAGS = @PROFILING_CFLAGS@
35WARN_CFLAGS = @WARN_CFLAGS@
36WERROR_CFLAGS = @WERROR_CFLAGS@
37
38# Program name transformation.
39TRANSFORM = @program_transform_name@
40
41# ==================== Where To Install Things ====================
42
43# The default location for installation. Everything is placed in
44# subdirectories of this directory. The default values for many of
45# the variables below are expressed in terms of this one, so you may
46# not need to change them. This is set with the --prefix option to
47# `../configure'.
48prefix=@prefix@
49
50# Like `prefix', but used for architecture-specific files. This is
51# set with the --exec-prefix option to `../configure'.
52exec_prefix=@exec_prefix@
53
54# Where to install Emacs and other binaries that people will want to
55# run directly (like etags). This is set with the --bindir option
56# to `../configure'.
57bindir=@bindir@
58
1a4c95f6
JB
59# The root of the directory tree for read-only architecture-independent
60# data files. ${datadir}, ${infodir} and ${mandir} are based on this.
61datarootdir=@datarootdir@
62
63# Where to install architecture-independent data files. ${lispdir}
64# and ${etcdir} are subdirectories of this. This is set with the
65# --datadir option to `../configure'.
66datadir=@datadir@
67
095bf253
EZ
68# Where to install and expect executable files to be run by Emacs
69# rather than directly by users, and other architecture-dependent
70# data. ${archlibdir} is usually below this. This is set with the
71# --libexecdir option to `../configure'.
72libexecdir=@libexecdir@
73
74# Directory for local state files for all programs.
75localstatedir=@localstatedir@
76
77# Where to find the source code. This is set by the configure
78# script's `--srcdir' option. However, the value of ${srcdir} in
79# this makefile is not identical to what was specified with --srcdir,
80# since the variable here has `/lib-src' added at the end.
81
82# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
83srcdir=@srcdir@
84VPATH=@srcdir@
85
86# The top-level source directory, also set by configure.
87top_srcdir=@top_srcdir@
11e5e2eb
GM
88# MinGW CPPFLAGS may use this.
89abs_top_srcdir=@abs_top_srcdir@
095bf253
EZ
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
103# ==================== Utility Programs for the Build =================
104
105# ../configure figures out the correct values for these.
106INSTALL = @INSTALL@
1a4c95f6 107INSTALL_DATA = @INSTALL_DATA@
095bf253
EZ
108INSTALL_PROGRAM = @INSTALL_PROGRAM@
109INSTALL_SCRIPT = @INSTALL_SCRIPT@
110# By default, we uphold the dignity of our programs.
111INSTALL_STRIP =
112MKDIR_P = @MKDIR_P@
113
114# ========================== Lists of Files ===========================
115
116# Things that a user might actually run, which should be installed in bindir.
117INSTALLABLES = runemacs${EXEEXT} addpm${EXEEXT}
118
119# Things that Emacs runs internally, which should not be installed in bindir.
120UTILITIES = cmdproxy${EXEEXT} ddeclient${EXEEXT}
121
122# Things that Emacs runs during the build process.
123DONT_INSTALL = addsection${EXEEXT}
124
125# All files that are created by the linker, i.e., whose names end in ${EXEEXT}.
126EXE_FILES = ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
127
128# =========================== Configuration ===========================
129
130# MS-Windows resource files and resource compiler
131EMACSRES = @EMACSRES@
132EMACS_MANIFEST = @EMACS_MANIFEST@
133WINDRES = @WINDRES@
134
135## Extra libraries to use when linking addpm.
136LIBS_ADDPM = -lole32 -luuid
137
138## Compilation and linking flags
139BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \
140 $(WARN_CFLAGS) $(WERROR_CFLAGS) \
141 -I. -I${srcdir}
142
143ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
144LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
145CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
146
147all: ${EXE_FILES}
148
149.PHONY: all
150
151## Install the internal utilities. Until they are installed, we can
152## just run them directly from nt/.
153$(DESTDIR)${archlibdir}: all
154 @echo
155 @echo "Installing utilities run internally by Emacs."
48f73cfb 156 umask 022; ${MKDIR_P} "$(DESTDIR)${archlibdir}"
357a5081
GM
157 exp_archlibdir=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd`; \
158 if [ "$$exp_archlibdir" != "`/bin/pwd`" ]; then \
095bf253 159 for file in ${UTILITIES}; do \
48f73cfb 160 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file "$(DESTDIR)${archlibdir}/$$file" ; \
095bf253
EZ
161 done ; \
162 fi
163
164.PHONY: install uninstall mostlyclean clean distclean maintainer-clean
165.PHONY: extraclean check tags
166
167install: $(DESTDIR)${archlibdir}
168 @echo
169 @echo "Installing utilities for users to run."
48f73cfb 170 umask 022; ${MKDIR_P} "$(DESTDIR)${bindir}"
095bf253 171 for file in ${INSTALLABLES} ; do \
48f73cfb 172 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} "$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
095bf253 173 done
1bba94f2 174 ${MKDIR_P} "$(DESTDIR)${datadir}/emacs/$(version)"
f2601628 175 $(INSTALL_DATA) ${srcdir}/README.W32 "$(DESTDIR)${datadir}/emacs/$(version)"
095bf253
EZ
176
177uninstall:
1a4c95f6 178 rm -f "$(DESTDIR)${datadir}/emacs/$(version)/README.W32"
095bf253 179 for file in ${INSTALLABLES}; do \
48f73cfb 180 rm -f "$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
095bf253 181 done
48f73cfb
GM
182 if [ -d "$(DESTDIR)${archlibdir}" ]; then \
183 (cd "$(DESTDIR)${archlibdir}" && rm -f ${UTILITIES}) \
095bf253
EZ
184 fi
185
186mostlyclean:
38b787fa 187 -rm -f core *.o *.res
095bf253
EZ
188
189clean: mostlyclean
190 -rm -f ${EXE_FILES}
191
192distclean: clean
193 -rm -f TAGS
194 -rm -f Makefile
195
196maintainer-clean: distclean
197 true
198
199extraclean: maintainer-clean
200 -rm -f *~ \#*
201
202## Test the contents of the directory.
203check:
204 @echo "We don't have any tests for the nt/ directory yet."
205
206tags: TAGS
207TAGS: ${EXE_FILES:${EXEEXT}=.c}
208 ../lib-src/etags *.[ch]
209
210## Build the programs
211addsection${EXEEXT}: ${srcdir}/addsection.c
212 $(CC) ${ALL_CFLAGS} ${srcdir}/addsection.c -o addsection${EXEEXT}
213
373b3ea6 214addpm${EXEEXT}: ${srcdir}/addpm.c ../src/epaths.h
095bf253
EZ
215 $(CC) ${ALL_CFLAGS} ${srcdir}/addpm.c $(LIBS_ADDPM) -o addpm${EXEEXT}
216
217ddeclient${EXEEXT}: ${srcdir}/ddeclient.c
218 $(CC) ${ALL_CFLAGS} ${srcdir}/ddeclient.c -o ddeclient${EXEEXT}
219
030a1c5e 220cmdproxy${EXEEXT}: ${srcdir}/cmdproxy.c
095bf253
EZ
221 $(CC) ${ALL_CFLAGS} ${srcdir}/cmdproxy.c -o cmdproxy${EXEEXT}
222
030a1c5e 223runemacs${EXEEXT}: ${srcdir}/runemacs.c $(EMACSRES)
b0c63616 224 $(CC) ${ALL_CFLAGS} ${srcdir}/runemacs.c $(EMACSRES) -mwindows \
095bf253
EZ
225 -o runemacs${EXEEXT}
226
030a1c5e 227emacs.res: ${srcdir}/emacs.rc ${srcdir}/icons/emacs.ico ${srcdir}/$(EMACS_MANIFEST)
38b787fa 228 ${WINDRES} -I ${srcdir} -O coff -o emacs.res ${srcdir}/emacs.rc