Commit 28b2170ca97893cc8fa5a2387e1bc61e95c17571

Authored by tim
1 parent a7d4ec49

rpiboot: Add build date and version

Capture the changelog version and git version (if available)
Showing 2 changed files with 5 additions and 1 deletions
Makefile
  1 +PKG_VER=$(shell grep rpiboot debian/changelog | head -n1 | sed 's/.*(\(.*\)).*/\1/g')
  2 +GIT_VER=$(shell git rev-parse HEAD 2>/dev/null | cut -c1-8 || echo "")
1 3 rpiboot: main.c msd/bootcode.h msd/start.h msd/bootcode4.h msd/start4.h
2   - $(CC) -Wall -Wextra -g -o $@ $< `pkg-config --cflags --libs libusb-1.0`
  4 + $(CC) -Wall -Wextra -g -o $@ $< `pkg-config --cflags --libs libusb-1.0` -DGIT_VER="\"$(GIT_VER)\"" -DPKG_VER="\"$(PKG_VER)\""
3 5  
4 6 %.h: %.bin ./bin2c
5 7 ./bin2c $< $@
... ...
... ... @@ -649,6 +649,8 @@ int main(int argc, char *argv[])
649 649  
650 650 get_options(argc, argv);
651 651  
  652 + printf("RPIBOOT: build-date %s version %s %s\n", __DATE__, PKG_VER, GIT_VER);
  653 +
652 654 // flush immediately
653 655 setbuf(stdout, NULL);
654 656  
... ...