Say you have some all
target, that is used to build the main stuff:
all: (some dependencies)
(some commands)
To make sure at build-time what flags are used, you can add some dummy dependency:
all: (some dependencies) showflags
(some commands)
showflags:
@echo "CXXFLAGS=$(CXXFLAGS)"
@echo "CPPFLAGS=$(CPPFLAGS)"
At least you will be able to see what options are used.