Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 23 additions & 26 deletions makefile
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a condition to check which files to copy over? It is annoying to get false negatives. I have a (semi) fix for that in the previous version, maybe do something similar.

Cheers

Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#
# OUTPUT PATHS
# variables shared by all child make process
#
PREFIX ?= /usr/local
QBIN_DIR ?= $(PREFIX)/bin
QCONFIG_DIR ?= /etc/quark
QLOG_DIR ?= /var/log/quark

export PREFIX ?= /usr/local
export QBIN_DIR ?= $(PREFIX)/bin
export QCONFIG_DIR ?= /etc/quark
export QLOG_DIR ?= /var/log/quark
export ARCH ?= ${shell uname -m}
export RUST_TOOLCHAIN = nightly-2023-12-11-$(ARCH)-unknown-linux-gnu
#
# BUILD PATHS
# BUILD PATHS, used by this make process only
#
QKERNEL_BUILD = build
QTARGET_RELEASE = target/release
Expand All @@ -18,10 +19,6 @@ QUARK_DEBUG = $(QTARGET_DEBUG)/quark
QUARK_RELEASE = $(QTARGET_RELEASE)/quark
VDSO = vdso/vdso.so

ARCH := ${shell uname -m}
RUST_TOOLCHAIN = nightly-2023-12-11-$(ARCH)-unknown-linux-gnu


.PHONY: all release debug clean install qvisor_release qvisor_debug cuda_make cuda_all cleanall

all:: release debug
Expand All @@ -33,16 +30,16 @@ release:: qvisor_release qkernel_release $(VDSO)
debug:: qvisor_debug qkernel_debug $(VDSO)

qvisor_release:
make -C ./qvisor TOOLCHAIN=$(RUST_TOOLCHAIN) release
make -C ./qvisor release

qkernel_release:
make -C ./qkernel TOOLCHAIN=$(RUST_TOOLCHAIN) release
make -C ./qkernel release

qvisor_debug:
make -C ./qvisor TOOLCHAIN=$(RUST_TOOLCHAIN) debug
make -C ./qvisor debug

qkernel_debug:
make -C ./qkernel TOOLCHAIN=$(RUST_TOOLCHAIN) debug
make -C ./qkernel debug

$(VDSO):
make -C ./vdso
Expand All @@ -65,21 +62,21 @@ cuda_release:: qvisor_cuda_release qkernel_release cuda_make
cuda_debug:: qvisor_cuda_debug qkernel_debug cuda_make

qvisor_cuda_release:
make -C ./qvisor TOOLCHAIN=$(RUST_TOOLCHAIN) cuda_release
make -C ./qvisor cuda_release

qvisor_cuda_debug:
make -C ./qvisor TOOLCHAIN=$(RUST_TOOLCHAIN) cuda_debug
make -C ./qvisor cuda_debug

install:
-sudo cp -f $(QKERNEL_RELEASE) $(QBIN_DIR)/
-sudo cp -f $(QUARK_RELEASE) $(QBIN_DIR)/quark
-sudo cp -f $(QUARK_RELEASE) $(QBIN_DIR)/containerd-shim-quark-v1
-sudo cp -f $(QKERNEL_DEBUG) $(QBIN_DIR)/
-sudo cp -f $(QUARK_DEBUG) $(QBIN_DIR)/quark_d
-sudo cp -f $(QUARK_DEBUG) $(QBIN_DIR)/containerd-shim-quarkd-v1
sudo cp -f $(VDSO) $(QBIN_DIR)/vdso.so
sudo mkdir -p $(QCONFIG_DIR)
sudo cp -f config.json $(QCONFIG_DIR)
-cp -f $(QKERNEL_RELEASE) $(QBIN_DIR)/
-cp -f $(QUARK_RELEASE) $(QBIN_DIR)/quark
-cp -f $(QUARK_RELEASE) $(QBIN_DIR)/containerd-shim-quark-v1
-cp -f $(QKERNEL_DEBUG) $(QBIN_DIR)/
-cp -f $(QUARK_DEBUG) $(QBIN_DIR)/quark_d
-cp -f $(QUARK_DEBUG) $(QBIN_DIR)/containerd-shim-quarkd-v1
cp -f $(VDSO) $(QBIN_DIR)/vdso.so
mkdir -p $(QCONFIG_DIR)
cp -f config.json $(QCONFIG_DIR)

cuda_make:
make -C cudaproxy release
Expand Down
4 changes: 2 additions & 2 deletions qkernel/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ $(kernel_debug): kernel_debug $(assembly_object_files)
$(assembly_object_files) $(qkernel_debug)

kernel:
CARGO_TARGET_DIR=../target cargo +$(TOOLCHAIN) xbuild --target $(arch)-qkernel.json --release
CARGO_TARGET_DIR=../target cargo +$(RUST_TOOLCHAIN) xbuild --target $(arch)-qkernel.json --release

kernel_debug:
CARGO_TARGET_DIR=../target cargo +$(TOOLCHAIN) xbuild --target $(arch)-qkernel.json
CARGO_TARGET_DIR=../target cargo +$(RUST_TOOLCHAIN) xbuild --target $(arch)-qkernel.json

../build/arch/$(arch)/%.o: src/qlib/kernel/arch/$(arch)/%.s
@mkdir -p $(shell dirname $@)
Expand Down
8 changes: 4 additions & 4 deletions qvisor/makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.PHONY: debug release cuda_debug cuda_release

debug:
CARGO_TARGET_DIR=../target cargo +$(TOOLCHAIN) build
CARGO_TARGET_DIR=../target cargo +$(RUST_TOOLCHAIN) build

release:
CARGO_TARGET_DIR=../target cargo +$(TOOLCHAIN) build --release
CARGO_TARGET_DIR=../target cargo +$(RUST_TOOLCHAIN) build --release

cuda_debug:
CARGO_TARGET_DIR=../target cargo +$(TOOLCHAIN) build --features cuda
CARGO_TARGET_DIR=../target cargo +$(RUST_TOOLCHAIN) build --features cuda

cuda_release:
CARGO_TARGET_DIR=../target cargo +$(TOOLCHAIN) build --release --features cuda
CARGO_TARGET_DIR=../target cargo +$(RUST_TOOLCHAIN) build --release --features cuda