Makefile.in 7.96 KB
Newer Older
1
### @configure_input@
2

Paul Eggert's avatar
Paul Eggert committed
3
# Copyright (C) 2013-2015 Free Software Foundation, Inc.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

# This file is part of GNU Emacs.

# GNU Emacs is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# GNU Emacs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.

# Avoid trouble on systems where the `SHELL' variable might be
# inherited from the environment.
SHELL = /bin/sh

# ==================== Things `configure' will edit ====================

CC=@CC@
CFLAGS=@CFLAGS@
28 29 30
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@

31 32 33 34 35 36 37 38 39 40 41 42 43
version=@version@
## Used in $archlibdir.
configuration=@configuration@
EXEEXT=@EXEEXT@
C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
PROFILING_CFLAGS = @PROFILING_CFLAGS@
WARN_CFLAGS = @WARN_CFLAGS@
WERROR_CFLAGS = @WERROR_CFLAGS@

# Program name transformation.
TRANSFORM = @program_transform_name@

44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
# 'make' verbosity.
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@

AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo "  CC      " $@;
am__v_CC_1 =

AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo "  CCLD    " $@;
am__v_CCLD_1 =

AM_V_RC = $(am__v_RC_@AM_V@)
am__v_RC_ = $(am__v_RC_@AM_DEFAULT_V@)
am__v_RC_0 = @echo "  RC      " $@;
am__v_RC_1 =

62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
# ==================== Where To Install Things ====================

# The default location for installation.  Everything is placed in
# subdirectories of this directory.  The default values for many of
# the variables below are expressed in terms of this one, so you may
# not need to change them.  This is set with the --prefix option to
# `../configure'.
prefix=@prefix@

# Like `prefix', but used for architecture-specific files.  This is
# set with the --exec-prefix option to `../configure'.
exec_prefix=@exec_prefix@

# Where to install Emacs and other binaries that people will want to
# run directly (like etags).  This is set with the --bindir option
# to `../configure'.
bindir=@bindir@

80 81 82 83 84 85 86 87 88
# The root of the directory tree for read-only architecture-independent
# data files.  ${datadir}, ${infodir} and ${mandir} are based on this.
datarootdir=@datarootdir@

# Where to install architecture-independent data files.  ${lispdir}
# and ${etcdir} are subdirectories of this.  This is set with the
# --datadir option to `../configure'.
datadir=@datadir@

89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
# Where to install and expect executable files to be run by Emacs
# rather than directly by users, and other architecture-dependent
# data.  ${archlibdir} is usually below this.  This is set with the
# --libexecdir option to `../configure'.
libexecdir=@libexecdir@

# Directory for local state files for all programs.
localstatedir=@localstatedir@

# Where to find the source code.  This is set by the configure
# script's `--srcdir' option.  However, the value of ${srcdir} in
# this makefile is not identical to what was specified with --srcdir,
# since the variable here has `/lib-src' added at the end.

# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
srcdir=@srcdir@
VPATH=@srcdir@

# The top-level source directory, also set by configure.
top_srcdir=@top_srcdir@
109 110
# MinGW CPPFLAGS may use this.
abs_top_srcdir=@abs_top_srcdir@
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127

# ==================== Emacs-specific directories ====================

# These variables hold the values Emacs will actually use.  They are
# based on the values of the standard Make variables above.

# Where to put executables to be run by Emacs rather than the user.
# This path usually includes the Emacs version and configuration name,
# so that multiple configurations for multiple versions of Emacs may
# be installed at once.  This can be set with the --archlibdir option
# to `../configure'.
archlibdir=@archlibdir@

# ==================== Utility Programs for the Build =================

# ../configure figures out the correct values for these.
INSTALL = @INSTALL@
128
INSTALL_DATA = @INSTALL_DATA@
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
# By default, we uphold the dignity of our programs.
INSTALL_STRIP =
MKDIR_P = @MKDIR_P@

# ========================== Lists of Files ===========================

# Things that a user might actually run, which should be installed in bindir.
INSTALLABLES = runemacs${EXEEXT} addpm${EXEEXT}

# Things that Emacs runs internally, which should not be installed in bindir.
UTILITIES = cmdproxy${EXEEXT} ddeclient${EXEEXT}

# Things that Emacs runs during the build process.
144
DONT_INSTALL =
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164

# All files that are created by the linker, i.e., whose names end in ${EXEEXT}.
EXE_FILES = ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}

# =========================== Configuration ===========================

# MS-Windows resource files and resource compiler
EMACSRES = @EMACSRES@
EMACS_MANIFEST = @EMACS_MANIFEST@
WINDRES = @WINDRES@

## Extra libraries to use when linking addpm.
LIBS_ADDPM = -lole32 -luuid

## Compilation and linking flags
BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) \
	      $(WARN_CFLAGS) $(WERROR_CFLAGS) \
	      -I. -I${srcdir}

ALL_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
Glenn Morris's avatar
Glenn Morris committed
165
## Unused.
166
LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
Glenn Morris's avatar
Glenn Morris committed
167
## Unused.
168 169 170 171 172 173 174 175 176 177 178
CPP_CFLAGS = ${BASE_CFLAGS} ${PROFILING_CFLAGS} ${CPPFLAGS} ${CFLAGS}

all: ${EXE_FILES}

.PHONY: all

## Install the internal utilities.  Until they are installed, we can
## just run them directly from nt/.
$(DESTDIR)${archlibdir}: all
	@echo
	@echo "Installing utilities run internally by Emacs."
179
	umask 022; ${MKDIR_P} "$(DESTDIR)${archlibdir}"
180 181
	exp_archlibdir=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd`; \
	if [ "$$exp_archlibdir" != "`/bin/pwd`" ]; then \
182
	  for file in ${UTILITIES}; do \
183
	    $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file "$(DESTDIR)${archlibdir}/$$file" ; \
184 185 186 187
	  done ; \
        fi

.PHONY: install uninstall mostlyclean clean distclean maintainer-clean
188
.PHONY: bootstrap-clean extraclean check tags
189 190 191 192

install: $(DESTDIR)${archlibdir}
	@echo
	@echo "Installing utilities for users to run."
193
	umask 022; ${MKDIR_P} "$(DESTDIR)${bindir}"
194
	for file in ${INSTALLABLES} ; do \
195
	  $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} "$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
196
	done
197
	${MKDIR_P} "$(DESTDIR)${datadir}/emacs/$(version)"
198
	$(INSTALL_DATA) ${srcdir}/README.W32 "$(DESTDIR)${datadir}/emacs/$(version)"
199 200

uninstall:
201
	rm -f "$(DESTDIR)${datadir}/emacs/$(version)/README.W32"
202
	for file in ${INSTALLABLES}; do \
203
	  rm -f "$(DESTDIR)${bindir}"/`echo $${file} | sed -e 's/${EXEEXT}$$//' -e '$(TRANSFORM)'`${EXEEXT} ; \
204
	done
205 206
	if [ -d "$(DESTDIR)${archlibdir}" ]; then \
	  (cd "$(DESTDIR)${archlibdir}" && rm -f ${UTILITIES}) \
207 208 209
	fi

mostlyclean:
210
	-rm -f core *.o *.res
211 212 213 214 215

clean: mostlyclean
	-rm -f ${EXE_FILES}

distclean: clean
216
	-rm -f TAGS Makefile *.rc
217

218
bootstrap-clean maintainer-clean: distclean
219 220 221 222 223 224 225 226 227 228 229 230 231 232
	true

extraclean: maintainer-clean
	-rm -f *~ \#*

## Test the contents of the directory.
check:
	@echo "We don't have any tests for the nt/ directory yet."

tags: TAGS
TAGS: ${EXE_FILES:${EXEEXT}=.c}
	../lib-src/etags *.[ch]

## Build the programs
233
addpm${EXEEXT}: ${srcdir}/addpm.c ../src/epaths.h
234
	$(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< $(LIBS_ADDPM) -o $@
235 236

ddeclient${EXEEXT}: ${srcdir}/ddeclient.c
237
	$(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< -o $@
238

239
cmdproxy${EXEEXT}: ${srcdir}/cmdproxy.c
240
	$(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< -o $@
241

242
runemacs${EXEEXT}: ${srcdir}/runemacs.c $(EMACSRES)
243
	$(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $^ -mwindows -o $@
244

245 246
## Also used in ../src/Makefile.
emacs.res ../src/emacs.res: emacs.rc ${srcdir}/icons/emacs.ico \
247
  ${srcdir}/icons/hand.cur ${srcdir}/$(EMACS_MANIFEST)
248
	$(AM_V_RC)${WINDRES} -I ${srcdir} -O coff -o $@ $<