aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2023-09-13 14:08:06 +0800
committerXi Ruoyao <xry111@xry111.site>2023-09-13 14:10:38 +0800
commitc858ba4e17a445591520ddcea8b288b8e3d6db42 (patch)
treebff7bbb44640cbe51c61d8f4a390ae650527a958 /Makefile
parenta9dc9724ae2a954405dd4dbc6a1593f1b469c3dd (diff)
build: Add "make dist"
For creating a tarball without .git directory easier. The tarball will include version.ent and LFS-RELEASE files so the book rendered from it won't show "unknown" for all dates.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 13d0f52a8..1c23a55f5 100644
--- a/Makefile
+++ b/Makefile
@@ -209,5 +209,14 @@ dump-commands: validate
all: book nochunks pdf dump-commands
-.PHONY : all book dump-commands nochunks pdf profile-html tmpdir validate md5sums wget-list version
+dist:
+ $(Q)DIST=/tmp/LFS-RELEASE ./git-version.sh $(REV)
+ $(Q)rm -f lfs-$$(</tmp/LFS-RELEASE).tar.xz
+ $(Q)tar cJf lfs-$$(</tmp/LFS-RELEASE).tar.xz \
+ $(shell git ls-tree HEAD . --name-only) version.ent \
+ -C /tmp LFS-RELEASE \
+ --transform "s,^,lfs-$$(</tmp/LFS-RELEASE)/,"
+ $(Q)echo "Generated XML tarball lfs-$$(</tmp/LFS-RELEASE).tar.xz"
+
+.PHONY : all book dump-commands nochunks pdf profile-html tmpdir validate md5sums wget-list version dist