build: use formal recursive flag inside for loops