modify some detail code for debug info output and create a new makefile for macosx