Created
September 10, 2018 04:58
-
-
Save ntavish/a0bba0f4924a71c2f12524f30aa3f7d7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
PREFIX := arm-none-eabi- | |
CFLAGS += -mcpu=cortex-m4 -mthumb -g3 -o0 | |
LDFLAGS += ${CFLAGS} -nostartfiles -nodefaultlibs -Wl,-Tlinker.ld | |
all: build.elf build.hex | |
main.o: main.c | |
${PREFIX}gcc ${CFLAGS} -c main.c -o main.o | |
startup.o: startup.c | |
${PREFIX}gcc ${CFLAGS} -c startup.c -o startup.o | |
build.elf: main.o startup.o linker.ld | |
${PREFIX}gcc ${LDFLAGS} main.o startup.o -o build.elf | |
build.hex: build.elf | |
${PREFIX}objcopy -O ihex build.elf build.hex | |
.PHONY: clean | |
clean: | |
rm build.elf *.o |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment