Skip to content

Commit d7f9d43

Browse files
feat(makefile): add option to select build profile
Signed-off-by: Anhad Singh <[email protected]>
1 parent e2ae639 commit d7f9d43

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
profile ?= release
2+
3+
ifneq ($(filter $(profile), dev debug), )
4+
KERNEL_TARGET := src/target/x86_64-unknown-none/debug/aero_kernel
5+
else
6+
KERNEL_TARGET := src/target/x86_64-unknown-none/release/aero_kernel
7+
endif
8+
19
jinx:
210
if [ ! -f "target/jinx" ]; then \
311
curl -Lo target/jinx https://github.com/mintsuki/jinx/raw/30e7d5487bff67a66dfba332113157a08a324820/jinx; \
@@ -15,7 +23,6 @@ distro: jinx
1523
SOURCE_DIR := src
1624
USERLAND_DIR := userland
1725
USERLAND_TARGET := builds/userland/target/init
18-
KERNEL_TARGET := src/target/x86_64-unknown-none/release/aero_kernel
1926

2027
.PHONY: clean
2128
clean:
@@ -26,7 +33,7 @@ check:
2633
cd src && cargo check
2734

2835
$(KERNEL_TARGET): $(shell find $(SOURCE_DIR) -type f -not -path '$(SOURCE_DIR)/target/*')
29-
cd src && cargo build --package aero_kernel --release
36+
cd src && cargo build --package aero_kernel --profile $(profile)
3037
./build-support/mkiso.sh
3138

3239
$(USERLAND_TARGET): $(shell find $(USERLAND_DIR) -type f -not -path '$(USERLAND_DIR)/target/*')

0 commit comments

Comments
 (0)