Commit ad700fc4 authored by Christer Ekholm's avatar Christer Ekholm
Browse files

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 @@ ...@@ -2,6 +2,10 @@
* Makefile: Removed target fast: make fast doesn't work anymore, * Makefile: Removed target fast: make fast doesn't work anymore,
and hasn't for quite some time. 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> 2014-08-16 Christer Ekholm <che@chrekh.se>
......
...@@ -52,11 +52,10 @@ TARGET = lyskom.elc ...@@ -52,11 +52,10 @@ TARGET = lyskom.elc
TARGET-EL := $(TARGET:%.elc=%.el) TARGET-EL := $(TARGET:%.elc=%.el)
# These will be placed first in lyskom.el. # These will be placed first in lyskom.el.
HEADER = header.el \ HEADER1 = header.el \
defvar.el \ defvar.el \
feature.el \ feature.el
$(VERSION-EL) \ HEADER2 = vars.el \
vars.el \
macros.el \ macros.el \
compatibility.el \ compatibility.el \
language.el \ language.el \
...@@ -143,31 +142,29 @@ EMACS-BATCH := $(EMACS) -batch ...@@ -143,31 +142,29 @@ EMACS-BATCH := $(EMACS) -batch
all: $(TARGET) all: $(TARGET)
version.el: version.el.in Makefile version.el: version.el.in Makefile $(HEADER1) $(HEADER2) $(LANGUAGE-EL) $(SOURCES)
rm -f $@ rm -f $@
sed "s/@@CLIENTVERSION@@/$(CLIENTVERSION) (`date +%Y-%m-%d`; Git `git rev-parse --short HEAD``git diff --quiet HEAD||echo '*'`)/g" <$< >$@ sed "s/@@CLIENTVERSION@@/$(CLIENTVERSION) (`date +%Y-%m-%d`; Git `git rev-parse --short HEAD``git diff --quiet HEAD||echo '*'`)/g" <$< >$@
chmod 444 $@ 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' <$< >$@ sed 's/@@CLIENTVERSION@@/$(CLIENTVERSION)/g' <$< >$@
$(TARGET-EL) lyskom-all-$(CLIENTVERSION).el: \ $(TARGET-EL) lyskom-all-$(CLIENTVERSION).el: \
$(HEADER) $(LANGUAGE-EL) $(SOURCES) $(HEADER1) $(VERSION-EL) $(HEADER2) $(LANGUAGE-EL) $(SOURCES)
rm -f $(VERSION-EL)
$(MAKE) $(VERSION-EL)
echo ";;;;; -*-coding: x-ctext;-*-" >$@ echo ";;;;; -*-coding: x-ctext;-*-" >$@
cat $^ >>$@ cat $^ >>$@
%-help.el: help-%.xml %-help.el: help-%.xml
$(EMACS) -batch -l help-compile.el $^ -f lyskom-help-compile-to-el $(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;-*-" >$@ echo ";;;;; -*-coding: x-ctext;-*-" >$@
cat $^ >>$@ cat $^ >>$@
verbose: verbose-el $(TARGET) 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) echo ";;;;; -*-coding: x-ctext;-*-" >$(TARGET-EL)
for i in $^ ; do \ for i in $^ ; do \
echo '(eval-when-compile (message "Compiling %s" "'$$i'"))' \ echo '(eval-when-compile (message "Compiling %s" "'$$i'"))' \
...@@ -183,7 +180,7 @@ check: $(TARGET-EL) check-eof ...@@ -183,7 +180,7 @@ check: $(TARGET-EL) check-eof
-f lyskom-check-strings -f lyskom-check-strings
check-eof: check-eof:
for i in $(HEADER) $(LANGUAGE-EL) $(SOURCES); \ for i in $(HEADER1) $(VERSION-EL) $(HEADER2) $(LANGUAGE-EL) $(SOURCES); \
do \ do \
sz=`wc -c < $$i`; \ sz=`wc -c < $$i`; \
sz=`expr $$sz - 1`; \ sz=`expr $$sz - 1`; \
...@@ -196,7 +193,7 @@ check-eof: ...@@ -196,7 +193,7 @@ check-eof:
done done
TAGS: $(HEADER) $(LANGUAGE-EL) $(SOURCES) TAGS: $(HEADER1) $(VERSION-EL) $(HEADER2) $(LANGUAGE-EL) $(SOURCES)
etags $^ etags $^
distribution-README-%: \ distribution-README-%: \
...@@ -233,7 +230,7 @@ release: $(VERSION-EL) $(RELEASE-DIST-ARCHIVES) ...@@ -233,7 +230,7 @@ release: $(VERSION-EL) $(RELEASE-DIST-ARCHIVES)
############################################################ ############################################################
# Source dist. # 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 = $(PACKAGENAME)-src-$(CLIENTVERSION)
$(RELEASE-BASE-SRC).buildstamp: \ $(RELEASE-BASE-SRC).buildstamp: \
...@@ -246,7 +243,9 @@ $(RELEASE-BASE-SRC).buildstamp: \ ...@@ -246,7 +243,9 @@ $(RELEASE-BASE-SRC).buildstamp: \
>$(RELEASE-BASE-SRC)/README >$(RELEASE-BASE-SRC)/README
for i in $(subst distribution-,,$(EXTRA-SRCDIST)); do \ for i in $(subst distribution-,,$(EXTRA-SRCDIST)); do \
sed -e 's/@@CLIENTVERSION@@/$(CLIENTVERSION)/g' \ 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' \ -e 's/@@SOURCES@@/$(SOURCES)/g' \
<distribution-$$i \ <distribution-$$i \
>$(RELEASE-BASE-SRC)/$$i ; \ >$(RELEASE-BASE-SRC)/$$i ; \
......
...@@ -48,7 +48,9 @@ RM = /bin/rm -f ...@@ -48,7 +48,9 @@ RM = /bin/rm -f
SHELL = /bin/sh SHELL = /bin/sh
LANGUAGE-EL = $(LANGUAGES:=-strings.el) $(LANGUAGES:=-help.el) LANGUAGE-EL = $(LANGUAGES:=-strings.el) $(LANGUAGES:=-help.el)
EMACS-BATCH = $(EMACS) -batch EMACS-BATCH = $(EMACS) -batch
HEADER = @@HEADER@@ HEADER1 = @@HEADER1@@
HEADER2 = @@HEADER2@@
VERSION-EL = @@VERSION-EL@@
SOURCES = @@SOURCES@@ SOURCES = @@SOURCES@@
all: envcheck lyskom-@@CLIENTVERSION@@.elc all: envcheck lyskom-@@CLIENTVERSION@@.elc
...@@ -59,8 +61,8 @@ envcheck: ...@@ -59,8 +61,8 @@ envcheck:
lyskom-@@CLIENTVERSION@@.elc: lyskom-@@CLIENTVERSION@@.el lyskom-@@CLIENTVERSION@@.elc: lyskom-@@CLIENTVERSION@@.el
$(EMACS-BATCH) -l lpath.el -l help-compile.el -f batch-byte-compile 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) lyskom-@@CLIENTVERSION@@.el: $(HEADER1) $(VERSION-EL) $(HEADER2) $(LANGUAGE-EL) $(SOURCES)
cat $(HEADER) $(LANGUAGE-EL) $(SOURCES) >lyskom-@@CLIENTVERSION@@.el cat $^ >lyskom-@@CLIENTVERSION@@.el
install: lyskom-@@CLIENTVERSION@@.elc install: lyskom-@@CLIENTVERSION@@.elc
cp lyskom-@@CLIENTVERSION@@.el lyskom-@@CLIENTVERSION@@.elc $(LISPDIR) 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