Skip to content

Commit 457f015

Browse files
committed
makefile: export common env for child process
Signed-off-by: Tianhao Wang <[email protected]>
1 parent 8136462 commit 457f015

File tree

3 files changed

+20
-23
lines changed

3 files changed

+20
-23
lines changed

makefile

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#
2-
# OUTPUT PATHS
2+
# variables shared by all child make process
33
#
4-
PREFIX ?= /usr/local
5-
QBIN_DIR ?= $(PREFIX)/bin
6-
QCONFIG_DIR ?= /etc/quark
7-
QLOG_DIR ?= /var/log/quark
8-
4+
export PREFIX ?= /usr/local
5+
export QBIN_DIR ?= $(PREFIX)/bin
6+
export QCONFIG_DIR ?= /etc/quark
7+
export QLOG_DIR ?= /var/log/quark
8+
export ARCH ?= ${shell uname -m}
9+
export RUST_TOOLCHAIN = nightly-2023-12-11-$(ARCH)-unknown-linux-gnu
910
#
10-
# BUILD PATHS
11+
# BUILD PATHS, used by this make process only
1112
#
1213
QKERNEL_BUILD = build
1314
QTARGET_RELEASE = target/release
@@ -18,10 +19,6 @@ QUARK_DEBUG = $(QTARGET_DEBUG)/quark
1819
QUARK_RELEASE = $(QTARGET_RELEASE)/quark
1920
VDSO = vdso/vdso.so
2021

21-
ARCH := ${shell uname -m}
22-
RUST_TOOLCHAIN = nightly-2023-12-11-$(ARCH)-unknown-linux-gnu
23-
24-
2522
.PHONY: all release debug clean install qvisor_release qvisor_debug cuda_make cuda_all cleanall
2623

2724
all:: release debug
@@ -33,16 +30,16 @@ release:: qvisor_release qkernel_release $(VDSO)
3330
debug:: qvisor_debug qkernel_debug $(VDSO)
3431

3532
qvisor_release:
36-
make -C ./qvisor TOOLCHAIN=$(RUST_TOOLCHAIN) release
33+
make -C ./qvisor release
3734

3835
qkernel_release:
39-
make -C ./qkernel TOOLCHAIN=$(RUST_TOOLCHAIN) release
36+
make -C ./qkernel release
4037

4138
qvisor_debug:
42-
make -C ./qvisor TOOLCHAIN=$(RUST_TOOLCHAIN) debug
39+
make -C ./qvisor debug
4340

4441
qkernel_debug:
45-
make -C ./qkernel TOOLCHAIN=$(RUST_TOOLCHAIN) debug
42+
make -C ./qkernel debug
4643

4744
$(VDSO):
4845
make -C ./vdso
@@ -65,10 +62,10 @@ cuda_release:: qvisor_cuda_release qkernel_release cuda_make
6562
cuda_debug:: qvisor_cuda_debug qkernel_debug cuda_make
6663

6764
qvisor_cuda_release:
68-
make -C ./qvisor TOOLCHAIN=$(RUST_TOOLCHAIN) cuda_release
65+
make -C ./qvisor cuda_release
6966

7067
qvisor_cuda_debug:
71-
make -C ./qvisor TOOLCHAIN=$(RUST_TOOLCHAIN) cuda_debug
68+
make -C ./qvisor cuda_debug
7269

7370
install:
7471
-sudo cp -f $(QKERNEL_RELEASE) $(QBIN_DIR)/

qkernel/makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ $(kernel_debug): kernel_debug $(assembly_object_files)
2525
$(assembly_object_files) $(qkernel_debug)
2626

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

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

3333
../build/arch/$(arch)/%.o: src/qlib/kernel/arch/$(arch)/%.s
3434
@mkdir -p $(shell dirname $@)

qvisor/makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
.PHONY: debug release cuda_debug cuda_release
22

33
debug:
4-
CARGO_TARGET_DIR=../target cargo +$(TOOLCHAIN) build
4+
CARGO_TARGET_DIR=../target cargo +$(RUST_TOOLCHAIN) build
55

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

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

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

0 commit comments

Comments
 (0)