aboutsummaryrefslogtreecommitdiffstats
path: root/tools/mk/autobuild.mk
blob: 1e2410d730b18001665f76717439675b7610bfd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Source files located under $(AUTOBUILD_ROOT) are automatically added.
ifeq ($(AUTOBUILD_ROOT),)
  AUTOBUILD_ROOT := ./source/
endif

rwildcard    = $(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
AUTOCSRC    := $(call rwildcard,$(AUTOBUILD_ROOT),*.c)
AUTOCPPSRC  := $(call rwildcard,$(AUTOBUILD_ROOT),*.cpp)
AUTOASMSRC  := $(call rwildcard,$(AUTOBUILD_ROOT),*.s)
AUTOXASMSRC := $(call rwildcard,$(AUTOBUILD_ROOT),*.S)
AUTOINC     := $(sort $(dir $(call rwildcard,$(AUTOBUILD_ROOT),*)))

# Shared variables.
ALLCSRC     += $(AUTOCSRC)
ALLCPPSRC   += $(AUTOCPPSRC)
ALLASMSRC   += $(AUTOASMSRC)
ALLXASMSRC  += $(AUTOXASMSRC)
ALLINC      += $(AUTOINC)