I have the following piece of makefile:
CXXFLAGS = -std=c++0x -Wall SRCS = test1.cpp test2.cpp OBJDIR = object OBJS = $(SRCS:%.cpp=$(OBJDIR)/%.o) all:
For a solution without a recursive invocation of make, you could try this.
ifneq ($(filter release,$(MAKECMDGOALS)),) test1: clean endif