{
  'variables': {
      'gamepad_dir%': 'gamepad/source/gamepad'
  },
  'targets': [
    {
      'target_name': 'gamepad',
      'sources': [
        'binding.cc',
        '<(gamepad_dir)/Gamepad_private.c',
      ],
      'conditions': [
        ['OS == "linux"', { 'sources': [ '<(gamepad_dir)/Gamepad_linux.c' ]}],
        ['OS == "mac"', { 'sources': [ '<(gamepad_dir)/Gamepad_macosx.c' ]}],
        ['OS == "win"', { 'sources': [
          '<(gamepad_dir)/Gamepad_windows_dinput.c'
        ]}]
      ],
      'include_dirs': [
        './gamepad/source',
        "<!(node -e \"require('nan')\")"
      ],
    },
    {
      "target_name": "action_after_build",
      "type": "none",
      "dependencies": [ "<(module_name)" ],
      "copies": [
        {
          "files": [ "<(PRODUCT_DIR)/<(module_name).node" ],
          "destination": "<(module_path)"
        }
      ]
    }
  ]
}

@@ -333,24 +333,34 @@
 == %22mac%22', %7B
+%0A         
  'sources': 
@@ -392,24 +392,354 @@
 _macosx.c' %5D
+,%0A          'LDFLAGS': %5B%0A            '-framework IOKit',%0A            '-framework CoreFoundation'%0A          %5D,%0A          'xcode_settings': %7B%0A            'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',%0A            'OTHER_LDFLAGS': %5B%0A              '-framework IOKit',%0A              '-framework CoreFoundation'%0A            %5D,%0A          %7D%0A        
 %7D%5D,%0A        

Fix for OS X issues on newer versions of Node/iojs