aboutsummaryrefslogtreecommitdiff
blob: 1a6bb226b015ee5b8ee876d87fe5345eeddacc56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
SUBDIRS = $(patsubst %/Makefile,%,$(wildcard */Makefile))

.PHONY: all test check clean
all test check clean:
	$(MAKE) $(patsubst %,subdir_%_$@,$(SUBDIRS))

# subdir_source_all
_SUBTAR = $(patsubst subdir_%,%,$@)
_SUBDIR = $(shell expr $(_SUBTAR) : '\(.*\)_[^_]*$$')
_TARGET = $(shell expr $(_SUBTAR) : '.*_\([^_]*\)$$')
subdir_%:
	$(MAKE) -C $(_SUBDIR) $(_TARGET)