diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index bf2def7..2d88e43 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -67,6 +67,8 @@ # - Allow the punter to specify boards.txt file # and parser independently (after Peplin on github) # - Support user libraries (Peplin's patch) +# - Remove main.cpp if NO_CORE_MAIN_CPP is +# defined (ex Peplin) # ######################################################################## # @@ -308,6 +310,11 @@ ifeq ($(strip $(NO_CORE)),) ifdef ARDUINO_CORE_PATH CORE_C_SRCS = $(wildcard $(ARDUINO_CORE_PATH)/*.c) CORE_CPP_SRCS = $(wildcard $(ARDUINO_CORE_PATH)/*.cpp) + +ifneq ($(strip $(NO_CORE_MAIN_CPP)),) +CORE_CPP_SRCS := $(filter-out %main.cpp, $(CORE_CPP_SRCS)) +endif + CORE_OBJ_FILES = $(CORE_C_SRCS:.c=.o) $(CORE_CPP_SRCS:.cpp=.o) CORE_OBJS = $(patsubst $(ARDUINO_CORE_PATH)/%, \ $(OBJDIR)/%,$(CORE_OBJ_FILES))