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

3
# Copyright (C) 2012-2013 Free Software Foundation, Inc.
4

5
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
Kenichi Handa's avatar
Kenichi Handa committed
6 7 8 9 10
#   National Institute of Advanced Industrial Science and Technology (AIST)
#   Registration Number H13PRO009
#
# This file is part of GNU Emacs.

11
# GNU Emacs is free software: you can redistribute it and/or modify
Kenichi Handa's avatar
Kenichi Handa committed
12
# it under the terms of the GNU General Public License as published by
13 14
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
Kenichi Handa's avatar
Kenichi Handa committed
15 16 17 18 19 20 21

# 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
22 23
# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.

24
SHELL = @SHELL@
25 26 27

srcdir = @srcdir@
top_srcdir = @top_srcdir@
28
top_builddir = @top_builddir@
Kenichi Handa's avatar
Kenichi Handa committed
29

30
EMACS = ${top_builddir}/src/emacs
31
DSTDIR = ${top_srcdir}/lisp/international
32
emacs = "${EMACS}" -batch --no-site-file --no-site-lisp
Kenichi Handa's avatar
Kenichi Handa committed
33

34 35
.PHONY: all compile install

36
all: ${DSTDIR}/charprop.el
Kenichi Handa's avatar
Kenichi Handa committed
37

38
.el.elc:
39
	${emacs} -f batch-byte-compile $<
Kenichi Handa's avatar
Kenichi Handa committed
40

41 42
unidata.txt: ${srcdir}/UnicodeData.txt
	sed -e 's/\([^;]*\);\(.*\)/(#x\1 "\2")/' -e 's/;/" "/g' < ${srcdir}/UnicodeData.txt > $@
Kenichi Handa's avatar
Kenichi Handa committed
43

44 45
compile: ${srcdir}/unidata-gen.elc

Glenn Morris's avatar
Glenn Morris committed
46
## Depend on .el rather than .elc so as not to needlessly rebuild
47 48 49 50
## uni-*.el files just because .elc is missing.
## Same for UnicodeData.txt v unidata.txt.
${DSTDIR}/charprop.el: ${srcdir}/unidata-gen.el ${srcdir}/UnicodeData.txt
	${MAKE} ${MFLAGS} compile unidata.txt EMACS="${EMACS}"
51 52 53
	-if [ -f "$@" ]; then \
	  cd ${DSTDIR} && chmod +w charprop.el `sed -n 's/^;; FILE: //p' < charprop.el`; \
	fi
54 55
	${emacs} -L ${srcdir} -l unidata-gen -f unidata-gen-files \
	  ${srcdir} "${DSTDIR}"
56 57 58

## Like the above, but generate in PWD rather than lisp/international.
charprop.el: ${srcdir}/unidata-gen.elc unidata.txt
59 60
	${emacs} -L ${srcdir} -l unidata-gen -f unidata-gen-files \
	  ${srcdir}
Kenichi Handa's avatar
Kenichi Handa committed
61

62 63
.PHONY: clean bootstrap-clean distclean maintainer-clean extraclean

Kenichi Handa's avatar
Kenichi Handa committed
64 65 66 67 68 69 70 71
install: charprop.el
	cp charprop.el ${DSTDIR}
	cp `sed -n 's/^;; FILE: //p' < charprop.el` ${DSTDIR}

clean:
	if test -f charprop.el; then \
	  rm -f `sed -n 's/^;; FILE: //p' < charprop.el`; \
	fi
72
	rm -f charprop.el ${srcdir}/*.elc unidata.txt
73

74 75
bootstrap-clean: clean

76
distclean: clean
77
	rm -f Makefile
78

79
maintainer-clean: distclean
80 81 82 83 84 85 86 87 88

## Do not remove these files, even in a bootstrap, because they rarely
## change and it slows down bootstrap (a tiny bit).
## Cf leim/ja-dic (which is much slower).
extraclean:
	if test -f ${DSTDIR}/charprop.el; then \
	  (cd ${DSTDIR} && rm -f `sed -n 's/^;; FILE: //p' < charprop.el`); \
	  rm -f ${DSTDIR}/charprop.el; \
	fi