We define this option as 'X'. There are three places needed to be updated.

In main() function:

1. Add one item in static struct option long_options_run[] = {}
	 {"change_directory", required_argument, 0, 'X'},

2. Also add this 'X' in const char *option_string_run
	 const char *option_string_run = "aAB:cC................................X:zZ:";

3. Add the definition of option 'X' in switch statement.
	 case 'X':
	 chdir(optarg);
	 break;

And the 'X' option will work as this: makeflow -X foo Makeflow
This is the latest update of the makeflow chdir option.
To ignore the chdir in some cases, we should do the chdir after those cases.
In main function, only logfile, dag_run, and dag_clean are placed after the chdir. Their results will be written to the new directory.
The other options' outputs, such as debug.o, will be remaining at the current working directory
continued editing on makeflow chdir option
have elimiated the chdir_mode variable and elimiated initializing change_dir as NULL.
update the makeflow man page.
add the chdir option in function "show_help" in makeflow.c
Merge pull request #626 from kangkangli/makeflow_chdir_new

Makeflow Change Dir Option