加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 832 Bytes
一键复制 编辑 原始数据 按行查看 历史
Sami Niiranen 提交于 2017-11-03 13:06 . Force app compilation
CPPFLAGS = -I include -Wall -Werror -pthread
src = $(wildcard src/*.c)
obj = $(patsubst src/%.c, build/%.o, $(src))
headers = $(wildcard include/*.h)
apps = apps/curl/curl
lvl-ip: $(obj)
$(CC) $(CFLAGS) $(CPPFLAGS) $(obj) -o lvl-ip
@echo
@echo "lvl-ip needs CAP_NET_ADMIN:"
sudo setcap cap_setpcap,cap_net_admin=ep lvl-ip
build/%.o: src/%.c ${headers}
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
debug: CFLAGS+= -DDEBUG_SOCKET -DDEBUG_TCP -g -fsanitize=thread
debug: lvl-ip
apps: $(apps)
$(MAKE) -C tools
$(MAKE) -C apps/curl
$(MAKE) -C apps/curl-poll
all: lvl-ip apps
test: debug apps
@echo
@echo "Networking capabilites are required for test dependencies:"
which arping | sudo xargs setcap cap_net_raw=ep
which tc | sudo xargs setcap cap_net_admin=ep
@echo
cd tests && ./test-run-all
clean:
rm build/*.o lvl-ip
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化