c++ - Makefile weird percent text-pattern behaviour -


good day,

consider following portion of makefile:

objects := $(patsubst %.cpp,%,$(wildcard tests/*.cpp))  test_executable := $(patsubst tests/%, tests/run-%,$(objects))   testf_executable := $(patsubst tests/%, tests/runf-%,$(objects))    all: $(objects)  test: $(test_executable)     test_formatted: $(testf_executable)       runf-%:%     ./$^ --output_format=xml --log_level=test_suite > $(^)-report.xml     run-%:%     ./$^ 

summary:
focus on test_executable, contains list of target object files corresponding c++ files in test/ folder. produces lot of executables want call executables in make test or make test_formatted. so, both test , test_formatted call run , runf , executing executables.

problem:
understanding of runf-% when have run-tests/executable, should match pattern of runf- , % replace tests/executable ./tests/executable should work. not case. when get

make: *** no rule make target `run-tests/executable', needed `test'.  stop. 

i thought pattern should recognized, apparently not. instead accidentally mess around tests running , that's how arrive makefile showed above. in other words, have run- before executable, doesnt makes sense @ all. in case shouldn't work, since run-% have % executable, not being locate executable file. doesnt makes sense. although file in working condition, i'd love if clear concept misunderstandings. in advance.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -