From 458b3417bef7d3bbe48032ff0387383bea68e1fc Mon Sep 17 00:00:00 2001 From: Poltern <2363951+Poltern@users.noreply.github.com> Date: Wed, 13 Sep 2023 23:00:58 +0300 Subject: [PATCH] build: Add "make dist" git-version: Always skip creating version.ent if LFS-RELEASE exists added .gitignore 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 | 7 +++++++ Makefile | 31 ++++++++++++++++++++----------- git-version.sh | 8 +++++++- 3 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9595dd3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +lfs-bootscripts-*.tar.xz +lfs-*.tar.xz +conditional.ent +version.ent +appendices/*.script +*.swp +fop.log diff --git a/Makefile b/Makefile index 6451a46..cffced9 100644 --- a/Makefile +++ b/Makefile @@ -206,17 +206,26 @@ $(BASEDIR)/md5sums: stylesheets/wget-list.xsl chapter03/chapter03.xml \ version: $(Q)./git-version.sh $(REV) -#dump-commands: validate -# @echo "Dumping book commands..." -# -# $(Q)rm -rf $(DUMPDIR) -# -# $(Q)xsltproc --output $(DUMPDIR)/ \ -# stylesheets/dump-commands.xsl \ -# $(RENDERTMP)/lfs-full.xml -# @echo "Dumping book commands complete in $(DUMPDIR)" +dump-commands: validate + @echo "Dumping book commands..." -all: book nochunks pdf # dump-commands + $(Q)rm -rf $(DUMPDIR) -.PHONY : all book dump-commands nochunks pdf profile-html tmpdir validate md5sums wget-list version + $(Q)xsltproc --output $(DUMPDIR)/ \ + stylesheets/dump-commands.xsl \ + $(RENDERTMP)/lfs-full.xml + @echo "Dumping book commands complete in $(DUMPDIR)" + +all: book nochunks pdf dump-commands + +dist: + $(Q)DIST=/tmp/LFS-RELEASE ./git-version.sh $(REV) + $(Q)rm -f lfs-$$(" > conditional.ent echo "" >> conditional.ent +if [ -e LFS-RELEASE ]; then + exit 0 +fi + if ! git status > /dev/null; then # Either it's not a git repository, or git is unavaliable. # Just workaround. @@ -65,3 +69,5 @@ echo "" >> version.ent echo "]]>" >> version.ent echo "" >> version.ent echo "" >> version.ent + +[ -z "$DIST" ] || echo $version > "$DIST"