Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Maintenance: Build improvements all over the place
- Fix broken PlatformIO examples - Sort PlatformIO dependencies - Silence: Use `pip --quiet install platformio` everywhere - Remove deprecated `monitor_speed` setting from PlatformIO settings
- Loading branch information
Showing
34 changed files
with
205 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,66 @@ | ||
.DEFAULT_GOAL := build | ||
|
||
$(eval venvpath := $(PWD)/.venv) | ||
$(eval python := $(venvpath)/bin/python) | ||
$(eval pip := $(venvpath)/bin/pip) | ||
$(eval pio := $(venvpath)/bin/pio) | ||
|
||
export PLATFORMIO_WORKSPACE_DIR := $(PWD)/.pio | ||
export BUILD_DIR := $(PWD)/.build | ||
|
||
|
||
# ================================================== | ||
# Build all examples for all PlatformIO environments | ||
# ================================================== | ||
|
||
setup-virtualenv: | ||
@test -e $(python) || python3 -m venv $(venvpath) | ||
$(pip) --quiet install platformio | ||
|
||
build: setup-virtualenv | ||
cd json; $(pio) run --project-conf=../platformio.ini # --verbose | ||
cd csv; $(pio) run --project-conf=../platformio.ini # --verbose | ||
cd urlencoded; $(pio) run --project-conf=../platformio.ini # --verbose | ||
PLATFORMIO_SRC_DIR=csv $(pio) run # --verbose | ||
PLATFORMIO_SRC_DIR=json $(pio) run # --verbose | ||
PLATFORMIO_SRC_DIR=urlencoded $(pio) run # --verbose | ||
|
||
upload: setup-virtualenv | ||
$(pio) run --target upload --upload-port=${MCU_PORT} | ||
|
||
run: | ||
mkdir -p build | ||
|
||
# ================================== | ||
# Build and run all examples (POSIX) | ||
# ================================== | ||
|
||
posix-build: | ||
./compile csv/csv_basic.cpp | ||
./compile json/json_basic.cpp | ||
./compile urlencoded/urlencoded_basic.cpp | ||
@echo | ||
|
||
./build/csv_basic | ||
posix-run: posix-build | ||
${BUILD_DIR}/csv_basic | ||
@echo | ||
./build/json_basic | ||
${BUILD_DIR}/json_basic | ||
@echo | ||
./build/urlencoded_basic | ||
${BUILD_DIR}/urlencoded_basic | ||
@echo | ||
|
||
setup-virtualenv: | ||
@test -e $(python) || `command -v virtualenv` --python=python3 $(venvpath) | ||
$(pip) install platformio | ||
run: posix-run | ||
|
||
|
||
# ========================================= | ||
# Build and run individual examples (POSIX) | ||
# ========================================= | ||
|
||
$(BUILD_DIR)/csv_basic: | ||
./compile csv/csv_basic.cpp | ||
$(BUILD_DIR)/json_basic: | ||
./compile json/json_basic.cpp | ||
$(BUILD_DIR)/urlencoded_basic: | ||
./compile urlencoded/urlencoded_basic.cpp | ||
|
||
csv: $(BUILD_DIR)/csv_basic | ||
$(BUILD_DIR)/csv_basic | ||
json: $(BUILD_DIR)/json_basic | ||
$(BUILD_DIR)/json_basic | ||
urlencoded: $(BUILD_DIR)/urlencoded_basic | ||
$(BUILD_DIR)/urlencoded_basic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.