34 lines
893 B
Makefile
34 lines
893 B
Makefile
PROJECT := main
|
|
BUILD_DIR := bin
|
|
|
|
ifneq ($(wildcard /etc/fedora-release),)
|
|
NEWLIB?=/usr/arm-none-eabi/include
|
|
else
|
|
NEWLIB?=/usr/include/newlib
|
|
endif
|
|
|
|
CFLAGS += -I$(NEWLIB)
|
|
LDFLAGS += -Wl,-Map=main.map
|
|
|
|
# CFILES := main.c system.c
|
|
CFILES += $(wildcard *.c)
|
|
OPENCM3_DIR := ./libopencm3
|
|
|
|
# Check if libopencm3 is available before including anything
|
|
ifeq ("$(wildcard $(OPENCM3_DIR)/Makefile)","")
|
|
$(info libopencm3 not found. Initializing git submodule...)
|
|
$(shell git submodule update --init --recursive)
|
|
$(info Don't forget to 'make -C libopencm3')
|
|
endif
|
|
|
|
# TODO - you will need to edit these two lines!
|
|
DEVICE=STM32F103C6
|
|
# OOCD_FILE = board/stm32f4discovery.cfg
|
|
|
|
# You shouldn't have to edit anything below here.
|
|
VPATH += $(SHARED_DIR)
|
|
INCLUDES += $(patsubst %,-I%, . $(SHARED_DIR))
|
|
|
|
include $(OPENCM3_DIR)/mk/genlink-config.mk
|
|
include ./rules.mk
|
|
include $(OPENCM3_DIR)/mk/genlink-rules.mk
|