From 8f7405f9090d655aec9aef0142171379e048f37a Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 7 Apr 2013 19:53:11 +0000 Subject: tests: more flexible parallel build logic --- tests/Makefile | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/Makefile b/tests/Makefile index 1a6bb22..1db7654 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,12 +1,8 @@ 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) +# DO NOT STARE AT THE SUN +all: +%:; $(MAKE) `printf '%s_$@_ ' $(SUBDIRS)` +_words = $(subst _, ,$1) +_dir = $(firstword $(call _words,$@)) +_targ = $(lastword $(call _words,$@)) +%_:; $(MAKE) -C $(_dir) $(_targ) -- cgit v1.2.3-65-gdbad