-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (38 loc) · 1.29 KB
/
Copy pathMakefile
File metadata and controls
51 lines (38 loc) · 1.29 KB
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
.PHONY: all release clean sanitize
all: scbattery-monitor
release: all
sanitize: all
CXXFLAGS = -std=c++20 -Wall -Werror
DEBUG_FLAGS := -g -Og
RELEASE_FLAGS := -O2
SANITIZER_FLAGS = -fsanitize=address,undefined -fno-omit-frame-pointer
ifeq ($(filter sanitize,$(MAKECMDGOALS)), sanitize)
CXXFLAGS += $(DEBUG_FLAGS)
CXXFLAGS += $(SANITIZER_FLAGS)
CXXFLAGS += -DSANITIZER_BUILD
else ifeq ($(filter release,$(MAKECMDGOALS)), release)
CXXFLAGS += $(RELEASE_FLAGS)
IS_RELEASE = 1
else
CXXFLAGS += $(DEBUG_FLAGS)
endif
ifeq ($(OS),Windows_NT)
HIDAPI_PKG ?= hidapi
ifeq ($(IS_RELEASE),1)
LDFLAGS += -mwindows
endif
else
HIDAPI_PKG ?= hidapi-hidraw
CXXFLAGS += -fPIC -pie
endif
QT_PKG := Qt6Widgets Qt6DBus
CXXFLAGS += $(shell pkg-config --cflags $(HIDAPI_PKG))
CXXFLAGS += $(shell pkg-config --cflags $(QT_PKG))
LDLIBS += $(shell pkg-config --libs $(HIDAPI_PKG))
LDLIBS += $(shell pkg-config --libs $(QT_PKG))
TRITON_SRC := $(wildcard TritonLib/src/*.cpp TritonLib/src/*/*.cpp TritonLib/src/*.c TritonLib/src/*/*.c)
BATTERYMON_SRC := $(wildcard src/*.cpp src/*/*.cpp src/*.c src/*/*.c)
scbattery-monitor: $(BATTERYMON_SRC) $(TRITON_SRC)
g++ -ITritonLib/include -o scbattery-monitor $^ $(CXXFLAGS) $(LDFLAGS) $(LDLIBS)
clean:
rm -f scbattery-monitor scbattery-monitor.exe qrc_resources.cpp