phash: process most options and create a c file