forked from tralamazza/embedded_zig
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
it's called firmware.ELF thank you very much
- Loading branch information
Daniel Tralamazza
committed
Jun 19, 2019
1 parent
bc6bfd7
commit a16d960
Showing
2 changed files
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,16 @@ MAKEFLAGS += --no-builtin-variables | |
BUILD_FLAGS = --release-small -target thumbv7m-freestanding-none | ||
LINKER_SCRIPT = arm_cm3.ld | ||
OBJS = startup.o main.o | ||
PROG = firmware | ||
|
||
%.o: %.zig | ||
zig build-obj ${BUILD_FLAGS} $< | ||
|
||
firmware: ${OBJS} | ||
# zig build-exe ${BUILD_FLAGS} $(OBJS:%=--object %) --name $@ --linker-script ${LINKER_SCRIPT} | ||
arm-none-eabi-ld ${OBJS} -o $@ -T ${LINKER_SCRIPT} -Map [email protected] --gc-sections | ||
${PROG}: ${OBJS} | ||
# zig build-exe ${BUILD_FLAGS} $(OBJS:%=--object %) --name $@.elf --linker-script ${LINKER_SCRIPT} | ||
arm-none-eabi-ld ${OBJS} -o $@.elf -T ${LINKER_SCRIPT} -Map [email protected] --gc-sections | ||
|
||
clean: | ||
rm -rf firmware firmware.map ${OBJS} $(OBJS:%.o=%.h) zig-cache | ||
rm -rf ${PROG}.* ${OBJS} $(OBJS:%.o=%.h) zig-cache | ||
|
||
.PHONY: clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters