Commit 515d33b92722a28b77c1bc54f26f06b24a1cb467

Authored by Tim Gover
Committed by GitHub
2 parents a7d4ec49 28b2170c

Merge pull request #109 from timg236/rpiboot-version-info

rpiboot: Add build date and version
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  
... ...