aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 15 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 6b85111..dc62d10 100644
--- a/Makefile
+++ b/Makefile
@@ -1,27 +1,30 @@
-#linux: CXXFILES += source/serial/src/impl/unix.cc source/serial/src/impl/list_ports/list_ports_unix.cc
-#linux: LDFLAGS = -lSDL2 -lGL -lpthread
-
-#CROSS = x86_64-w64-mingw32-
-#CXX = $(CROSS)g++
CXX = g++
CXXFILES := \
source/serial/src/serial.cc \
- source/serial/src/impl/win.cc \
- source/serial/src/impl/list_ports/list_ports_win.cc \
$(wildcard source/imgui/backends/*.cpp) \
$(wildcard source/imgui/*.cpp) \
$(wildcard source/stmdsp/*.cpp) \
$(wildcard source/*.cpp)
-OFILES := $(patsubst %.cc, %.o, $(patsubst %.cpp, %.o, $(CXXFILES)))
-OUTPUT := stmdspgui.exe
-
CXXFLAGS := -std=c++20 -O2 \
-Isource -Isource/imgui -Isource/stmdsp -Isource/serial/include \
- -Wall -Wextra -pedantic \
- -DSTMDSP_WIN32 -Wa,-mbig-obj -DSTMDSP_DISABLE_FORMULAS
+ -Wall -Wextra -pedantic #-DSTMDSP_DISABLE_FORMULAS
+
+ifeq ($(OS),Windows_NT)
+CXXFILES += source/serial/src/impl/win.cc \
+ source/serial/src/impl/list_ports/list_ports_win.cc
+CXXFLAGS += -DSTMDSP_WIN32 -Wa,-mbig-obj
LDFLAGS = -mwindows -lSDL2 -lopengl32 -lsetupapi -lole32
+OUTPUT := stmdspgui.exe
+else
+CXXFILES += source/serial/src/impl/unix.cc \
+ source/serial/src/impl/list_ports/list_ports_unix.cc
+LDFLAGS = -lSDL2 -lGL -lpthread
+OUTPUT := stmdspgui
+endif
+
+OFILES := $(patsubst %.cc, %.o, $(patsubst %.cpp, %.o, $(CXXFILES)))
all: $(OUTPUT)