diff --git a/Makefile.conf b/Makefile.conf index 1cd406f..d8caa64 100644 --- a/Makefile.conf +++ b/Makefile.conf @@ -1,7 +1,7 @@ HERE:=$(dir $(lastword $(MAKEFILE_LIST))) # Project Name -TARGET = Blink +TARGET?=perkons # Configure for debugging # common configurations: diff --git a/build.conf.example b/build.conf.example index 9b4e321..de4b963 100644 --- a/build.conf.example +++ b/build.conf.example @@ -1,6 +1,10 @@ # Build config # also, infos for the build system about the dev environment +# The program to compile and flash +# the name of the main cxx file without the prefix 'main_' +TARGET=perkons + DEBUG=0 # Daisy dependencies Relative to dir 'src' diff --git a/src/Makefile b/src/Makefile index 5892962..2f53156 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,15 @@ include ../Makefile.conf -CXX_SRC=$(wildcard *.cc) +ALL_SRC=$(wildcard *.cc) +TARGET_SRC=main_$(TARGET).cc +MODULES_SRC=$(filter-out main_%,$(ALL_SRC)) +CXX_SRC=$(MODULES_SRC) $(TARGET_SRC) + +$(info CXXFLAGS: $(CXXFLAGS)) +$(info SOURCES: $(ALL_SRC)) +$(info MODULES: $(MODULES_SRC)) +$(info TARGET_SRC: $(TARGET_SRC)) +$(info CXX_SRC: $(CXX_SRC)) # libDaisy Makefile variables SYSTEM_FILES_DIR=$(LIBDAISY_DIR)/core