diff --git a/Makefile b/Makefile index a533403..2cb48ca 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,24 @@ -PROJECT = main -BUILD_DIR = bin +PROJECT := main +BUILD_DIR := bin -CFILES = main.c +# CFILES := main.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) +VPATH += $(SHARED_DIR) INCLUDES += $(patsubst %,-I%, . $(SHARED_DIR)) -OPENCM3_DIR=./libopencm3 include $(OPENCM3_DIR)/mk/genlink-config.mk include ./rules.mk