ensure objdir exists before creating files in it