From ddebc0e86b43e655b057927ca9869143232c3ee5 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: References: From: Ihor Radchenko Date: Mon, 10 Apr 2023 19:57:24 +0200 Subject: [PATCH 2/4] mk: Separate third-party package dirs for different Emacs versions * mk/default.mk (EMACS_VERSION): New variable holding current Emacs version, according to EMACS. (pkgdir_top): New variable holding top pkgdir, parent of per-Emacs version directories. (pkgdir): Set as a sub-directory of pkgdir_top named as Emacs version. * mk/targets.mk (uppkg): Do not clear .elc files. This is no longer needed as we do not need to worry about .elc being used by different Emacs version. (cleanpkg): Update, deleting the whole top pkgdir. --- mk/default.mk | 4 +++- mk/targets.mk | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mk/default.mk b/mk/default.mk index 92a3942da..bd6efeb6f 100644 --- a/mk/default.mk +++ b/mk/default.mk @@ -6,6 +6,7 @@ # Name of your emacs binary EMACS = emacs +EMACS_VERSION := $(shell $(EMACS) -Q --batch --eval '(message "%s" emacs-version)' 2>&1) # Where local software is found prefix = /usr/share @@ -33,7 +34,8 @@ testdir = $(TMPDIR)/tmp-orgtest # Where to store Org dependencies top_builddir := $(shell pwd) -pkgdir := $(top_builddir)/pkg-deps +pkgdir_top := $(top_builddir)/pkg-deps +pkgdir := $(pkgdir_top)/$(EMACS_VERSION) # Extra flags to be passed to Emacs EFLAGS ?= diff --git a/mk/targets.mk b/mk/targets.mk index 072106237..2171159ac 100644 --- a/mk/targets.mk +++ b/mk/targets.mk @@ -105,7 +105,6 @@ endif uppkg:: $(info ========= Installing required third-party packages) @$(MKDIR) -p $(pkgdir) - @$(FIND) $(pkgdir) \( -name \*.elc \) -exec $(RM) {} + -@$(INSTALL_PACKAGES) up0 up1 up2:: @@ -167,4 +166,4 @@ cleantest: } cleanpkg: - -$(RMR) $(pkgdir) + -$(RMR) $(pkgdir_top) -- 2.40.0