preprocess_headers function

Preprocess a set of header files found under dir