From 528fd712c262fc01a604b5672a9e1cbae8099ad6 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Sun, 12 Apr 2020 22:32:10 +0200 Subject: [PATCH] Remove dependency on libopencm-examples and prettify Makefile a bit --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 96cbb55..8c4e287 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,13 @@ OPENCM3_DIR := libopencm3 -EXAMPLE_DIR = /home/ledoian/Development/STM32/libopencm3-examples/libopencm3-examples/examples/stm32/f1/stm32vl-discovery -#EXAMPLE_DIR = /home/ledoian/libopencm3-examples/libopencm3-examples/examples/stm32/f1/stm32vl-discovery +# NB: Not exhaustive, some still hardcoded. +CPU_FLAGS := -mthumb -mcpu=cortex-m3 -msoft-float -mfix-cortex-m3-ldrd %.o: %.c - arm-none-eabi-gcc -Os -g -Wextra -fno-common -ffunction-sections -fdata-sections -MD -Wall -Wundef -I $(OPENCM3_DIR)/include -D STM32F1 -mthumb -mcpu=cortex-m3 -msoft-float -mfix-cortex-m3-ldrd -c $*.c -o $*.o + arm-none-eabi-gcc -Os -g -Wextra -fno-common -ffunction-sections -fdata-sections -Wall -Wundef -I $(OPENCM3_DIR)/include -D STM32F1 ${CPU_FLAGS} -c $*.c -o $*.o %.elf: %.o - arm-none-eabi-gcc --static -nostartfiles -L $(OPENCM3_DIR)/lib -T $(EXAMPLE_DIR)/stm32vl-discovery.ld -Wl,-Map=$*.map -Wl,--gc-sections -mthumb -mcpu=cortex-m3 -msoft-float -mfix-cortex-m3-ldrd $*.o -l opencm3_stm32f1 -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group -o $*.elf + arm-none-eabi-gcc --static -nostartfiles -L $(OPENCM3_DIR)/lib -T $(OPENCM3_DIR)/lib/stm32/f1/stm32f100xb.ld -Wl,-Map=$*.map -Wl,--gc-sections ${CPU_FLAGS} $*.o -l opencm3_stm32f1 -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group -o $*.elf %.bin: %.elf arm-none-eabi-objcopy -Obinary $*.elf $*.bin