From 9b0a353d7976efbd628166c30766646b2bcc7ba1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 5 Nov 2019 09:41:48 -0500 Subject: makefile program version tagging for bin-archive --- makefile | 17 +++++++++-------- org/dr_build_scaffold.org | 17 +++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/makefile b/makefile index 380fd70..8070643 100644 --- a/makefile +++ b/makefile @@ -1,4 +1,5 @@ -PROJECT_VERSION :=$(shell echo `git describe --long --tags | sed -e "s/^[ a-z_-]\+\([0-9.]\+\)/\1/;s/\([^-]*-g\)/r\1/;s/-/./g"`) +PROG_VER_GIT :=$(shell echo `git describe --long --tags | sed -e "s/^[ a-z_-]\+\([0-9.]\+\)/\1/;s/\([^-]*-g\)/r\1/;s/-/./g"`) +PROG_VER_DECLARED :=$(shell echo `cat ./views/version.txt | grep --color=never "enum" | sed 's/.\+(\([0-9]\+\),[ \t]\+\([0-9]\+\),[ \t]\+\([0-9]\+\)[ \t]*).\+/\1.\2.\3/g'`) DUB=dub DUB_FLAGS=-v --force --compiler= PRG_NAME=doc-reform @@ -109,8 +110,8 @@ dmd_debug: $(DUB) --compiler=dmd --config=dmd -b debug dmd_ver: $(DUB) --compiler=dmd --config=dmd-version - mv bin/doc-reform-dmd-ver bin-archive/doc-reform-$(PROJECT_VERSION)-dmd - notify-send -t 0 'D dmd compiled test release executable ready' 'doc-reform-$(PROJECT_VERSION)-dmd' + mv bin/doc-reform-dmd-ver bin-archive/doc-reform-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-dmd + notify-send -t 0 'D dmd compiled test release executable ready' 'doc-reform-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-dmd' dmd_clean_ver: clean tangle dmd_ver dmd_rel: expunge skel tangle $(DUB) --compiler=dmd --config=doc-reform-release @@ -125,8 +126,8 @@ gdc_debug: $(DUB) --compiler=gdc --config=gdc -b debug gdc_ver: $(DUB) --compiler=gdc --config=gdc-version - mv bin/doc-reform-gdc-ver bin-archive/doc-reform-$(PROJECT_VERSION)-gdc - notify-send -t 0 'D gdc compiled test release executable ready' 'doc-reform-$(PROJECT_VERSION)-gdc' + mv bin/doc-reform-gdc-ver bin-archive/doc-reform-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-gdc + notify-send -t 0 'D gdc compiled test release executable ready' 'doc-reform-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-gdc' gdc_clean_ver: clean tangle gdc_ver gdc_rel: expunge skel tangle $(DUB) --compiler=gdc --config=doc-reform-release @@ -141,8 +142,8 @@ ldc_debug: $(DUB) --compiler=ldc2 --config=ldc -b debug ldc_ver: $(DUB) --compiler=ldc2 --config=ldc-version - mv bin/doc-reform-ldc-ver bin-archive/doc-reform-$(PROJECT_VERSION)-ldc - notify-send -t 0 'D ldc2 compiled test release executable ready' 'doc-reform-$(PROJECT_VERSION)-ldc' + mv bin/doc-reform-ldc-ver bin-archive/doc-reform-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-ldc + notify-send -t 0 'D ldc2 compiled test release executable ready' 'doc-reform-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-ldc' ldc_clean_ver: clean tangle ldc_ver ldc_rel: expunge skel tangle $(DUB) --compiler=ldc2 --config=doc-reform-release @@ -193,7 +194,7 @@ distclean_and_init: expunge mkdir -p $(PRG_SRCDIR)/$(PRG_NAME_DIR); \ mkdir -p $(PRG_BINDIR); ver: - echo doc-reform-$(PROJECT_VERSION) + echo doc-reform-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT) clean_tangle_build: clean tangle build tangle_build: tangle build build: $(PRG_SRCDIR)/$(PRG_SRC) diff --git a/org/dr_build_scaffold.org b/org/dr_build_scaffold.org index ca6b224..0b6d901 100644 --- a/org/dr_build_scaffold.org +++ b/org/dr_build_scaffold.org @@ -22,7 +22,8 @@ *** git version stamp :git:version: #+BEGIN_SRC makefile :tangle ../makefile -PROJECT_VERSION :=$(shell echo `git describe --long --tags | sed -e "s/^[ a-z_-]\+\([0-9.]\+\)/\1/;s/\([^-]*-g\)/r\1/;s/-/./g"`) +PROG_VER_GIT :=$(shell echo `git describe --long --tags | sed -e "s/^[ a-z_-]\+\([0-9.]\+\)/\1/;s/\([^-]*-g\)/r\1/;s/-/./g"`) +PROG_VER_DECLARED :=$(shell echo `cat ./views/version.txt | grep --color=never "enum" | sed 's/.\+(\([0-9]\+\),[ \t]\+\([0-9]\+\),[ \t]\+\([0-9]\+\)[ \t]*).\+/\1.\2.\3/g'`) #+END_SRC *** dub (build tool) :dub: @@ -253,8 +254,8 @@ dmd_debug: #+BEGIN_SRC makefile :tangle ../makefile dmd_ver: $(DUB) --compiler=dmd --config=dmd-version - mv bin/doc-reform-dmd-ver bin-archive/doc-reform-$(PROJECT_VERSION)-dmd - notify-send -t 0 'D dmd compiled test release executable ready' 'doc-reform-$(PROJECT_VERSION)-dmd' + mv bin/doc-reform-dmd-ver bin-archive/doc-reform-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-dmd + notify-send -t 0 'D dmd compiled test release executable ready' 'doc-reform-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-dmd' dmd_clean_ver: clean tangle dmd_ver #+END_SRC @@ -293,8 +294,8 @@ gdc_debug: #+BEGIN_SRC makefile :tangle ../makefile gdc_ver: $(DUB) --compiler=gdc --config=gdc-version - mv bin/doc-reform-gdc-ver bin-archive/doc-reform-$(PROJECT_VERSION)-gdc - notify-send -t 0 'D gdc compiled test release executable ready' 'doc-reform-$(PROJECT_VERSION)-gdc' + mv bin/doc-reform-gdc-ver bin-archive/doc-reform-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-gdc + notify-send -t 0 'D gdc compiled test release executable ready' 'doc-reform-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-gdc' gdc_clean_ver: clean tangle gdc_ver #+END_SRC @@ -333,8 +334,8 @@ ldc_debug: #+BEGIN_SRC makefile :tangle ../makefile ldc_ver: $(DUB) --compiler=ldc2 --config=ldc-version - mv bin/doc-reform-ldc-ver bin-archive/doc-reform-$(PROJECT_VERSION)-ldc - notify-send -t 0 'D ldc2 compiled test release executable ready' 'doc-reform-$(PROJECT_VERSION)-ldc' + mv bin/doc-reform-ldc-ver bin-archive/doc-reform-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-ldc + notify-send -t 0 'D ldc2 compiled test release executable ready' 'doc-reform-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT)-ldc' ldc_clean_ver: clean tangle ldc_ver #+END_SRC @@ -401,7 +402,7 @@ distclean_and_init: expunge #+BEGIN_SRC makefile :tangle ../makefile ver: - echo doc-reform-$(PROJECT_VERSION) + echo doc-reform-$(PROG_VER_DECLARED)-tag-$(PROG_VER_GIT) #+END_SRC ****** tangle build rebuild :clean:tangle:build: -- cgit v1.2.3