summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2021-01-06 01:23:09 (EST)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2021-01-06 01:23:09 (EST)
commit89c30e6d1148d6c1845a428cfdce769e270a25e2 (patch)
treeece3e6160e3fc3752b908ff4fd115dcaa1067c98
parent6dc38247fc04f8622242acdf1afbb84a73eb79d1 (diff)
build: Set SHA and DATE macros
Before: $ tmp/edid-decode.data/usr/bin/edid-decode --version edid-decode SHA: not available After: $ tmp/edid-decode.data/usr/bin/edid-decode --version edid-decode SHA: 95d81c9 2020-12-30
-rwxr-xr-xbuild7
1 files changed, 6 insertions, 1 deletions
diff --git a/build b/build
index f418e9a..20c5022 100755
--- a/build
+++ b/build
@@ -2,11 +2,16 @@
include ../source.mk
+sha_date_sed_re = ^.*[~+]git\(....\)\(..\)\(..\)\.\([0-9a-f]*\).*$$
+sha_date_sed = s/$(sha_date_sed_re)/sha=-DSHA=\4 date=-DDATE=\1-\2-\3/
+sha_date = $$(printf '%s\n' '$(OPK_SOURCE_VERSION_UPSTREAM)' | \
+ sed '$(sha_date_sed)')
+
nop:
@:
build:
- oh-autobuild
+ oh-autobuild -- $(sha_date)
touch $@
install: build