-
-
Notifications
You must be signed in to change notification settings - Fork 161
/
Makefile
48 lines (38 loc) · 1.03 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
# ------------------------------------------------------------
# SPDX-License-Identifier: GPL-3.0-or-later
# -------------------------------------------------------------
# Build File : Makefile
# File Authors : Aoran Zeng <[email protected]>
# Created On : <2023-08-28>
# Last Modified : <2024-09-10>
# ---------------------------------------------------------------
CFLAGS = -Iinclude # -Wall
# 只有Windows会定义该变量
ifeq ($(OS), Windows_NT)
CLANG_FLAGS = -Target x86_64-pc-windows-gnu
endif
ifeq ($(CC), clang)
CFLAGS += $(CLANG_FLAGS)
endif
ifeq ($(shell uname), Linux)
CFLAGS += -static
endif
Target = chsrc
CI_Build_Name = chsrc
#=======================
all:
@$(CC) src/chsrc-main.c $(CFLAGS) -o $(Target)
@echo; echo Compile done using \'$(CC)\' $(CFLAGS)
CI: all
@mv $(Target) $(CI_Build_Name)
test: $(Target)
@perl ./test/cli.pl
fastcheck: $(Target)
@perl ./test/cli.pl fastcheck
test-xy:
@$(CC) test/xy.c $(CFLAGS) -o xy
@./xy
clean:
-@rm *.exe 2>/dev/null
-@rm xy 2>/dev/null
-@rm chsrc 2>/dev/null