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:
I'm not exactly sure what versions this feature is supported in, but you can use the order-only
feature:
my_target: dep1 dep2 | must_run_1st must_run_2nd
All dependencies left of the |
character are processed as normal. Dependencies to the right of |
are run 'order-only'
This feature is described at:
https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html
In your case, the following rules definition would suffice:
release: | clean test1
test1: | clean