MODELS = muscle_spindle BUILD_DIRS := $(addprefix builds/, $(MODELS)) all: $(BUILD_DIRS) for d in $(BUILD_DIRS); do (cd $$d; "$(MAKE)") || exit $$?; done clean: $(BUILD_DIRS) for d in $(BUILD_DIRS); do (cd $$d; "$(MAKE)" clean) || exit $$?; done