]> mj.ucw.cz Git - home-hw.git/blobdiff - Makefile
Our minimalistic test file with printf
[home-hw.git] / Makefile
index 048f2c7fa61f13a7b2d6b8be5b6101908eb7293d..897b98ecf71c2eb39e0f5e2c4570616c6b024647 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ TARGET = test
 # debug build?
 DEBUG = 1
 # optimization
-OPT = -Og
+OPT = -Os
 
 
 #######################################
@@ -51,9 +51,8 @@ BUILD_DIR = build
 # C sources
 C_SOURCES =  \
 Src/main.c \
-Src/main.c \
-/Src/system_stm32f0xx.c \
-Src/stm32f0xx_it.c \
+Src/test.c \
+Src/system_stm32f0xx.c \
 Src/stm32f0xx_it.c \
 /aux/misc/stm/F0-package/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_exti.c \
 /aux/misc/stm/F0-package/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_usart.c \
@@ -77,7 +76,7 @@ PERIFLIB_SOURCES =
 #######################################
 # binaries
 #######################################
-BINPATH = 
+BINPATH = /usr/bin
 PREFIX = arm-none-eabi-
 CC = $(BINPATH)/$(PREFIX)gcc
 AS = $(BINPATH)/$(PREFIX)gcc -x assembler-with-cpp
@@ -126,7 +125,7 @@ C_INCLUDES =  \
 # compile gcc flags
 ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
 
-CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
+CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -Wextra -Wno-parentheses -Wno-unused -fdata-sections -ffunction-sections
 
 ifeq ($(DEBUG), 1)
 CFLAGS += -g -gdwarf-2
@@ -151,6 +150,9 @@ LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BU
 # default action: build all
 all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
 
+flash: all
+       LD_LIBRARY_PATH=../stlink ../stlink/st-flash write $(BUILD_DIR)/$(TARGET).bin 0x8000000
+
 
 #######################################
 # build the application