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

Paul Eggert's avatar
Paul Eggert committed
3
## Copyright (C) 2012-2020 Free Software Foundation, Inc.
4 5 6 7 8 9 10

## 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.
Sam Steingold's avatar
Sam Steingold committed
11
##
12 13 14 15
## 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.
Sam Steingold's avatar
Sam Steingold committed
16
##
17
## You should have received a copy of the GNU General Public License
18
## along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
19 20 21 22

### Commentary:

### Code:
23
SHELL = @SHELL@
24 25

srcdir = @srcdir@
Sam Steingold's avatar
Sam Steingold committed
26 27
abs_builddir = @abs_builddir@
abs_top_builddir = @abs_top_builddir@
28 29
EXEEXT = @EXEEXT@

Sam Steingold's avatar
Sam Steingold committed
30 31 32
# abs_top_srcdir may contain ".."
top_srcdir_abs = $(shell cd @top_srcdir@; pwd -P)

33 34
MKDIR_P = @MKDIR_P@

35
## Emacs.app.
36
ns_appdir = @ns_appdir@
37
## GNUstep: ns_appdir; macOS: ns_appdir/Contents/MacOS
38
ns_appbindir = @ns_appbindir@
39
## GNUstep/Emacs.base or Cocoa/Emacs.base.
40
ns_appsrc = @ns_appsrc@
41
## GNUstep: GNUstep/Emacs.base/Resources/Info-gnustep.plist
42
## macOS: Cocoa/Emacs.base/Contents/Info.plist
43
ns_check_file = @ns_appdir@/@ns_check_file@
44

45 46
.PHONY: all

47
all: ${ns_appdir} ${ns_appbindir}/Emacs ${ns_appbindir}/Emacs.pdmp
48

49
${ns_check_file} ${ns_appdir}: ${srcdir}/${ns_appsrc} ${ns_appsrc}
50 51 52 53
	rm -rf ${ns_appdir}
	${MKDIR_P} ${ns_appdir}
	( cd ${srcdir}/${ns_appsrc} ; tar cfh - . ) | \
	  ( cd ${ns_appdir} ; umask 022; tar xf - )
54
	[ "`cd ${srcdir} && /bin/pwd`" = "`/bin/pwd`" ] || \
55 56
	  ( cd ${ns_appsrc} ; tar cfh - . ) | \
	    ( cd ${ns_appdir} ; umask 022; tar xf - )
57
	touch ${ns_appdir}
58

59 60 61 62 63
## Don't create ns_appbindir via an order-only prerequisite, because
## on GNUstep ns_appbindir and ns_bindir are the same, so
## the rule for ns_appbindir would conflict with that for ns_appdir.
${ns_appbindir}/Emacs: ${ns_appdir} ${ns_check_file} ../src/emacs${EXEEXT}
	${MKDIR_P} ${ns_appbindir}
64
	cp -f ../src/emacs${EXEEXT} $@
65

66
${ns_appbindir}/Emacs.pdmp: ${ns_appdir} ${ns_check_file} ../src/emacs${EXEEXT}.pdmp
Daniel Colascione's avatar
Daniel Colascione committed
67 68 69
	${MKDIR_P} ${ns_appbindir}
	cp -f ../src/emacs${EXEEXT}.pdmp $@

70
.PHONY: FORCE
71

72 73
../src/emacs${EXEEXT}: FORCE
	${MAKE} -C ../src $(notdir $@)
74

Sam Steingold's avatar
Sam Steingold committed
75 76
# create a fake installation pointing back to the source tree
# to run GUI Emacs in-place
77 78 79
.PHONY: links

links: ../src/emacs${EXEEXT}
Sam Steingold's avatar
Sam Steingold committed
80
	for d in $(shell cd ${srcdir}/${ns_appsrc}; find . -type d); do ${MKDIR_P} ${ns_appdir}/$$d; done
Sam Steingold's avatar
Sam Steingold committed
81
	for f in $(shell cd ${srcdir}/${ns_appsrc}; find . -type f); do ln -s $(shell cd ${srcdir}; pwd -P)/${ns_appsrc}/$$f ${ns_appdir}/$$f; done
Sam Steingold's avatar
Sam Steingold committed
82
	for d in $(shell cd ${ns_appsrc}; find . -type d); do ${MKDIR_P} ${ns_appdir}/$$d; done
83
	for f in $(shell cd ${ns_appsrc}; find . -type f); do rm -f ${ns_appdir}/$$f; ln -s $(shell cd ${ns_appsrc}; pwd -P)/$$f ${ns_appdir}/$$f; done
Sam Steingold's avatar
Sam Steingold committed
84 85
	ln -s $(top_srcdir_abs)/lisp ${ns_appdir}/Contents/Resources
	ln -s $(top_srcdir_abs)/info ${ns_appdir}/Contents/Resources
86
	${MKDIR_P} ${ns_appbindir}
Sam Steingold's avatar
Sam Steingold committed
87
	ln -s $(abs_top_builddir)/src/emacs${EXEEXT} ${ns_appbindir}/Emacs
88
	ln -s $(abs_top_builddir)/src/emacs${EXEEXT}.pdmp ${ns_appbindir}/Emacs.pdmp
Sam Steingold's avatar
Sam Steingold committed
89 90 91 92 93
	ln -s $(abs_top_builddir)/lib-src ${ns_appbindir}/bin
	ln -s $(abs_top_builddir)/lib-src ${ns_appbindir}/libexec
	${MKDIR_P} ${ns_appdir}/Contents/Resources/etc
	for f in $(shell cd $(top_srcdir_abs)/etc; ls); do ln -s $(top_srcdir_abs)/etc/$$f ${ns_appdir}/Contents/Resources/etc; done
	ln -s $(abs_top_builddir)/etc/DOC ${ns_appdir}/Contents/Resources/etc
Sam Steingold's avatar
Sam Steingold committed
94 95
	@echo if the next find prints something, the installation failed
	find ${ns_appdir} -exec test \! -e {} \; -ls
96

97
.PHONY: clean distclean bootstrap-clean maintainer-clean
98 99 100 101 102 103 104 105 106 107 108

clean:
	rm -rf ${ns_appdir}

distclean: clean
	rm -f Makefile
	rm -f GNUstep/Emacs.base/Resources/Info-gnustep.plist \
	  GNUstep/Emacs.base/Resources/Emacs.desktop \
	  Cocoa/Emacs.base/Contents/Info.plist \
	  Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings

109
bootstrap-clean maintainer-clean: distclean
110 111

### Makefile.in ends here