-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (47 loc) · 1.67 KB
/
Makefile
File metadata and controls
65 lines (47 loc) · 1.67 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
64
65
# Top-level Makefile for ThreadX Cortex-R5 demo
#
# Usage:
# make Build for VersatileAB (default)
# make BOARD=zynqmp Build for ZynqMP RPU
# make run Build and run on QEMU
# make run BOARD=zynqmp Build and run ZynqMP on Xilinx QEMU
# make run-gdb Build and run with GDB server (ZynqMP only)
BOARD ?= versatileab
SAMPLE_DIR = cortex-r5-sample
# ThreadX source (cloned on first build)
threadx/common/inc/tx_api.h:
git clone https://github.com/sysprog21/threadx
.DEFAULT_GOAL := all
# --- Build and run ---
all: threadx/common/inc/tx_api.h
$(MAKE) -C $(SAMPLE_DIR) BOARD=$(BOARD)
run: threadx/common/inc/tx_api.h
$(MAKE) -C $(SAMPLE_DIR) BOARD=$(BOARD) run
run-gdb: threadx/common/inc/tx_api.h
$(MAKE) -C $(SAMPLE_DIR) run-zynqmp-gdb
# --- Vendor QEMU (ZynqMP only) ---
build-qemu:
./vendor/build-xilinx-qemu.sh
# --- Tooling ---
smoke: all
cargo run --manifest-path xtask/Cargo.toml -- smoke
size: all
cargo run --manifest-path xtask/Cargo.toml -- size
BINDGEN_OUT = target/armv7r-none-eabihf/release/build
bindgen: threadx/common/inc/tx_api.h
cd $(SAMPLE_DIR) && cargo build --release --features threadx-sys/bindgen
cp $$(ls -t $$(find $(BINDGEN_OUT) -path '*/threadx-sys-*/out/bindings.rs') | head -1) \
threadx-sys/src/bindings.rs
# --- Maintenance ---
clean:
$(MAKE) -C $(SAMPLE_DIR) clean
cargo clean --manifest-path xtask/Cargo.toml 2>/dev/null || true
indent:
(cd threadx-sys ; cargo fmt)
(cd $(SAMPLE_DIR) ; cargo fmt)
(cd xtask ; cargo fmt)
distclean: clean
rm -f $(SAMPLE_DIR)/Cargo.lock
rm -f xtask/Cargo.lock
-rm -rf threadx
.PHONY: all run run-gdb build-qemu smoke size bindgen clean indent distclean