Skip to content

Commit 20b9c88

Browse files
authored
Merge pull request #5 from Open-Source-Space-Foundation/ngay-build-2
Fix issues with Makefile
2 parents 63e5a4f + ee0766b commit 20b9c88

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

Makefile

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
export VIRTUAL_ENV ?= $(shell pwd)/fprime-venv
2-
31
.PHONY: all
4-
all: submodules fprime-venv zephyr-setup generate-skip-if-exists build
2+
all: submodules fprime-venv zephyr-setup generate-if-needed build
53

64
.PHONY: help
75
help: ## Display this help.
@@ -14,20 +12,24 @@ submodules: ## Initialize and update git submodules
1412
@echo "Initializing and updating git submodules..."
1513
git submodule update --init --recursive
1614

17-
fprime-venv: ## Create a virtual environment
18-
@echo "Creating virtual environment..."
19-
@$(MAKE) uv
20-
@$(UV) venv fprime-venv
21-
@$(UV) pip install --requirement requirements.txt
15+
export VIRTUAL_ENV ?= $(shell pwd)/fprime-venv
16+
fprime-venv: uv ## Create a virtual environment
17+
@test -s $(VIRTUAL_ENV) || { \
18+
echo "Creating virtual environment..."; \
19+
$(UV) venv fprime-venv; \
20+
$(UV) pip install --requirement requirements.txt; \
21+
}
2222

2323
.PHONY: zephyr-setup
24-
zephyr-setup: ## Set up Zephyr environment
25-
@test -s $(lib/zephyr-workspace/tools/edtt/.gitignore) || (echo "Setting up Zephyr environment..." && \
24+
zephyr-setup: uv ## Set up Zephyr environment
25+
@test -s lib/zephyr-workspace/tools/edtt/.gitignore || { \
26+
echo "Setting up Zephyr environment..."; \
2627
cd lib/zephyr-workspace && \
2728
$(UVX) west update && \
2829
$(UVX) west zephyr-export && \
2930
$(UV) run west packages pip --install && \
30-
$(UV) run west sdk install)
31+
$(UV) run west sdk install; \
32+
}
3133

3234
##@ Development
3335

@@ -37,8 +39,9 @@ generate: fprime-venv zephyr-setup ## Generate FPrime-Zephyr Proves Core Referen
3739
$(UV) run fprime-util generate --force
3840

3941
.PHONY: generate-if-needed
42+
BUILD_DIR ?= $(shell pwd)/build-fprime-automatic-zephyr
4043
generate-if-needed:
41-
@test -s $(build-fprime-automatic-zephyr) || $(MAKE) generate
44+
@test -s $(BUILD_DIR) || $(MAKE) generate
4245

4346
.PHONY: build
4447
build: fprime-venv zephyr-setup $(UF2) ## Build FPrime-Zephyr Proves Core Reference
@@ -51,7 +54,7 @@ list-tty: arduino-cli ## List available TTY ports
5154
@$(ARDUINO_CLI) board list | grep "USB" | awk '{print $$1}'
5255

5356
.PHONY: install
54-
UF2 ?= build-fprime-automatic-zephyr/zephyr/zephyr.uf2
57+
UF2 ?= $(BUILD_DIR)/zephyr/zephyr.uf2
5558
install: arduino-cli build ## Install the zephyr firmware onto a connected PROVES Kit, requires BOARD_DIR=[path-to-your-board]
5659
@$(ARDUINO_CLI) config init || true
5760
@$(ARDUINO_CLI) config add board_manager.additional_urls https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

0 commit comments

Comments
 (0)