Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

output build data time and git rev when start

  • Loading branch information...
commit 43c2a467d154d53508daf8a5e6f71bee280eace1 1 parent 39f76b3
Xiangfu Liu authored
Showing with 8 additions and 1 deletion.
  1. +6 −0 src/Makefile
  2. +2 −1  src/main.c
6 src/Makefile
View
@@ -10,6 +10,12 @@ LDFLAGS+= -T linker.ld -N
LDFLAGS+= -L$(MMDIR)/software/libbase -L$(MMDIR)/software/libmath -L$(MMDIR)/software/libnet -L$(MMDIR)/software/libhal
LIBS = -lbase -lmath -lnet -lhal
+CFLAGS+= -DVERSION='"$(GIT_VERSION)$(GIT_STATUS)"'
+
+GIT_VERSION:=$(shell git rev-parse HEAD | cut -c 1-7)
+GIT_STATUS:=$(shell [ -z "`git status -s -uno`" ] || echo +)
+
+
all: boot.bin
%.bin: %.elf
3  src/main.c
View
@@ -201,7 +201,8 @@ int main()
irq_setmask(0);
irq_enable(1);
uart_init();
- printf("*** Milkymist One automated tests starting...\n\n");
+ printf("*** Milkymist One automated tests starting...\n");
+ printf("*** Built: %s at %s (rev %s)\n\n", __DATE__, __TIME__, VERSION);
while(1) {
printf("*** Select a test category below, or hit ENTER to run all tests:\n");
i = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.