Build redis

master
Jiajie Chen 6 years ago
parent e60682ae32
commit a62056dd8b

@ -27,7 +27,7 @@ cmake_build_args += -DCMAKE_BUILD_TYPE=Release
endif
.PHONY: all clean build rust ucore biscuit bin busybox nginx
.PHONY: all clean build rust ucore biscuit bin busybox nginx redis
all: build
@ -81,7 +81,12 @@ ifneq ($(shell uname), Darwin)
@cp nginx/build/$(arch)/nginx $(out_dir)/nginx
endif
build: rust ucore biscuit $(busybox) nginx
redis:
@cd redis && make arch=$(arch) all
@cp redis/build/$(arch)/redis-server $(out_dir)/redis-server
@cp redis/build/$(arch)/redis-cli $(out_dir)/redis-cli
build: rust ucore biscuit $(busybox) nginx redis
sfsimg: $(out_qcow2)

2
redis/.gitignore vendored

@ -0,0 +1,2 @@
build/
src/*.tar.gz

@ -0,0 +1,42 @@
redis_version := 5.0.3
redis_tarball := redis-$(redis_version).tar.gz
redis_tarball_path := src/redis-$(redis_version).tar.gz
build_dir := build/$(arch)
redis_dir := $(build_dir)/redis-$(redis_version)
cc := $(arch)-linux-musl-gcc
strip := $(arch)-linux-musl-strip
bin_server_unstripped := build/$(arch)/redis-server-unstripped
bin_server := build/$(arch)/redis-server
bin_cli_unstripped := build/$(arch)/redis-cli-unstripped
bin_cli := build/$(arch)/redis-cli
$(redis_tarball_path):
wget http://download.redis.io/releases/$(redis_tarball) -O $(redis_tarball_path)
$(redis_dir): $(redis_tarball_path)
mkdir -p $(build_dir)
cd $(build_dir) && tar xvf ../../$(redis_tarball_path)
$(redis_dir)/src/redis-server: $(redis_dir)
cd $(redis_dir) && make CC=$(cc) MALLOC=libc
$(bin_server_unstripped): $(redis_dir)/src/redis-server
cp $(redis_dir)/src/redis-server $(bin_server_unstripped)
$(bin_server): $(bin_server_unstripped)
cp $(bin_server_unstripped) $(bin_server)
$(strip) $(bin_server)
$(bin_cli_unstripped): $(redis_dir)/src/redis-cli
cp $(redis_dir)/src/redis-cli $(bin_cli_unstripped)
$(bin_cli): $(bin_cli_unstripped)
cp $(bin_cli_unstripped) $(bin_cli)
$(strip) $(bin_cli)
.PHONY: all clean
all: $(bin_server) $(bin_cli)
clean:
rm -rf build/$(arch)
Loading…
Cancel
Save