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@ | |
28 | version=@version@ | |
29 | ## Used in $archlibdir. | |
30 | configuration=@configuration@ | |
31 | EXEEXT=@EXEEXT@ | |
32 | C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ | |
33 | C_SWITCH_MACHINE=@C_SWITCH_MACHINE@ | |
34 | PROFILING_CFLAGS = @PROFILING_CFLAGS@ | |
35 | WARN_CFLAGS = @WARN_CFLAGS@ | |
36 | WERROR_CFLAGS = @WERROR_CFLAGS@ | |
37 | ||
38 | # Program name transformation. | |
39 | TRANSFORM = @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'. | |
48 | prefix=@prefix@ | |
49 | ||
50 | # Like `prefix', but used for architecture-specific files. This is | |
51 | # set with the --exec-prefix option to `../configure'. | |
52 | exec_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'. | |
57 | bindir=@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'. | |
63 | libexecdir=@libexecdir@ | |
64 | ||
65 | # Directory for local state files for all programs. | |
66 | localstatedir=@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. | |
74 | srcdir=@srcdir@ | |
75 | VPATH=@srcdir@ | |
76 | ||
77 | # The top-level source directory, also set by configure. | |
78 | top_srcdir=@top_srcdir@ | |
11e5e2eb GM |
79 | # MinGW CPPFLAGS may use this. |
80 | abs_top_srcdir=@abs_top_srcdir@ | |
095bf253 EZ |
81 | |
82 | # ==================== Emacs-specific directories ==================== | |
83 | ||
84 | # These variables hold the values Emacs will actually use. They are | |
85 | # based on the values of the standard Make variables above. | |
86 | ||
87 | # Where to put executables to be run by Emacs rather than the user. | |
88 | # This path usually includes the Emacs version and configuration name, | |
89 | # so that multiple configurations for multiple versions of Emacs may | |
90 | # be installed at once. This can be set with the --archlibdir option | |
91 | # to `../configure'. | |
92 | archlibdir=@archlibdir@ | |
93 | ||
94 | # ==================== Utility Programs for the Build ================= | |
95 | ||
96 | # ../configure figures out the correct values for these. | |
97 | INSTALL = @INSTALL@ | |
98 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
99 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | |
100 | # By default, we uphold the dignity of our programs. | |
101 | INSTALL_STRIP = | |
102 | MKDIR_P = @MKDIR_P@ | |
103 | ||
104 | # ========================== Lists of Files =========================== | |
105 | ||
106 | # Things that a user might actually run, which should be installed in bindir. | |
107 | INSTALLABLES = runemacs${EXEEXT} addpm${EXEEXT} | |
108 | ||
109 | # Things that Emacs runs internally, which should not be installed in bindir. | |
110 | UTILITIES = cmdproxy${EXEEXT} ddeclient${EXEEXT} | |
111 | ||
112 | # Things that Emacs runs during the build process. | |
113 | DONT_INSTALL = addsection${EXEEXT} | |
114 | ||
115 | # All files that are created by the linker, i.e., whose names end in ${EXEEXT}. | |
116 | EXE_FILES = ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL} | |
117 | ||
118 | # =========================== Configuration =========================== | |
119 | ||
120 | # MS-Windows resource files and resource compiler | |
121 | EMACSRES = @EMACSRES@ | |
122 | EMACS_MANIFEST = @EMACS_MANIFEST@ | |
123 | WINDRES = @WINDRES@ | |
124 | ||
125 | ## Extra libraries to use when linking addpm. | |
126 | LIBS_ADDPM = -lole32 -luuid | |
127 | ||
128 | ## Compilation and linking flags | |
129 | BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \ | |
130 | $(WARN_CFLAGS) $(WERROR_CFLAGS) \ | |
131 | -I. -I${srcdir} | |
132 | ||
133 | ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS} | |
134 | LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS} | |
135 | CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS} | |
136 | ||
137 | all: ${EXE_FILES} | |
138 | ||
139 | .PHONY: all | |
140 | ||
141 | ## Install the internal utilities. Until they are installed, we can | |
142 | ## just run them directly from nt/. | |
143 | $(DESTDIR)${archlibdir}: all | |
144 | @echo | |
145 | @echo "Installing utilities run internally by Emacs." | |
48f73cfb | 146 | umask 022; ${MKDIR_P} "$(DESTDIR)${archlibdir}" |
357a5081 GM |
147 | exp_archlibdir=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd`; \ |
148 | if [ "$$exp_archlibdir" != "`/bin/pwd`" ]; then \ | |
095bf253 | 149 | for file in ${UTILITIES}; do \ |
48f73cfb | 150 | $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file "$(DESTDIR)${archlibdir}/$$file" ; \ |
095bf253 EZ |
151 | done ; \ |
152 | fi | |
153 | ||
154 | .PHONY: install uninstall mostlyclean clean distclean maintainer-clean | |
155 | .PHONY: extraclean check tags | |
156 | ||
157 | install: $(DESTDIR)${archlibdir} | |
158 | @echo | |
159 | @echo "Installing utilities for users to run." | |
48f73cfb | 160 | umask 022; ${MKDIR_P} "$(DESTDIR)${bindir}" |
095bf253 | 161 | for file in ${INSTALLABLES} ; do \ |
48f73cfb | 162 | $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} "$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \ |
095bf253 EZ |
163 | done |
164 | ||
165 | uninstall: | |
166 | for file in ${INSTALLABLES}; do \ | |
48f73cfb | 167 | rm -f "$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \ |
095bf253 | 168 | done |
48f73cfb GM |
169 | if [ -d "$(DESTDIR)${archlibdir}" ]; then \ |
170 | (cd "$(DESTDIR)${archlibdir}" && rm -f ${UTILITIES}) \ | |
095bf253 EZ |
171 | fi |
172 | ||
173 | mostlyclean: | |
38b787fa | 174 | -rm -f core *.o *.res |
095bf253 EZ |
175 | |
176 | clean: mostlyclean | |
177 | -rm -f ${EXE_FILES} | |
178 | ||
179 | distclean: clean | |
180 | -rm -f TAGS | |
181 | -rm -f Makefile | |
182 | ||
183 | maintainer-clean: distclean | |
184 | true | |
185 | ||
186 | extraclean: maintainer-clean | |
187 | -rm -f *~ \#* | |
188 | ||
189 | ## Test the contents of the directory. | |
190 | check: | |
191 | @echo "We don't have any tests for the nt/ directory yet." | |
192 | ||
193 | tags: TAGS | |
194 | TAGS: ${EXE_FILES:${EXEEXT}=.c} | |
195 | ../lib-src/etags *.[ch] | |
196 | ||
197 | ## Build the programs | |
198 | addsection${EXEEXT}: ${srcdir}/addsection.c | |
199 | $(CC) ${ALL_CFLAGS} ${srcdir}/addsection.c -o addsection${EXEEXT} | |
200 | ||
373b3ea6 | 201 | addpm${EXEEXT}: ${srcdir}/addpm.c ../src/epaths.h |
095bf253 EZ |
202 | $(CC) ${ALL_CFLAGS} ${srcdir}/addpm.c $(LIBS_ADDPM) -o addpm${EXEEXT} |
203 | ||
204 | ddeclient${EXEEXT}: ${srcdir}/ddeclient.c | |
205 | $(CC) ${ALL_CFLAGS} ${srcdir}/ddeclient.c -o ddeclient${EXEEXT} | |
206 | ||
030a1c5e | 207 | cmdproxy${EXEEXT}: ${srcdir}/cmdproxy.c |
095bf253 EZ |
208 | $(CC) ${ALL_CFLAGS} ${srcdir}/cmdproxy.c -o cmdproxy${EXEEXT} |
209 | ||
030a1c5e | 210 | runemacs${EXEEXT}: ${srcdir}/runemacs.c $(EMACSRES) |
b0c63616 | 211 | $(CC) ${ALL_CFLAGS} ${srcdir}/runemacs.c $(EMACSRES) -mwindows \ |
095bf253 EZ |
212 | -o runemacs${EXEEXT} |
213 | ||
030a1c5e | 214 | emacs.res: ${srcdir}/emacs.rc ${srcdir}/icons/emacs.ico ${srcdir}/$(EMACS_MANIFEST) |
38b787fa | 215 | ${WINDRES} -I ${srcdir} -O coff -o emacs.res ${srcdir}/emacs.rc |