Commit 5d4ef29f authored by Alessandro Rubini's avatar Alessandro Rubini

revision: change revision generation, no effect on output

This doesn't change the behavior of any command, but adds revision.c
as a real source file rather than something created by make using
"echo ... > revision.c".  In any case, the file is recompiled
each time you call "make", so the date and time reflect the last

However, this introduces CONFIG_DETERMINISTIC_BINARY (that nobody
sets at this point in time) to build a binary withouth __DATE__
and __TIME__ strings, so it is the same at every rebuild. See
next commit.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <>
parent 6c5c7358
......@@ -4,7 +4,6 @@
......@@ -83,9 +83,7 @@ REVISION=$(shell git describe --dirty --always)
all: tools wrc
wrc: silentoldconfig $(OBJS)
echo "const char *build_revision = \"$(REVISION)\";" > revision.c
echo "const char *build_date = __DATE__ \" \" __TIME__;" >> revision.c
$(CC) $(CFLAGS) -c revision.c
$(CC) $(CFLAGS) -DGIT_REVISION=\"$(REVISION)\" -c revision.c
$(SIZE) -t $(OBJS)
${CC} -o $(OUTPUT).elf revision.o $(OBJS) $(LDFLAGS)
${OBJCOPY} -O binary $(OUTPUT).elf $(OUTPUT).bin
const char *build_revision = GIT_REVISION;
const char *build_date = "";
const char *build_date = ", compiled on: " __DATE__ " " __TIME__;
......@@ -5,7 +5,7 @@ extern const char *build_revision, *build_date;
int cmd_version(const char *args[])
mprintf("WR Core build: %s, compiled on: %s (memory size: %d kB)\n",
mprintf("WR Core build: %s%s (memory size: %d kB)\n",
build_revision, build_date, sysc_get_memsize());
return 0;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment