From edfa25fcd8edad43998f50a2144d30a6f966c1c8 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Thu, 26 May 2022 21:52:30 +0200 Subject: fix configuration on windows --- shared/consts.h | 5 +++++ shared/makefile | 13 +++++++++++++ 2 files changed, 18 insertions(+) (limited to 'shared') diff --git a/shared/consts.h b/shared/consts.h index c65e50f..70ab5b2 100644 --- a/shared/consts.h +++ b/shared/consts.h @@ -5,6 +5,11 @@ #define W2_BUILD_STR ("????????") #endif +#if !defined W2_HOST_WIN32 && !defined W2_HOST_LINUX +#define W2_HOST_UNKNOWN +#warning "host operating system unknown" +#endif + /** max logic module execution time in milliseconds */ #define W2_MAX_MODULE_CYCLE_MS (20) /** serial baud rate (bit/s) */ diff --git a/shared/makefile b/shared/makefile index cfdf8ac..7f0ceb9 100644 --- a/shared/makefile +++ b/shared/makefile @@ -1,5 +1,18 @@ SOURCES += $(wildcard ../shared/*.c) HEADERS += $(wildcard ../shared/*.h) +# debug build info string +BUILD_STR=$(shell git update-index -q --refresh; git describe --tags --dirty='*' --broken='x' | cut -c1-20) +CFLAGS += -DW2_BUILD_STR=\"$(BUILD_STR)\" + +# os info +OS=$(strip $(shell uname -o)) +ifeq ($(OS),GNU/Linux) +CFLAGS += -DW2_HOST_LINUX +endif +ifeq ($(OS),Msys) +CFLAGS += -DW2_HOST_WIN32 +endif + clean:: rm -f ../shared/*.o -- cgit v1.2.3