+/rtos
git clone https://git.julia.blue/+/rtos
ee4080a
master
1target = user.elf 2 3CC = arm-none-eabi-gcc 4STRIP = arm-none-eabi-strip 5OBJCPY = arm-none-eabi-objcopy 6 7CFLAGS = -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mthumb -mfloat-abi=hard 8CFLAGS += -nodefaultlibs -nostdlib -nostartfiles -ffreestanding 9CFLAGS += -fdata-sections -ffunction-sections -Wall -pedantic -std=c2x 10CFLAGS += -fpic -msingle-pic-base -mpic-register=r9 -mno-pic-data-is-text-relative 11CFLAGS += -Wl,-z,max-page-size=1# reduces padding after program headers 12CFLAGS += -Wl,--gc-sections -fno-plt -T user.ld -Os -g 13# CFLAGS += -mpoke-function-name # TODO: check if this works for backtraces 14 15all : $( target ) 16 17$( target ): user.c Makefile user.ld 18$( CC ) user.c$( CFLAGS ) -o user_debug.elf 19$( STRIP ) user_debug.elf-o $ @ 20$( OBJCPY ) --remove-section .ARM.attributes--remove-section .comment$ @ 21 22clean : 23 -rm *.elf *.o 24