Change PRINT_* to Makefile functions, fixing #4165