1 Star 0 Fork 22

craboy1/wrktcp

forked from icesky1stm/wrktcp 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
#CFLAGS += -std=c99 -Wall -O2 -D_REENTRANT
CFLAGS += -Wall -std=c99
LIBS := -lm -lpthread
TARGET := $(shell uname -s | tr '[A-Z]' '[a-z]' 2>/dev/null || echo unknown)
ifeq ($(TARGET), sunos)
CFLAGS += -D_PTHREADS -D_POSIX_C_SOURCE=200112L
LIBS += -lsocket
else ifeq ($(TARGET), darwin)
LDFLAGS += -pagezero_size 10000 -image_base 100000000
export MACOSX_DEPLOYMENT_TARGET = $(shell sw_vers -productVersion)
else ifeq ($(TARGET), linux)
CFLAGS += -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE
LIBS += -ldl
LDFLAGS += -Wl,-E
else ifeq ($(TARGET), freebsd)
CFLAGS += -D_DECLARE_C99_LDBL_MATH
LDFLAGS += -Wl,-E
endif
SRC := wrktcp.c net.c aprintf.c stats.c units.c \
ae.c zmalloc.c islog.c tcpini.c istime.c \
output.c isstr.c http_parser.c
BIN := wrktcp
ODIR := obj
OBJ := $(patsubst %.c,$(ODIR)/%.o,$(SRC))
LIBS := $(LIBS)
DEPS :=
CFLAGS += -I$(ODIR)/include
#LDFLAGS += -L$(ODIR)/lib
LDFLAGS +=
all: $(BIN) test
clean:
$(RM) -rf $(BIN) obj/* *.log *.html
cd ./test && make clean
$(BIN): $(OBJ)
@echo LINK $(BIN)
@$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
.PHONY:test
test:
@cd ./test && make clean && make
$(ODIR):
@mkdir -p $@
$(ODIR)/%.o : %.c %.h
@echo CC $<
@$(CC) $(CFLAGS) -c -o $@ $<
.PHONY: all clean
.SUFFIXES:
.SUFFIXES: .c .o
vpath %.c src
vpath %.h src
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/craboy1/wrktcp.git
git@gitee.com:craboy1/wrktcp.git
craboy1
wrktcp
wrktcp
master

搜索帮助