Added support for defines and fixed absolute path issue in wam.py