-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (49 loc) · 1.12 KB
/
Copy pathMakefile
File metadata and controls
73 lines (49 loc) · 1.12 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# gamepad-viewer/Makefile
all: gamepad-viewer.exe
CXX := g++
CXXFLAGS :=
CXXFLAGS += -g
CXXFLAGS += -Wall
CXXFLAGS += -Werror
CXXFLAGS += -DUNICODE
CXXFLAGS += -std=c++17
# Generate .d files.
CXXFLAGS += -MMD
LDFLAGS :=
LDFLAGS += -g
LDFLAGS += -Wall
LDFLAGS += -municode
# Disable the console window. But note that this disables tracing
# output.
LDFLAGS += -mwindows
# Do not require the winlibs DLLs at runtime.
LDFLAGS += -static
LIBS :=
# Direct2D. For me, the actual file is:
# /d/opt/winlibs-mingw64-13.2/x86_64-w64-mingw32/lib/libd2d1.a.
LIBS += -ld2d1
# DirectWrite. For me the file is libdwrite.a next to libd2d1.a.
LIBS += -ldwrite
# XInput.
LIBS += -lxinput
# For ChooseColor.
LIBS += -lcomdlg32
OBJS :=
OBJS += base-window.o
OBJS += button-timer.o
OBJS += controller-state.o
OBJS += gamepad-viewer.o
OBJS += gpv-config.o
OBJS += resources.o
OBJS += winapi-util.o
-include $(wildcard *.d)
%.o: %.cc
$(CXX) -c -o $@ $(CXXFLAGS) $<
resources.o: gamepad-viewer.rc doc/icon.ico
windres -o $@ $<
gamepad-viewer.exe: $(OBJS)
$(CXX) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
.PHONY: clean
clean:
$(RM) *.o *.d *.exe
# EOF