summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-02-10 01:48:59 +0100
committerAlejandro Colomar <alx@kernel.org>2024-02-10 01:48:59 +0100
commit42abd1b8d7b9ba787b69502b7a8e197c68484896 (patch)
treee85382f23bba39a55a39826aba15073a163ed923
parent015966a02cf9480e20ef8071aab6a6c7e7b40bac (diff)
downloadliba2i-42abd1b8d7b9ba787b69502b7a8e197c68484896.tar.gz
share/mk/dist/: dist-z: Add target for building all compressed tarballs
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--share/mk/dist/_.mk25
-rw-r--r--share/mk/dist/z.mk41
2 files changed, 42 insertions, 24 deletions
diff --git a/share/mk/dist/_.mk b/share/mk/dist/_.mk
index 5a5c11c..c736d8a 100644
--- a/share/mk/dist/_.mk
+++ b/share/mk/dist/_.mk
@@ -6,46 +6,23 @@ ifndef MAKEFILE_DIST_INCLUDED
MAKEFILE_DIST_INCLUDED := 1
-include $(MAKEFILEDIR)/cmd.mk
-include $(MAKEFILEDIR)/compress.mk
include $(MAKEFILEDIR)/install/_.mk
_DISTDIR := $(builddir)/dist
-compression := bz2 gz lz xz
-
-
$(builddir)/dist/:
+$(info INSTALL $@)
+$(INSTALL_DIR) $@
-
$(builddir)/dist/%/: | $(builddir)/dist/
+$(info INSTALL $@)
+$(INSTALL_DIR) $@
-define DISTFILE_z_rule
-$(DISTFILE).$(2): %.$(2): % $(MK) | $$$$(@D)/
- $$(info $(1) $$@)
- $($(1)) $($(1)FLAGS) -kf $$<
- touch $$@
-endef
-
-$(eval $(call DISTFILE_z_rule,BZIP2,bz2))
-$(eval $(call DISTFILE_z_rule,GZIP,gz))
-$(eval $(call DISTFILE_z_rule,LZIP,lz))
-$(eval $(call DISTFILE_z_rule,XZ,xz))
-
-
-$(foreach z, $(compression), \
- $(eval .PHONY: dist-$(z)))
-$(foreach z, $(compression), \
- $(eval dist-$(z): $(DISTFILE).$(z);))
.PHONY: dist
-dist: dist-tar $(foreach z, $(compression), dist-$(z));
+dist: dist-tar dist-z
endif # include guard
diff --git a/share/mk/dist/z.mk b/share/mk/dist/z.mk
new file mode 100644
index 0000000..e2c8277
--- /dev/null
+++ b/share/mk/dist/z.mk
@@ -0,0 +1,41 @@
+# Copyright 2021-2024 Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: LGPL-3.0-only WITH LGPL-3.0-linking-exception
+
+
+ifndef MAKEFILE_DIST_Z_INCLUDED
+MAKEFILE_DIST_Z_INCLUDED := 1
+
+
+include $(MAKEFILEDIR)/cmd.mk
+include $(MAKEFILEDIR)/compress.mk
+include $(MAKEFILEDIR)/dist/tar.mk
+
+
+compression := bz2 gz lz xz
+
+
+define DISTFILE_z_rule
+$(DISTFILE).$(2): %.$(2): % $(MK) | $$$$(@D)/
+ $$(info $(1) $$@)
+ $($(1)) $($(1)FLAGS) -kf $$<
+ $(TOUCH) $$@
+endef
+
+
+$(eval $(call DISTFILE_z_rule,BZIP2,bz2))
+$(eval $(call DISTFILE_z_rule,GZIP,gz))
+$(eval $(call DISTFILE_z_rule,LZIP,lz))
+$(eval $(call DISTFILE_z_rule,XZ,xz))
+
+
+$(foreach z, $(compression), \
+ $(eval .PHONY: dist-$(z)))
+$(foreach z, $(compression), \
+ $(eval dist-$(z): $(DISTFILE).$(z);))
+
+
+.PHONY: dist-z
+dist-z: $(foreach z, $(compression), dist-$(z));
+
+
+endif # include guard