Commit ad700fc4 authored by Christer Ekholm's avatar Christer Ekholm

Makefile: Avoid generating version.el multiple times.

By removing "$(MAKE) $(VERSION-EL)" from the recipe for lyskom.el, and
adding the elisp source-files as dependencies for version.el
parent 8ae3ab53
......@@ -2,6 +2,10 @@
* Makefile: Removed target fast: make fast doesn't work anymore,
and hasn't for quite some time.
* Makefile: Avoid generating version.el multiple times by removing
uncontitional "$(MAKE) $(VERSION-EL)" from recipe for
$(TARGET-EL), and depend on sources for version.el
* distribution-Makefile.in: Adapted for the change i Makefile.
2014-08-16 Christer Ekholm <che@chrekh.se>
......
......@@ -52,11 +52,10 @@ TARGET = lyskom.elc
TARGET-EL := $(TARGET:%.elc=%.el)
# These will be placed first in lyskom.el.
HEADER = header.el \
HEADER1 = header.el \
defvar.el \
feature.el \
$(VERSION-EL) \
vars.el \
feature.el
HEADER2 = vars.el \
macros.el \
compatibility.el \
language.el \
......@@ -143,31 +142,29 @@ EMACS-BATCH := $(EMACS) -batch
all: $(TARGET)
version.el: version.el.in Makefile
version.el: version.el.in Makefile $(HEADER1) $(HEADER2) $(LANGUAGE-EL) $(SOURCES)
rm -f $@
sed "s/@@CLIENTVERSION@@/$(CLIENTVERSION) (`date +%Y-%m-%d`; Git `git rev-parse --short HEAD``git diff --quiet HEAD||echo '*'`)/g" <$< >$@
chmod 444 $@
version.el-release: version.el.in Makefile
version.el-release: version.el.in Makefile $(HEADER1) $(HEADER2) $(LANGUAGE-EL) $(SOURCES)
sed 's/@@CLIENTVERSION@@/$(CLIENTVERSION)/g' <$< >$@
$(TARGET-EL) lyskom-all-$(CLIENTVERSION).el: \
$(HEADER) $(LANGUAGE-EL) $(SOURCES)
rm -f $(VERSION-EL)
$(MAKE) $(VERSION-EL)
$(HEADER1) $(VERSION-EL) $(HEADER2) $(LANGUAGE-EL) $(SOURCES)
echo ";;;;; -*-coding: x-ctext;-*-" >$@
cat $^ >>$@
%-help.el: help-%.xml
$(EMACS) -batch -l help-compile.el $^ -f lyskom-help-compile-to-el
lyskom-%-$(CLIENTVERSION).el: $(HEADER) %-strings.el %-help.el $(SOURCES)
lyskom-%-$(CLIENTVERSION).el: $(HEADER1) $(VERSION-EL) $(HEADER2) %-strings.el %-help.el $(SOURCES)
echo ";;;;; -*-coding: x-ctext;-*-" >$@
cat $^ >>$@
verbose: verbose-el $(TARGET)
verbose-el: $(HEADER) $(LANGUAGE-EL) $(SOURCES)
verbose-el: $(HEADER1) $(VERSION-EL) $(HEADER2) $(LANGUAGE-EL) $(SOURCES)
echo ";;;;; -*-coding: x-ctext;-*-" >$(TARGET-EL)
for i in $^ ; do \
echo '(eval-when-compile (message "Compiling %s" "'$$i'"))' \
......@@ -183,7 +180,7 @@ check: $(TARGET-EL) check-eof
-f lyskom-check-strings
check-eof:
for i in $(HEADER) $(LANGUAGE-EL) $(SOURCES); \
for i in $(HEADER1) $(VERSION-EL) $(HEADER2) $(LANGUAGE-EL) $(SOURCES); \
do \
sz=`wc -c < $$i`; \
sz=`expr $$sz - 1`; \
......@@ -196,7 +193,7 @@ check-eof:
done
TAGS: $(HEADER) $(LANGUAGE-EL) $(SOURCES)
TAGS: $(HEADER1) $(VERSION-EL) $(HEADER2) $(LANGUAGE-EL) $(SOURCES)
etags $^
distribution-README-%: \
......@@ -233,7 +230,7 @@ release: $(VERSION-EL) $(RELEASE-DIST-ARCHIVES)
############################################################
# Source dist.
RELEASE-SOURCE-SRC = $(HEADER) $(LANGUAGE-EL) $(SOURCES) $(MISC)
RELEASE-SOURCE-SRC = $(HEADER1) $(VERSION-EL) $(HEADER2) $(LANGUAGE-EL) $(SOURCES) $(MISC)
RELEASE-BASE-SRC = $(PACKAGENAME)-src-$(CLIENTVERSION)
$(RELEASE-BASE-SRC).buildstamp: \
......@@ -246,7 +243,9 @@ $(RELEASE-BASE-SRC).buildstamp: \
>$(RELEASE-BASE-SRC)/README
for i in $(subst distribution-,,$(EXTRA-SRCDIST)); do \
sed -e 's/@@CLIENTVERSION@@/$(CLIENTVERSION)/g' \
-e 's/@@HEADER@@/$(HEADER)/g' \
-e 's/@@HEADER1@@/$(HEADER1)/g' \
-e 's/@@HEADER2@@/$(HEADER2)/g' \
-e 's/@@VERSION-EL@@/$(VERSION-EL)/g' \
-e 's/@@SOURCES@@/$(SOURCES)/g' \
<distribution-$$i \
>$(RELEASE-BASE-SRC)/$$i ; \
......
......@@ -48,7 +48,9 @@ RM = /bin/rm -f
SHELL = /bin/sh
LANGUAGE-EL = $(LANGUAGES:=-strings.el) $(LANGUAGES:=-help.el)
EMACS-BATCH = $(EMACS) -batch
HEADER = @@HEADER@@
HEADER1 = @@HEADER1@@
HEADER2 = @@HEADER2@@
VERSION-EL = @@VERSION-EL@@
SOURCES = @@SOURCES@@
all: envcheck lyskom-@@CLIENTVERSION@@.elc
......@@ -59,8 +61,8 @@ envcheck:
lyskom-@@CLIENTVERSION@@.elc: lyskom-@@CLIENTVERSION@@.el
$(EMACS-BATCH) -l lpath.el -l help-compile.el -f batch-byte-compile lyskom-@@CLIENTVERSION@@.el
lyskom-@@CLIENTVERSION@@.el: $(HEADER) $(LANGUAGE-EL) $(SOURCES)
cat $(HEADER) $(LANGUAGE-EL) $(SOURCES) >lyskom-@@CLIENTVERSION@@.el
lyskom-@@CLIENTVERSION@@.el: $(HEADER1) $(VERSION-EL) $(HEADER2) $(LANGUAGE-EL) $(SOURCES)
cat $^ >lyskom-@@CLIENTVERSION@@.el
install: lyskom-@@CLIENTVERSION@@.elc
cp lyskom-@@CLIENTVERSION@@.el lyskom-@@CLIENTVERSION@@.elc $(LISPDIR)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment