aboutsummaryrefslogtreecommitdiffstats
path: root/gui/Makefile
blob: e06a740fb957d630e13a2ce39626cdd13ac6d70e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
UNAME := $(shell uname)

ifeq ($(UNAME), Linux)
  RM = rm -f
else
  RM = del
endif

CXX = g++-10
CXXFLAGS = --std=c++20 -ggdb -O0 \
           -Wall -Wextra -pedantic \
           -Wno-deprecated-copy \
           -Iserial/include -IMETL/include -IMETL/dependencies/PEGTL/include

ifeq ($(UNAME), Linux)
CXXFLAGS += $(shell wx-config --cxxflags)
else
CXXFLAGS += -IC:\wx\include -DSTMDSP_WIN32 -Wa,-mbig-obj
endif

ifeq ($(UNAME), Linux)
CXXFILES = serial/src/serial.cc \
           serial/src/impl/unix.cc \
           serial/src/impl/list_ports/list_ports_linux.cc \
           $(wildcard *.cpp)
else
CXXFILES = serial/src/serial.cc \
           serial/src/impl/win.cc \
           serial/src/impl/list_ports/list_ports_win.cc \
           $(wildcard *.cpp)
endif
OFILES = $(patsubst %.cc, %.o, $(patsubst %.cpp, %.o, $(CXXFILES)))

ifeq ($(UNAME), Linux)
LIBS = $(shell wx-config --libs) -lwx_gtk3u_stc-3.1
else
LIBS = -lSetupAPI \
       -LC:\wx\lib\gcc810_x64_dll -lwxbase31u -lwxmsw31u_core -lwxmsw31u_stc
endif

OUTELF = stmdspgui

ifeq ($(UNAME), Linux)
CLEANFILES = $(OUTELF) $(OFILES)
else
CLEANFILES = $(subst /,\\,$(OUTELF)) $(subst /,\\,$(OFILES))
endif

all: $(OUTELF)

$(OUTELF): $(OFILES)
	@echo "  CXX    " $(OUTELF)
	@$(CXX) $(CXXFLAGS) $(OFILES) $(LIBS) -o $(OUTELF)

.cc.o:
	@echo "  CXX    " $<
	@$(CXX) $(CXXFLAGS) -c $< -o $@

.cpp.o:
	@echo "  CXX    " $<
	@$(CXX) $(CXXFLAGS) -c $< -o $@

clean:
	@echo "  CLEAN"
	@$(RM) $(CLEANFILES)