-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (48 loc) · 1.71 KB
/
Makefile
File metadata and controls
63 lines (48 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
LINUX_DIR = examples/linux
ESP_DIR = examples/esp32
LINUX_BUILD_DIR = $(LINUX_DIR)/build
ESP_BUILD_DIR = $(ESP_DIR)/build
.PHONY: all linux esp32 clean clean-linux clean-esp32 flash run help
all: linux esp32
# --- Linux Targets ---
linux:
@echo "========================================"
@echo " Building Linux Application..."
@echo "========================================"
@mkdir -p $(LINUX_BUILD_DIR)
@# We add EXPORT_COMPILE_COMMANDS so clangd works!
@cd $(LINUX_BUILD_DIR) && cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .. && make
run: linux
@echo "Running Linux App..."
@./$(LINUX_BUILD_DIR)/linux_app
clean-linux:
@echo "Cleaning Linux Build..."
@rm -rf $(LINUX_BUILD_DIR)
# --- ESP32 Targets ---
esp32:
@echo "========================================"
@echo " Building ESP32 Firmware..."
@echo "========================================"
@# This assumes you have already sourced esp-idf/export.sh
@cd $(ESP_DIR) && idf.py build
flash:
@echo "Flashing ESP32..."
@cd $(ESP_DIR) && idf.py -p /dev/ttyUSB0 flash monitor
menuconfig:
@cd $(ESP_DIR) && idf.py menuconfig
clean-esp32:
@echo "Cleaning ESP32 Build..."
@# We use rm -rf instead of idf.py fullclean for speed and to match your request
@rm -rf $(ESP_BUILD_DIR)
# --- Global Targets ---
clean: clean-linux clean-esp32
@echo "All build directories removed."
help:
@echo "Available commands:"
@echo " make - Build both Linux and ESP32"
@echo " make clean - Remove build folders for both"
@echo " make linux - Build only Linux"
@echo " make run - Build and Run Linux app"
@echo " make esp32 - Build only ESP32"
@echo " make flash - Flash and Monitor ESP32"
@echo " make menuconfig- Open ESP32 configuration"