-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
36 lines (29 loc) · 859 Bytes
/
Makefile
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
all:
CXXFLAGS += -std=c++20 -Wall -D_DEFAULT_SOURCE
# Comment this line to disable flashing support and don't require https://github.com/wjwwood/serial
HAS_SERIAL = 1
ifeq ($(OS),Windows_NT)
EXE_EXTENSION = .exe
%: %.exe
:
LDLIBS += $(WINDIR)\system32\ws2_32.dll
else
EXE_EXTENSION =
endif
%$(EXE_EXTENSION): %.cpp
$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@
EXECS = package update
ifeq ($(HAS_SERIAL),1)
bootloader_interface.o: bootloader_interface.h
package$(EXE_EXTENSION) bootloader_driver$(EXE_EXTENSION): bootloader_interface.o
package$(EXE_EXTENSION) bootloader_driver$(EXE_EXTENSION): LDLIBS += -lserial
package$(EXE_EXTENSION): CXXFLAGS += -DHAS_SERIAL
EXECS += bootloader_driver
endif
EXECS := $(addsuffix $(EXE_EXTENSION),$(EXECS))
.PHONY: all clean
CXX = g++
all: $(EXECS)
update$(EXE_EXTENSION): LDLIBS += -lfmt
clean:
-rm $(EXECS) *.o