diff options
author | Thomas Heijligen <thomas.heijligen@secunet.com> | 2023-02-01 15:52:26 +0100 |
---|---|---|
committer | Anastasia Klimchuk <aklm@chromium.org> | 2023-05-07 08:36:39 +0000 |
commit | c4d89eadfd45c8dbfdfccc500c5cf34e14afea9a (patch) | |
tree | 114f664eb09f60a2fe28fc32bf25c1d1eb271302 /Makefile | |
parent | 3d5c9a5cea13e4e9acf73a9dbd5b549a3774b0a4 (diff) | |
download | flashrom-c4d89eadfd45c8dbfdfccc500c5cf34e14afea9a.tar.gz flashrom-c4d89eadfd45c8dbfdfccc500c5cf34e14afea9a.tar.bz2 flashrom-c4d89eadfd45c8dbfdfccc500c5cf34e14afea9a.zip |
meson make: use VERSION file
To create a distribution package with meson you run
`meson dist -C <your_build_dir>`
This will collect all git tracked files and pack them into an archive.
There is no way to collect version information for that.
So now the base version stands in the VERSION file. To relase a flashrom
version you change that file and tag the changing commit.
When building from git the git version is embedded in the flashrom
binary. E.g.:
flashrom 1.4.0-devel (git:v1.2-1172-g7f186838) on Linux 6.1.3 (x86_64)
Change-Id: Idc17eadb397b3c579bddfbf9ae6bf1b171f5dfb7
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/72657
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -398,13 +398,11 @@ LIB_OBJS = libflashrom.o layout.o erasure_layout.o flashrom.o udelay.o parallel. CLI_OBJS = cli_classic.o cli_output.o cli_common.o print.o -# versioninfo.inc stores metadata required to build a packaged flashrom. It is generated by the export rule and -# imported below. If versioninfo.inc is not found and the variables are not defined by the user, the info will -# be obtained using util/getrevision.sh, which is the common case during development. --include versioninfo.inc -VERSION ?= $(shell ./util/getrevision.sh --revision) - -SCMDEF := -D'FLASHROM_VERSION="$(VERSION)"' +VERSION ?= $(shell cat ./VERSION) +VERSION_GIT ?= $(shell git describe 2>/dev/null) +ifdef VERSION_GIT + VERSION := "$(VERSION) (git:$(VERSION_GIT))" +endif # No spaces in release names unless set explicitly RELEASENAME ?= $(shell echo "$(VERSION)" | sed -e 's/ /_/') @@ -1021,7 +1019,7 @@ config: fi %.o: %.c | config - $(CC) -MMD $(CFLAGS) $(CPPFLAGS) $(FLASHROM_CFLAGS) $(FEATURE_FLAGS) $(SCMDEF) -o $@ -c $< + $(CC) -MMD $(CFLAGS) $(CPPFLAGS) $(FLASHROM_CFLAGS) $(FEATURE_FLAGS) -D'FLASHROM_VERSION=$(VERSION)' -o $@ -c $< $(PROGRAM)$(EXEC_SUFFIX): $(CLI_OBJS) libflashrom.a $(CC) -o $@ $^ $(LDFLAGS) @@ -1101,7 +1099,7 @@ libpayload: clean make CC="CC=i386-elf-gcc lpgcc" AR=i386-elf-ar RANLIB=i386-elf-ranlib gitconfig: - ./util/getrevision.sh -c 2>/dev/null && ./util/git-hooks/install.sh + git rev-parse 2>/dev/null && ./util/git-hooks/install.sh .PHONY: all install clean distclean config _export export tarball libpayload |