Commit 28b2170ca97893cc8fa5a2387e1bc61e95c17571
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 | rpiboot: main.c msd/bootcode.h msd/start.h msd/bootcode4.h msd/start4.h | 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 | %.h: %.bin ./bin2c | 6 | %.h: %.bin ./bin2c |
| 5 | ./bin2c $< $@ | 7 | ./bin2c $< $@ |
main.c
| @@ -649,6 +649,8 @@ int main(int argc, char *argv[]) | @@ -649,6 +649,8 @@ int main(int argc, char *argv[]) | ||
| 649 | 649 | ||
| 650 | get_options(argc, argv); | 650 | get_options(argc, argv); |
| 651 | 651 | ||
| 652 | + printf("RPIBOOT: build-date %s version %s %s\n", __DATE__, PKG_VER, GIT_VER); | ||
| 653 | + | ||
| 652 | // flush immediately | 654 | // flush immediately |
| 653 | setbuf(stdout, NULL); | 655 | setbuf(stdout, NULL); |
| 654 | 656 |