<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_arg_file(target, source, env):
 """Create an argument file containing -I and -D arguments to gcc. This file will be passed to gcc using @<path>. """


    output_name = str(target[0])

    with open(output_name, "w") as outfile:
        for define in env.get('CPPDEFINES', []):
            outfile.write(define + '\n')

        include_folders = target[0].RDirs(tuple(env.get('CPPPATH', [])))
        include_folders.append('.')

        for include_folder in include_folders:
            include_folder = str(include_folder)

            if not include_folder.startswith('build'):
                include_folder = os.path.join('firmware', 'src', include_folder)

            outfile.write('"-I{}"\n'.format(include_folder.replace('\\', '\\\\')))