Skip to content

Commit a9d9275

Browse files
committed
Add a Makefile to easily compile examples/codegen.rs to assembly.
1 parent 10911d6 commit a9d9275

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Makefile useful during development.
2+
# `make asm` compiles examples/codegen.rs to assembly.
3+
# The output can then be reviewed for correctness.
4+
5+
NV?=nightly
6+
override FLAGS += -Z build-std=core -Z build-std-features=panic_immediate_abort --release
7+
MCU?=avr-atmega328p
8+
AVR_CPU_FREQUENCY_HZ?=16000000
9+
export AVR_CPU_FREQUENCY_HZ
10+
11+
build:
12+
cargo +$(NV) build $(FLAGS) --target=$(MCU).json -v
13+
cargo +$(NV) build --example codegen $(FLAGS) --target=$(MCU).json -v
14+
15+
asm:
16+
cargo +$(NV) rustc --example codegen $(FLAGS) --target=$(MCU).json -- --emit asm
17+
@echo target/$(MCU)/release/examples/*.s
18+
19+
asmclean:
20+
-rm target/*/release/deps/*.s

0 commit comments

Comments
 (0)