diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 32 |
1 files changed, 21 insertions, 11 deletions
@@ -1,26 +1,36 @@ +CXX = g++ + CXXFILES := \ source/serial/src/serial.cc \ - source/serial/src/impl/unix.cc \ - source/serial/src/impl/list_ports/list_ports_linux.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))) +CXXFLAGS := -std=c++20 -O2 \ + -Isource -Isource/imgui -Isource/stmdsp -Isource/serial/include \ + -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 -#CXXFLAGS := -std=c++20 -O2 \ -# -Isource -Isource/imgui -Isource/stmdsp -Isource/serial/include -CXXFLAGS := -std=c++20 -ggdb -O0 -g3 \ - -Isource -Isource/imgui -Isource/stmdsp -Isource/serial/include \ - -Wall -Wextra -pedantic +OFILES := $(patsubst %.cc, %.o, $(patsubst %.cpp, %.o, $(CXXFILES))) all: $(OUTPUT) $(OUTPUT): $(OFILES) @echo " LD " $(OUTPUT) - @g++ $(OFILES) -o $(OUTPUT) -lSDL2 -lGL -lpthread + @$(CXX) $(OFILES) -o $(OUTPUT) $(LDFLAGS) clean: @echo " CLEAN" @@ -28,9 +38,9 @@ clean: %.o: %.cpp @echo " CXX " $< - @g++ $(CXXFLAGS) -c $< -o $@ + @$(CXX) $(CXXFLAGS) -c $< -o $@ %.o: %.cc @echo " CXX " $< - @g++ $(CXXFLAGS) -c $< -o $@ + @$(CXX) $(CXXFLAGS) -c $< -o $@ |