Skip to content

Commit

Permalink
lld seems to work (yay)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Tralamazza committed Jun 20, 2019
1 parent f9e469b commit 65bb188
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ MAKEFLAGS += --no-builtin-variables

BUILD_FLAGS = --release-small -target thumbv7m-freestanding-none
LINKER_SCRIPT = arm_cm3.ld
OBJS = startup.o main.o
LD_FLAGS = --gc-sections -nostdlib
OBJS = startup.o main.o stm32f10.o core_cm3.o
PROG = firmware

%.o: %.zig
zig build-obj ${BUILD_FLAGS} $<

${PROG}: ${OBJS}
# zig build-exe ${BUILD_FLAGS} $(OBJS:%=--object %) --name [email protected] --linker-script ${LINKER_SCRIPT}
arm-none-eabi-ld ${OBJS} -o [email protected] -T ${LINKER_SCRIPT} -Map [email protected] --gc-sections
zig build-exe ${BUILD_FLAGS} $(OBJS:%=--object %) --name $@.elf --linker-script ${LINKER_SCRIPT}
# arm-none-eabi-ld ${OBJS} -o [email protected] -T ${LINKER_SCRIPT} -Map [email protected] ${LD_FLAGS}

clean:
rm -rf ${PROG}.* ${OBJS} $(OBJS:%.o=%.h) zig-cache
Expand Down

0 comments on commit 65bb188

Please sign in to comment.