From c858ba4e17a445591520ddcea8b288b8e3d6db42 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 13 Sep 2023 14:08:06 +0800 Subject: 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. --- .gitignore | 1 + Makefile | 11 ++++++++++- git-version.sh | 7 +++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f2a347215..9595dd32f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ lfs-bootscripts-*.tar.xz +lfs-*.tar.xz conditional.ent version.ent appendices/*.script 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-$$(" >> conditional.ent if ! git status > /dev/null; then # Either it's not a git repository, or git is unavaliable. # Just workaround. + + if [ -e LFS-RELEASE ]; then + exit 0 + fi + echo " version.ent echo "" >> version.ent echo "]]>" >> version.ent @@ -65,3 +70,5 @@ echo "" >> version.ent echo "]]>" >> version.ent echo "" >> version.ent echo "" >> version.ent + +[ -z "$DIST" ] || echo $version > "$DIST" -- cgit v1.2.3-54-g00ecf