diff --git a/Makefile.conf b/Makefile.conf new file mode 100644 index 0000000..da37ed3 --- /dev/null +++ b/Makefile.conf @@ -0,0 +1,21 @@ +-include build.conf + +FLASH_TARGET ?= main_osp +DEBUG ?= 0 + +LIBDAISY_DIR ?= ../../heck_libDaisy +DAISYSP_DIR ?= ../../heck_DaisySP + +#LIBDIZZY_DIR ?= ../src/ +#CXXFLAGS += -I$(LIBDIZZY_DIR) +#LDFLAGS += -L$(LIBDIZZY_DIR) +#LDFLAGS += -ldizzy + +CXX_STANDARD ?= -std=c++17 +CXXFLAGS += -Wall -Wno-unused -Wno-reorder-ctor -Wno-switch +CXXFLAGS += \ + -fdiagnostics-color=always \ + -fmessage-length=170 \ + -fdiagnostics-path-format=inline-events \ + -fdiagnostics-show-template-tree \ + diff --git a/build.conf.example b/build.conf.example index bd3ecf0..c886222 100644 --- a/build.conf.example +++ b/build.conf.example @@ -3,9 +3,9 @@ # remove this line, and tweak the values as you develop # The program to compile and flash -# the name of the main cxx file without the prefix 'main_' +# the name of the main cxx file without the suffix -TARGET ?= osp +#FLASH_TARGET ?= main_osp DEBUG ?= 0 # dependencies relative to dir 'src' diff --git a/src/Makefile b/src/Makefile index 7419e9f..8461114 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,21 +1,7 @@ --include ../build.conf +HERE:=$(dir $(lastword $(MAKEFILE_LIST))) +include $(HERE)../Makefile.conf -TARGET ?= osp -DEBUG ?= 0 -LIBDAISY_DIR ?= ../../heck_libDaisy -DAISYSP_DIR ?= ../../heck_DaisySP +#TARGET_LIB = -CXX_STANDARD ?= -std=c++17 -CXXFLAGS += -Wall -Wno-unused -Wno-reorder-ctor -Wno-switch -CXXFLAGS += -fdiagnostics-color=always - - -# Eval all sources with exactly one main() based on TARGET -ALL_SRC = $(wildcard *.cc) -TARGET_SRC = main_$(TARGET).cc -MODULES_SRC = $(filter-out main_%,$(ALL_SRC)) -CXX_SRC = $(MODULES_SRC) $(TARGET_SRC) - -CXX_SOURCES = $(CXX_SRC) - -include $(LIBDAISY_DIR)/core/Makefile \ No newline at end of file +SOURCES := $(wildcard *) +include $(LIBDAISY_DIR)/core/Makefile