ifneq (,$(LOCALDIRS))
# cxxtest fails to find its standard includes with LOCALDIRS enabled
SUBDIRS = $(filter-out cxxtest,$(subst /Makefile,,$(wildcard */Makefile)))
else
SUBDIRS = $(subst /Makefile,,$(wildcard */Makefile))
endif

all rom ram config clean: $(SUBDIRS)

clobber reallyclean: $(SUBDIRS)
	rm -f *[#~]

$(SUBDIRS):
	@echo "==== $@ ===="
	@$(MAKE) -C $@ SBD=$(SBD) $(MAKECMDGOALS)

# Obsolete dummy depend target, this is now handled automagically.
depend:

.PHONY: all rom ram depend clean clobber reallyclean $(SUBDIRS)
