diff --git a/Makefile b/Makefile index 129a682..d407d0f 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ all: $(BUILD)/tbm -include scripts/Makefile.${TARGET} +CFLAGS += -DTBM_VERSION=\"2017-07-27-dev\" CFLAGS += -Iinclude CFLAGS += -Wall -Wundef -Wextra -Wshadow -Wimplicit-function-declaration CFLAGS += -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes -pedantic @@ -47,6 +48,7 @@ obj-y += source/shell/flash.o obj-y += source/shell/ftl.o obj-y += source/shell/mufs.o obj-y += source/shell/rtc.o +obj-y += source/shell/version.o obj = $(addprefix $(BUILD)/, $(obj-y)) diff --git a/include/shell/version.h b/include/shell/version.h new file mode 100644 index 0000000..0134307 --- /dev/null +++ b/include/shell/version.h @@ -0,0 +1,3 @@ +#pragma once + +void shell_version(struct console *con, const char **argv, size_t argc); diff --git a/source/shell/version.c b/source/shell/version.c new file mode 100644 index 0000000..737099b --- /dev/null +++ b/source/shell/version.c @@ -0,0 +1,15 @@ +#include + +#include + +#include + +void shell_version(struct console *con, const char **argv, size_t argc) +{ + (void)argv; + + if (argc < 1) + return; + + fprintf(con->fp, "hello,%s\n", TBM_VERSION); +}