summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-02-11 00:24:40 +0100
committerAlejandro Colomar <alx@kernel.org>2024-02-11 01:30:01 +0100
commit1e9ea4f4aaeebea720b91481c0478eec3b691b51 (patch)
treea94528b0ee9deab5dfbc1388b2032f574bdcff4c
parent882a732e5c76d2c20b5c5c028ad5c30d7acd94ae (diff)
share/mk/: dist: Make it unavailable in the release tarball
We use git to decide what files go into a release tarball. Since those don't have a git repository, they cannot create tarballs themselves. Add a dummy 'dist' tag to the main Makefile so that 'all' can continue having it as a dependency without failing. Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--GNUmakefile1
-rw-r--r--share/mk/dist/files.mk1
-rw-r--r--share/mk/dist/tar.mk4
3 files changed, 5 insertions, 1 deletions
diff --git a/GNUmakefile b/GNUmakefile
index bf9b8e8..a700705 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -67,6 +67,7 @@ help:
$(info install-man Install manual pages)
$(info installcheck Check the installed library)
$(info )
+ $(info # 'dist' is not available in release tarballs.)
$(info dist Wrapper for dist-* targets)
$(info dist-tar Create a release tarball)
$(info dist-z Wrapper for dist-z-* targets)
diff --git a/share/mk/dist/files.mk b/share/mk/dist/files.mk
index 627c70d..6bbc5d2 100644
--- a/share/mk/dist/files.mk
+++ b/share/mk/dist/files.mk
@@ -16,6 +16,7 @@ include $(MAKEFILEDIR)/verbose.mk
DISTFILES := $(shell $(GIT) ls-files $(HIDE_ERR) \
| $(SED) 's,^,$(srcdir)/,' \
+ | $(GREP) -v '$(MAKEFILEDIR)/dist/' \
| $(SED) 's,:,\\:,g')
_DISTFILES := $(patsubst $(srcdir)/%,$(_DISTDIR)/%,$(DISTFILES))
_DISTPAGES := $(filter $(_DISTDIR)/share/man/man%,$(_DISTFILES))
diff --git a/share/mk/dist/tar.mk b/share/mk/dist/tar.mk
index 9b4b0f5..cfabb21 100644
--- a/share/mk/dist/tar.mk
+++ b/share/mk/dist/tar.mk
@@ -22,7 +22,9 @@ $(DISTFILE): $(_DISTFILES) $(MK) | $$(@D)/
$(info TAR $@)
$(TAR) $(TARFLAGS) -cf $@ -T /dev/null
$(GIT) ls-files \
- | $(SED) 's,^,$(_DISTDIR)/,' \
+ | $(SED) 's,^,$(srcdir)/,' \
+ | $(GREP) -v '$(MAKEFILEDIR)/dist/' \
+ | $(SED) 's,^$(srcdir)/,$(_DISTDIR)/,' \
| $(XARGS) $(TAR) $(TARFLAGS) -rf $@ -C $(srcdir) \
--transform 's,^$(_DISTDIR),$(DISTNAME),'