Skip to content

Commit

Permalink
Add make defconfig & oldconfig, cache AX_ROOT
Browse files Browse the repository at this point in the history
  • Loading branch information
equation314 committed Dec 25, 2024
1 parent 57c8074 commit 63dc6f7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/.vscode
/.arceos
/.cargo
/.axconfig.*
/.axroot
.DS_Store
Cargo.lock
*.o
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
A ?= rust/helloworld
AX_ROOT ?= $(PWD)/.arceos
AX_ROOT ?= $(shell cat .axroot 2>/dev/null)

APP := $(A)
ifeq ($(filter /%,$(A)),)
Expand All @@ -8,12 +8,14 @@ ifeq ($(filter /%,$(A)),)
endif
endif

$(if $(V), $(info AX_ROOT: "$(AX_ROOT)"))

all: build

ax_root:
chaxroot:
@./scripts/set_ax_root.sh $(AX_ROOT)

build run justrun debug disasm disk_img clean clean_c: ax_root
defconfig oldconfig build run justrun debug disasm disk_img clean clean_c:
@make -C $(AX_ROOT) A=$(APP) $@

test:
Expand Down
3 changes: 0 additions & 3 deletions scripts/get_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@ AX_ROOT=.arceos
test ! -d "$AX_ROOT" && echo "Cloning repositories ..." || true
test ! -d "$AX_ROOT" && git clone https://github.com/arceos-org/arceos "$AX_ROOT" --depth=1 || true

echo "Copying Cargo.lock ..."
cp "$AX_ROOT/Cargo.lock" Cargo.lock

$(dirname $0)/set_ax_root.sh $AX_ROOT
3 changes: 3 additions & 0 deletions scripts/set_ax_root.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ mkdir -p .cargo
sed -e "s|%AX_ROOT%|$AX_ROOT|g" scripts/config.toml.temp > .cargo/config.toml

echo "Set AX_ROOT (ArceOS directory) to $AX_ROOT"

cp "$AX_ROOT/Cargo.lock" Cargo.lock
echo "$1" > .axroot

0 comments on commit 63dc6f7

Please sign in to comment.