-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
64 lines (55 loc) · 1.11 KB
/
makefile
File metadata and controls
64 lines (55 loc) · 1.11 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
# flags
CC = x86_64-w64-mingw32-gcc
CFLAGS = -Wall -lws2_32
LFLAGS = -lws2_32
# args
RELEASE = 0
BITS = 64
CPU = default # ryzen1,ryzen2,default
# files
TARGET = highio
OBJS = asynet.o client.o main.o server.o
# in posix system , it is rm -rf
RM = del /f
# [Binary Type] = debug:0,realse:1.
ifeq ($(RELEASE),0)
# debug
CFLAGS += -g -Wno-unused-but-set-variable
LFLAGS += -g -Wno-unused-but-set-variable
else
# release
CFLAGS += -static -O3 -DNDEBUG
LFLAGS += -static
endif
# [System Type] = 32: 32 bit system, 64:64 bit system.
ifeq ($(BITS),32)
CFLAGS += -m32
LFLAGS += -m32
else
ifeq ($(BITS),64)
CFLAGS += -m64
LFLAGS += -m64
else
endif
endif
#[CPU Type]
ifeq ($(CPU),ryzen1)
CFLAGS += -march=znver1
LFLAGS += -march=znver1
else
ifeq ($(CPU),ryzen2)
CFLAGS += -march=znver2
LFLAGS += -march=znver2
else
CFLAGS += -march=native
LFLAGS += -march=native
endif
endif
.PHONY : all clean
all : $(TARGET)
$(TARGET):$(OBJS)
$(CC) -o $(TARGET) $(OBJS) $(LFLAGS)
$(OBJS):%.o:%.c
$(CC) -c $(CFLAGS) $< -o $@
clean :
$(RM) $(OBJS) $(addsuffix .exe,$(TARGET))