aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGergő J. Miklós2020-10-10 23:26:19 +0200
committerGergő J. Miklós2020-10-10 23:26:19 +0200
commit32094c850a92fbdc77b05f9d78cb35f385b44c2e (patch)
tree7a5a546647742dfd9d2fe2b593f1c4e84bbcd548
parentfb7772fdfc90c84f44d51398b20fec0d4e749345 (diff)
downloadi2sensors-32094c850a92fbdc77b05f9d78cb35f385b44c2e.tar.gz
i2sensors-32094c850a92fbdc77b05f9d78cb35f385b44c2e.zip
versionstring
-rw-r--r--Makefile3
-rw-r--r--src/main.c8
2 files changed, 8 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 0a3c8c7..d79e2c9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
CC = gcc
ACC = arm-linux-gnueabihf-gcc
-CFLAGS = -Wall
+DATE = $(shell date "+%Y-%m-%d %H:%M:%S" )
+CFLAGS = -Wall -D"_BUILD_TIME_=\"$(DATE)\""
all: dir x86
##copy
diff --git a/src/main.c b/src/main.c
index 357d929..5919421 100644
--- a/src/main.c
+++ b/src/main.c
@@ -20,7 +20,10 @@
#include "hmc5883.h"
#define VERSION 1.27
-
+#ifndef _BUILD_TIME_
+ #define _BUILD_TIME_ __DATE__" "__TIME__
+#endif
+
// extern void lm75_print_help(void);
// extern void lm75_read_all(const char *opts);
// extern void lm75_read_one(const char *opts);
@@ -29,6 +32,7 @@
// extern void hih61xx_read_one(const char *opts);
+
uint16 devicef; //# Bus-Device file
uchar temp[256];
void (*print_all)(void) = NULL;
@@ -57,7 +61,7 @@ void print_help(void) {
" i2sensors read_all 1 lm75 0x4f \n"
" i2sensors read_one 1 lm75 0x4f 00,-1.35\n"
"\n" );
- printf ("Version: v%1.2f, build: [%s %s] (%s), TS: %s STDC: %d\n\n",VERSION,__DATE__,__TIME__,__VERSION__,__TIMESTAMP__,__STDC_VERSION__);
+ printf ("Version: v%1.2f, build: [%s] (gcc %s) \n\n",VERSION,_BUILD_TIME_,__VERSION__);
}
void bus_err(int ern){