Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

1.8 KB
Raw Blame
WEED := ./weed
VEC := ./weed-vector
CLI := ./weed-vector-cli
WORKER_MANIFEST := ../../rust/sw-vector-distributed/Cargo.toml
ifneq ($(wildcard $(WORKER_MANIFEST)),)
WORKER := ./weed-vector-worker
endif
VOLUME := ./weed-volume
LANCE_WORKER := ./weed-worker
CARGO_PROFILE ?= release
CARGO_TARGET_DIR ?= $(abspath ../../seaweed-vector/target)
override CARGO_TARGET_DIR := $(abspath $(CARGO_TARGET_DIR))
CARGO_OUTPUT := $(CARGO_TARGET_DIR)/$(if $(filter dev,$(CARGO_PROFILE)),debug,$(CARGO_PROFILE))
export CARGO_TARGET_DIR

.PHONY: all test perf build clean FORCE

all: test

$(WEED): FORCE
	go build -o $(WEED) ../../weed

$(VEC): FORCE
	cd ../../seaweed-vector && cargo build --locked --profile $(CARGO_PROFILE) -p weed-vector-server
	cp $(CARGO_OUTPUT)/weed-vector $(VEC)

$(CLI): FORCE
	cd ../../seaweed-vector && cargo build --locked --profile $(CARGO_PROFILE) -p weed-vector-core --bin weed-vector-cli
	cp $(CARGO_OUTPUT)/weed-vector-cli $(CLI)

$(LANCE_WORKER): FORCE
	cargo build --locked --profile $(CARGO_PROFILE) --manifest-path ../../seaweed-worker/Cargo.toml -p weed-lance-worker --bin weed-worker
	cp $(CARGO_OUTPUT)/weed-worker $(LANCE_WORKER)

ifneq ($(WORKER),)
$(WORKER): $(VEC) FORCE
	cargo build --locked --profile $(CARGO_PROFILE) --manifest-path ../../rust/Cargo.toml -p sw-vector-distributed --bin weed-vector
	cp $(CARGO_OUTPUT)/weed-vector $(WORKER)
endif

$(VOLUME): $(VEC) $(WORKER) FORCE
	cargo build --locked --profile $(CARGO_PROFILE) --manifest-path ../../seaweed-volume/Cargo.toml --bin weed-volume
	cp $(CARGO_OUTPUT)/weed-volume $(VOLUME)

FORCE:

build: $(WEED) $(VEC) $(WORKER) $(VOLUME)
ifneq ($(VECTOR_WORKER),)
build: $(CLI) $(LANCE_WORKER)
endif

test: build
	./run_test.sh

perf: build $(CLI)
	./run_perf.sh

clean:
	rm -f $(WEED) $(VEC) $(CLI) $(LANCE_WORKER) ./weed-vector-worker $(VOLUME)