Can the target Makefile invoke commands even if the precondition is not met?

Here is the skeleton Makefile to simplify the description of the problem:

all_tests : unit_tests other_tests_1 other_tests_2 ... other_tests_N

unit_tests : set1_summary.txt set2_summary.txt ... setN_summary.txt

%_summary.txt : %_details.txt
    perl createSummary.pl --in $^ -out $@

%_details.txt : test_harness
    ./test_harness --test-set $*

So, I have a test runner that creates a file with detailed results, and then a filtering mechanism to create a summary file.

Now the test runner application returns an error code if any of the elements in the test set fails, which will cause the "all_tests" target to stop correctly and will never call the other_test target. However, I would like to accurately perform the details β†’ summary transformation, since this is important even for a failed test run.

, , , - Perl script, script.

, , "" , . - GNU Make-based ?

+3
2

, Make , :

.PHONY: test
test :
    make all_tests ; make summary

, make / , , $? shell.

+2

, test_harness , - (. ). , make , "" , "".

createSummary.pl , , "" . make, , createSummary.pl , .

+4

Source: https://habr.com/ru/post/1763039/


All Articles