summaryrefslogtreecommitdiff
path: root/tools/msgenc/Makefile
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2020-08-01 21:45:32 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2020-08-01 21:45:32 -0400
commite20d92a8d67f32864eb90439b591f8dfb0b992e4 (patch)
tree1645f8ef8cce09915e6425ef6f9d7df26caae58e /tools/msgenc/Makefile
parent85a668f75a799b50d4a7d77ecb292735bcce76b2 (diff)
Implement msgenc and decode script messages
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)