-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (53 loc) · 1.72 KB
/
Makefile
File metadata and controls
66 lines (53 loc) · 1.72 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
66
# ArmAsm-CryptoEngine Makefile
# Top-level build orchestration
.PHONY: all clean test bench examples stm32f4 rpi host help
# Default target
all: stm32f4
# Help target
help:
@echo "ArmAsm-CryptoEngine Build System"
@echo "Available targets:"
@echo " all - Build default target (STM32F4)"
@echo " stm32f4 - Build for STM32F4 (Cortex-M4)"
@echo " rpi - Build for Raspberry Pi (Cortex-A53)"
@echo " host - Build host version for testing"
@echo " test - Run test suite"
@echo " bench - Run benchmarks"
@echo " examples - Build example applications"
@echo " clean - Clean all build artifacts"
@echo " help - Show this help message"
# STM32F4 target
stm32f4:
mkdir -p build/stm32f4
cd build/stm32f4 && cmake -DCMAKE_BUILD_TYPE=Release -DSTM32F4_TARGET=ON ../..
cmake --build build/stm32f4 -j$(shell nproc)
# Raspberry Pi target
rpi:
mkdir -p build/rpi
cd build/rpi && cmake -DCMAKE_BUILD_TYPE=Release -DRPI_TARGET=ON ../..
cmake --build build/rpi -j$(shell nproc)
# Host build for testing
host:
mkdir -p build/host
cd build/host && cmake -DCMAKE_BUILD_TYPE=Debug -DHOST_TESTS=ON ../..
cmake --build build/host -j$(shell nproc)
# Run tests
test: host
cd build/host && ctest --output-on-failure
# Build examples
examples: stm32f4
@echo "Examples built as part of main target"
# Run benchmarks
bench: stm32f4
@echo "Benchmark binary: build/stm32f4/bench/bench_crypto"
# Clean build artifacts
clean:
rm -rf build/
# Development helpers
format:
find include src tests examples -name "*.c" -o -name "*.h" | xargs clang-format -i
lint:
python3 scripts/asm_style.py src/asm/
# Generate test vectors
vectors:
python3 scripts/test_vectors.py > tests/vectors/generated_vectors.h