Hi Maxim - I think so much depends on the details of a given project that I lack ideas for something to do in general.
One possibility that occurs to me in your case is to turn your automake conditional into a make conditional, instead of mixing them. Another possibility might be to move the make-specific stuff out of the automake conditional and simplify away the +=, as in something like: ifdef WITH_SLOW_TESTS SLOW_TESTS = $(SH_TESTS_SLOW) else SLOW_TESTS = endif # WITH_SLOW_TESTS if CAN_RUN_TESTS .. TESTS = $(SH_TESTS) $(SLOW_TESTS) endif CAN_RUN_TESTS No real idea if it will avoid the other problems you had. I guess I'm going to close this for lack of any way forward, but feel free to reply/reopen or open a new issue if desired. --thanks, karl.