Fix a bug in nt/Makefile.in with out-of-tree builds, reported by Dani Moncayo.
[bpt/emacs.git] / nt / Makefile.in
CommitLineData
095bf253
EZ
1# nt/Makefile for GNU Emacs.
2
3# Copyright (C) 2013 Free Software Foundation, Inc.
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
59# Where to install and expect executable files to be run by Emacs
60# rather than directly by users, and other architecture-dependent
61# data. ${archlibdir} is usually below this. This is set with the
62# --libexecdir option to `../configure'.
63libexecdir=@libexecdir@
64
65# Directory for local state files for all programs.
66localstatedir=@localstatedir@
67
68# Where to find the source code. This is set by the configure
69# script's `--srcdir' option. However, the value of ${srcdir} in
70# this makefile is not identical to what was specified with --srcdir,
71# since the variable here has `/lib-src' added at the end.
72
73# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
74srcdir=@srcdir@
75VPATH=@srcdir@
76
77# The top-level source directory, also set by configure.
78top_srcdir=@top_srcdir@
79
80# ==================== Emacs-specific directories ====================
81
82# These variables hold the values Emacs will actually use. They are
83# based on the values of the standard Make variables above.
84
85# Where to put executables to be run by Emacs rather than the user.
86# This path usually includes the Emacs version and configuration name,
87# so that multiple configurations for multiple versions of Emacs may
88# be installed at once. This can be set with the --archlibdir option
89# to `../configure'.
90archlibdir=@archlibdir@
91
92# ==================== Utility Programs for the Build =================
93
94# ../configure figures out the correct values for these.
95INSTALL = @INSTALL@
96INSTALL_PROGRAM = @INSTALL_PROGRAM@
97INSTALL_SCRIPT = @INSTALL_SCRIPT@
98# By default, we uphold the dignity of our programs.
99INSTALL_STRIP =
100MKDIR_P = @MKDIR_P@
101
102# ========================== Lists of Files ===========================
103
104# Things that a user might actually run, which should be installed in bindir.
105INSTALLABLES = runemacs${EXEEXT} addpm${EXEEXT}
106
107# Things that Emacs runs internally, which should not be installed in bindir.
108UTILITIES = cmdproxy${EXEEXT} ddeclient${EXEEXT}
109
110# Things that Emacs runs during the build process.
111DONT_INSTALL = addsection${EXEEXT}
112
113# All files that are created by the linker, i.e., whose names end in ${EXEEXT}.
114EXE_FILES = ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
115
116# =========================== Configuration ===========================
117
118# MS-Windows resource files and resource compiler
119EMACSRES = @EMACSRES@
120EMACS_MANIFEST = @EMACS_MANIFEST@
121WINDRES = @WINDRES@
122
123## Extra libraries to use when linking addpm.
124LIBS_ADDPM = -lole32 -luuid
125
126## Compilation and linking flags
127BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \
128 $(WARN_CFLAGS) $(WERROR_CFLAGS) \
129 -I. -I${srcdir}
130
131ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
132LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
133CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}
134
135all: ${EXE_FILES}
136
137.PHONY: all
138
139## Install the internal utilities. Until they are installed, we can
140## just run them directly from nt/.
141$(DESTDIR)${archlibdir}: all
142 @echo
143 @echo "Installing utilities run internally by Emacs."
144 umask 022; ${MKDIR_P} $(DESTDIR)${archlibdir}
145 if [ `cd $(DESTDIR)${archlibdir} && /bin/pwd` != `/bin/pwd` ]; then \
146 for file in ${UTILITIES}; do \
147 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file $(DESTDIR)${archlibdir}/$$file ; \
148 done ; \
149 fi
150
151.PHONY: install uninstall mostlyclean clean distclean maintainer-clean
152.PHONY: extraclean check tags
153
154install: $(DESTDIR)${archlibdir}
155 @echo
156 @echo "Installing utilities for users to run."
157 umask 022; ${MKDIR_P} $(DESTDIR)${bindir}
158 for file in ${INSTALLABLES} ; do \
159 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} $(DESTDIR)${bindir}/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
160 done
161
162uninstall:
163 for file in ${INSTALLABLES}; do \
164 rm -f $(DESTDIR)${bindir}/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
165 done
166 if [ -d $(DESTDIR)${archlibdir} ]; then \
167 (cd $(DESTDIR)${archlibdir} && rm -f ${UTILITIES}) \
168 fi
169
170mostlyclean:
171 -rm -f core *.o
172
173clean: mostlyclean
174 -rm -f ${EXE_FILES}
175
176distclean: clean
177 -rm -f TAGS
178 -rm -f Makefile
179
180maintainer-clean: distclean
181 true
182
183extraclean: maintainer-clean
184 -rm -f *~ \#*
185
186## Test the contents of the directory.
187check:
188 @echo "We don't have any tests for the nt/ directory yet."
189
190tags: TAGS
191TAGS: ${EXE_FILES:${EXEEXT}=.c}
192 ../lib-src/etags *.[ch]
193
194## Build the programs
195addsection${EXEEXT}: ${srcdir}/addsection.c
196 $(CC) ${ALL_CFLAGS} ${srcdir}/addsection.c -o addsection${EXEEXT}
197
7d9fb4de 198addpm${EXEEXT}: ${srcdir}/addpm.c ${srcdir}/../src/epaths.h
095bf253
EZ
199 $(CC) ${ALL_CFLAGS} ${srcdir}/addpm.c $(LIBS_ADDPM) -o addpm${EXEEXT}
200
201ddeclient${EXEEXT}: ${srcdir}/ddeclient.c
202 $(CC) ${ALL_CFLAGS} ${srcdir}/ddeclient.c -o ddeclient${EXEEXT}
203
030a1c5e 204cmdproxy${EXEEXT}: ${srcdir}/cmdproxy.c
095bf253
EZ
205 $(CC) ${ALL_CFLAGS} ${srcdir}/cmdproxy.c -o cmdproxy${EXEEXT}
206
030a1c5e 207runemacs${EXEEXT}: ${srcdir}/runemacs.c $(EMACSRES)
095bf253
EZ
208 $(CC) ${ALL_CFLAGS} ${srcdir}/runemacs.c $(EMACSRES) \
209 -o runemacs${EXEEXT}
210
030a1c5e 211emacs.res: ${srcdir}/emacs.rc ${srcdir}/icons/emacs.ico ${srcdir}/$(EMACS_MANIFEST)
106e9911 212 ${WINDRES} -O coff -o emacs.res ${srcdir}/emacs.rc