use File::Find; find sub { if (($a = $_) =~ s/\.c$/.o/ && -M $_ <= -M $a) { print "compiling $_ to $a\n"; system qw(gcc -c -o), $a, $_; } }, '.';