Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Arduino.mk
Original file line number Diff line number Diff line change
Expand Up @@ -762,12 +762,12 @@ endif
########################################################################
# Local sources

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excited to see this!

May I suggest:

Suggested change
SRC_DIR ?= $(dir $(realpath $(firstword $(MAKEFILE_LIST))))

This would default SRC_DIR to the location of the users Makefile. Since it would then always be defined, you could then print it in configuration vars without it being weird and use slash notation in your wildcard searches (if you cared to).

LOCAL_C_SRCS ?= $(wildcard *.c)
LOCAL_CPP_SRCS ?= $(wildcard *.cpp)
LOCAL_CC_SRCS ?= $(wildcard *.cc)
LOCAL_PDE_SRCS ?= $(wildcard *.pde)
LOCAL_INO_SRCS ?= $(wildcard *.ino)
LOCAL_AS_SRCS ?= $(wildcard *.S)
LOCAL_C_SRCS ?= $(wildcard $(SRC_DIR)*.c)
LOCAL_CPP_SRCS ?= $(wildcard $(SRC_DIR)*.cpp)
LOCAL_CC_SRCS ?= $(wildcard $(SRC_DIR)*.cc)
LOCAL_PDE_SRCS ?= $(wildcard $(SRC_DIR)*.pde)
LOCAL_INO_SRCS ?= $(wildcard $(SRC_DIR)*.ino)
LOCAL_AS_SRCS ?= $(wildcard $(SRC_DIR)*.S)
LOCAL_SRCS = $(LOCAL_C_SRCS) $(LOCAL_CPP_SRCS) \
$(LOCAL_CC_SRCS) $(LOCAL_PDE_SRCS) \
$(LOCAL_INO_SRCS) $(LOCAL_AS_SRCS)
Expand Down