Make工具的用法

==提示==

如果您使用的是MinGW,那么请将bin\mingw32-make.exe复制一份,并改名为make.exe

make模板

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#for GNU gcc

sources = *.cpp
cflags = -std=c++23 -Wall


ifdef windir
target = llist.exe
sanitizer =
RM = del
else
target = llist
sanitizer = -fsanitize=address
RM = rm -f
endif

all:
$(CXX) $(sources) $(cflags) $(sanitizer) -o $(target)

clean:
$(RM) $(target)