summaryrefslogtreecommitdiff
path: root/tools/msgenc/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tools/msgenc/Makefile')
-rw-r--r--tools/msgenc/Makefile25
1 files changed, 21 insertions, 4 deletions
diff --git a/tools/msgenc/Makefile b/tools/msgenc/Makefile
index da455633..f6ddc439 100644
--- a/tools/msgenc/Makefile
+++ b/tools/msgenc/Makefile
@@ -1,5 +1,22 @@
-CC := gcc
-CFLAGS := -O2
+CXXFLAGS := -std=c++17 -O2 -Wall -Wno-switch
+CFLAGS := -O2 -Wall -Wno-switch
+
+WSLENV ?= no
+ifeq ($(OS),Windows_NT)
+LDFLAGS += -lstdc++fs
+else
+UNAME_S := $(shell uname -s)
+ifeq ($(UNAME_S),Darwin)
+LDFLAGS += -lstdc++ -lc++ -lc
+else
+ifneq ($(WSLENV),)
+LDFLAGS += -lstdc++fs
+endif
+endif
+endif
+
+CXX_SRCS := msgenc.cpp
+HEADERS :=
.PHONY: all clean
@@ -9,5 +26,5 @@ all: msgenc
clean:
$(RM) msgenc msgenc.exe
-msgenc: msgenc.c
- $(CC) $(CFLAGS) -o $@ $^
+msgenc: $(CXX_SRCS) $(HEADERS)
+ $(CXX) -o $@ $^ $(LDFLAGS) $(CXXFLAGS)