build dependencies only if the 'all' target is being built

don't build them is the 'dynamic' target is being used instead