8000 Add smaller ASM version and Makefile clean target by acd407 · Pull Request #1 · tchajed/minimal-elf · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
# compiled
/tiny_c
/tiny_asm
/tiny_asm_opt
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
all: tiny_c tiny_asm tiny
ALL_TARGETS = tiny_c tiny_asm tiny_asm_opt tiny

all: $(ALL_TARGETS)

tiny_c: tiny.c
clang -O2 -static $< -o $@
Expand All @@ -7,5 +9,12 @@ tiny_asm: tiny.s
clang -nostartfiles -nostdlib -static $< -o $@
strip $@

tiny_asm_opt: tiny.s
clang -s -Wl,--build-id=none -z noseparate-code -nostartfiles -nostdlib -static $< -o $@
objcopy --strip-section-headers $@ $@

tiny: src/main.rs
cargo run

clean:
rm -f $(ALL_TARGETS)
0