-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (37 loc) · 1.23 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
SUBDIRS := module
TOPTARGETS := all clean
PWD := $(shell pwd)
OUT := downloads
REDIS_SOURCE := https://github.com/redis/redis/archive/refs/tags/7.0.5.zip
REDIS_NAME := redis-7.0.5
REDIS_ZIP_NAME := 7.0.5
REDIS_PATH := $(REDIS_NAME)
REDIS := redis
$(TOPTARGETS): $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@ $(MAKECMDGOALS)
config:
sed -i "s#DEFAULT_CONFIG_PATH \".*\"#DEFAULT_CONFIG_PATH \"$(PWD)/fastio\.conf\"#" module/include/esca.h
ln -s $(shell pwd)/wrapper/$(TARGET).c wrapper/target-preload.c
reload:
sudo dmesg -C
-sudo rmmod mlioo
sudo insmod module/mlioo.ko
format:
find module/ -iname *.h -o -iname *.c -type f | xargs clang-format -i -style=WebKit
find wrapper/ -iname *.h -o -iname *.c -type f | xargs clang-format -i -style=WebKit
find echo/ -iname *.h -o -iname *.c -type f | xargs clang-format -i -style=WebKit
redis:
@echo "download redis..."
wget $(REDIS_SOURCE)
unzip $(REDIS_ZIP_NAME).zip
rm $(REDIS_ZIP_NAME).zip
cd $(REDIS_PATH) && patch -p2 -i ../patches/redis.patch
cd $(REDIS_PATH) && make redis-server -j$(nproc)
clean-out:
rm -rf $(OUT)
rm -rf local
rm -rf auth
recover:
git checkout HEAD -- configs/nginx.conf wrapper/ngx.c module/include/esca.h fastio.conf
.PHONY: $(TOPTARGETS) $(SUBDIRS) $(NGX) $(LIGHTY)