Commit | Line | Data |
---|---|---|
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. | |
22 | SHELL = /bin/sh | |
23 | ||
24 | # ==================== Things `configure' will edit ==================== | |
25 | ||
26 | CC=@CC@ | |
27 | CFLAGS=@CFLAGS@ | |
b24ffa81 GM |
28 | CPPFLAGS = @CPPFLAGS@ |
29 | LDFLAGS = @LDFLAGS@ | |
30 | ||
095bf253 EZ |
31 | version=@version@ |
32 | ## Used in $archlibdir. | |
33 | configuration=@configuration@ | |
34 | EXEEXT=@EXEEXT@ | |
35 | C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ | |
36 | C_SWITCH_MACHINE=@C_SWITCH_MACHINE@ | |
37 | PROFILING_CFLAGS = @PROFILING_CFLAGS@ | |
38 | WARN_CFLAGS = @WARN_CFLAGS@ | |
39 | WERROR_CFLAGS = @WERROR_CFLAGS@ | |
40 | ||
41 | # Program name transformation. | |
42 | TRANSFORM = @program_transform_name@ | |
43 | ||
44 | # ==================== Where To Install Things ==================== | |
45 | ||
46 | # The default location for installation. Everything is placed in | |
47 | # subdirectories of this directory. The default values for many of | |
48 | # the variables below are expressed in terms of this one, so you may | |
49 | # not need to change them. This is set with the --prefix option to | |
50 | # `../configure'. | |
51 | prefix=@prefix@ | |
52 | ||
53 | # Like `prefix', but used for architecture-specific files. This is | |
54 | # set with the --exec-prefix option to `../configure'. | |
55 | exec_prefix=@exec_prefix@ | |
56 | ||
57 | # Where to install Emacs and other binaries that people will want to | |
58 | # run directly (like etags). This is set with the --bindir option | |
59 | # to `../configure'. | |
60 | bindir=@bindir@ | |
61 | ||
1a4c95f6 JB |
62 | # The root of the directory tree for read-only architecture-independent |
63 | # data files. ${datadir}, ${infodir} and ${mandir} are based on this. | |
64 | datarootdir=@datarootdir@ | |
65 | ||
66 | # Where to install architecture-independent data files. ${lispdir} | |
67 | # and ${etcdir} are subdirectories of this. This is set with the | |
68 | # --datadir option to `../configure'. | |
69 | datadir=@datadir@ | |
70 | ||
095bf253 EZ |
71 | # Where to install and expect executable files to be run by Emacs |
72 | # rather than directly by users, and other architecture-dependent | |
73 | # data. ${archlibdir} is usually below this. This is set with the | |
74 | # --libexecdir option to `../configure'. | |
75 | libexecdir=@libexecdir@ | |
76 | ||
77 | # Directory for local state files for all programs. | |
78 | localstatedir=@localstatedir@ | |
79 | ||
80 | # Where to find the source code. This is set by the configure | |
81 | # script's `--srcdir' option. However, the value of ${srcdir} in | |
82 | # this makefile is not identical to what was specified with --srcdir, | |
83 | # since the variable here has `/lib-src' added at the end. | |
84 | ||
85 | # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH. | |
86 | srcdir=@srcdir@ | |
87 | VPATH=@srcdir@ | |
88 | ||
89 | # The top-level source directory, also set by configure. | |
90 | top_srcdir=@top_srcdir@ | |
11e5e2eb GM |
91 | # MinGW CPPFLAGS may use this. |
92 | abs_top_srcdir=@abs_top_srcdir@ | |
095bf253 EZ |
93 | |
94 | # ==================== Emacs-specific directories ==================== | |
95 | ||
96 | # These variables hold the values Emacs will actually use. They are | |
97 | # based on the values of the standard Make variables above. | |
98 | ||
99 | # Where to put executables to be run by Emacs rather than the user. | |
100 | # This path usually includes the Emacs version and configuration name, | |
101 | # so that multiple configurations for multiple versions of Emacs may | |
102 | # be installed at once. This can be set with the --archlibdir option | |
103 | # to `../configure'. | |
104 | archlibdir=@archlibdir@ | |
105 | ||
106 | # ==================== Utility Programs for the Build ================= | |
107 | ||
108 | # ../configure figures out the correct values for these. | |
109 | INSTALL = @INSTALL@ | |
1a4c95f6 | 110 | INSTALL_DATA = @INSTALL_DATA@ |
095bf253 EZ |
111 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
112 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | |
113 | # By default, we uphold the dignity of our programs. | |
114 | INSTALL_STRIP = | |
115 | MKDIR_P = @MKDIR_P@ | |
116 | ||
117 | # ========================== Lists of Files =========================== | |
118 | ||
119 | # Things that a user might actually run, which should be installed in bindir. | |
120 | INSTALLABLES = runemacs${EXEEXT} addpm${EXEEXT} | |
121 | ||
122 | # Things that Emacs runs internally, which should not be installed in bindir. | |
123 | UTILITIES = cmdproxy${EXEEXT} ddeclient${EXEEXT} | |
124 | ||
125 | # Things that Emacs runs during the build process. | |
7479dd3e | 126 | DONT_INSTALL = |
095bf253 EZ |
127 | |
128 | # All files that are created by the linker, i.e., whose names end in ${EXEEXT}. | |
129 | EXE_FILES = ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL} | |
130 | ||
131 | # =========================== Configuration =========================== | |
132 | ||
133 | # MS-Windows resource files and resource compiler | |
134 | EMACSRES = @EMACSRES@ | |
135 | EMACS_MANIFEST = @EMACS_MANIFEST@ | |
136 | WINDRES = @WINDRES@ | |
137 | ||
138 | ## Extra libraries to use when linking addpm. | |
139 | LIBS_ADDPM = -lole32 -luuid | |
140 | ||
141 | ## Compilation and linking flags | |
142 | BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \ | |
143 | $(WARN_CFLAGS) $(WERROR_CFLAGS) \ | |
144 | -I. -I${srcdir} | |
145 | ||
b24ffa81 | 146 | ## FIXME? What is LDFLAGS doing here? |
095bf253 EZ |
147 | ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS} |
148 | LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS} | |
149 | CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS} | |
150 | ||
151 | all: ${EXE_FILES} | |
152 | ||
153 | .PHONY: all | |
154 | ||
155 | ## Install the internal utilities. Until they are installed, we can | |
156 | ## just run them directly from nt/. | |
157 | $(DESTDIR)${archlibdir}: all | |
158 | @echo | |
159 | @echo "Installing utilities run internally by Emacs." | |
48f73cfb | 160 | umask 022; ${MKDIR_P} "$(DESTDIR)${archlibdir}" |
357a5081 GM |
161 | exp_archlibdir=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd`; \ |
162 | if [ "$$exp_archlibdir" != "`/bin/pwd`" ]; then \ | |
095bf253 | 163 | for file in ${UTILITIES}; do \ |
48f73cfb | 164 | $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file "$(DESTDIR)${archlibdir}/$$file" ; \ |
095bf253 EZ |
165 | done ; \ |
166 | fi | |
167 | ||
168 | .PHONY: install uninstall mostlyclean clean distclean maintainer-clean | |
0e6929ec | 169 | .PHONY: bootstrap-clean extraclean check tags |
095bf253 EZ |
170 | |
171 | install: $(DESTDIR)${archlibdir} | |
172 | @echo | |
173 | @echo "Installing utilities for users to run." | |
48f73cfb | 174 | umask 022; ${MKDIR_P} "$(DESTDIR)${bindir}" |
095bf253 | 175 | for file in ${INSTALLABLES} ; do \ |
48f73cfb | 176 | $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} "$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \ |
095bf253 | 177 | done |
1bba94f2 | 178 | ${MKDIR_P} "$(DESTDIR)${datadir}/emacs/$(version)" |
f2601628 | 179 | $(INSTALL_DATA) ${srcdir}/README.W32 "$(DESTDIR)${datadir}/emacs/$(version)" |
095bf253 EZ |
180 | |
181 | uninstall: | |
1a4c95f6 | 182 | rm -f "$(DESTDIR)${datadir}/emacs/$(version)/README.W32" |
095bf253 | 183 | for file in ${INSTALLABLES}; do \ |
48f73cfb | 184 | rm -f "$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \ |
095bf253 | 185 | done |
48f73cfb GM |
186 | if [ -d "$(DESTDIR)${archlibdir}" ]; then \ |
187 | (cd "$(DESTDIR)${archlibdir}" && rm -f ${UTILITIES}) \ | |
095bf253 EZ |
188 | fi |
189 | ||
190 | mostlyclean: | |
38b787fa | 191 | -rm -f core *.o *.res |
095bf253 EZ |
192 | |
193 | clean: mostlyclean | |
194 | -rm -f ${EXE_FILES} | |
195 | ||
196 | distclean: clean | |
197 | -rm -f TAGS | |
198 | -rm -f Makefile | |
199 | ||
0e6929ec | 200 | bootstrap-clean maintainer-clean: distclean |
095bf253 EZ |
201 | true |
202 | ||
203 | extraclean: maintainer-clean | |
204 | -rm -f *~ \#* | |
205 | ||
206 | ## Test the contents of the directory. | |
207 | check: | |
208 | @echo "We don't have any tests for the nt/ directory yet." | |
209 | ||
210 | tags: TAGS | |
211 | TAGS: ${EXE_FILES:${EXEEXT}=.c} | |
212 | ../lib-src/etags *.[ch] | |
213 | ||
214 | ## Build the programs | |
373b3ea6 | 215 | addpm${EXEEXT}: ${srcdir}/addpm.c ../src/epaths.h |
095bf253 EZ |
216 | $(CC) ${ALL_CFLAGS} ${srcdir}/addpm.c $(LIBS_ADDPM) -o addpm${EXEEXT} |
217 | ||
218 | ddeclient${EXEEXT}: ${srcdir}/ddeclient.c | |
219 | $(CC) ${ALL_CFLAGS} ${srcdir}/ddeclient.c -o ddeclient${EXEEXT} | |
220 | ||
030a1c5e | 221 | cmdproxy${EXEEXT}: ${srcdir}/cmdproxy.c |
095bf253 EZ |
222 | $(CC) ${ALL_CFLAGS} ${srcdir}/cmdproxy.c -o cmdproxy${EXEEXT} |
223 | ||
030a1c5e | 224 | runemacs${EXEEXT}: ${srcdir}/runemacs.c $(EMACSRES) |
b0c63616 | 225 | $(CC) ${ALL_CFLAGS} ${srcdir}/runemacs.c $(EMACSRES) -mwindows \ |
095bf253 EZ |
226 | -o runemacs${EXEEXT} |
227 | ||
030a1c5e | 228 | emacs.res: ${srcdir}/emacs.rc ${srcdir}/icons/emacs.ico ${srcdir}/$(EMACS_MANIFEST) |
38b787fa | 229 | ${WINDRES} -I ${srcdir} -O coff -o emacs.res ${srcdir}/emacs.rc |