What you are probably looking for is Target-specific Variable Values. If you carefully read this section of the manual you'll see how they propagate to the prerequisites.
Just to illustrate how they work:
.PHONY: all release debug compile
all:
$(MAKE) release
$(MAKE) debug
release: CXXFLAGS = for rel
debug: CXXFLAGS = for deb
release debug: compile
@echo 'building $@ with CXXFLAGS = $(CXXFLAGS)'
compile: a b c
@echo 'building $@ with CXXFLAGS = $(CXXFLAGS)'
a b c:
@echo 'building $@ with CXXFLAGS = $(CXXFLAGS)'
Demo:
$ make --no-print-directory all
make release
building a with CXXFLAGS = for rel
building b with CXXFLAGS = for rel
building c with CXXFLAGS = for rel
building compile with CXXFLAGS = for rel
building release with CXXFLAGS = for rel
make debug
building a with CXXFLAGS = for deb
building b with CXXFLAGS = for deb
building c with CXXFLAGS = for deb
building compile with CXXFLAGS = for deb
building debug with CXXFLAGS = for deb