1# Copyright (c) 2010 Google Inc. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5{
6  'targets': [
7    # This first target generates a header.
8    {
9      'target_name': 'generate_header',
10      'type': 'none',
11      'msvs_cygwin_shell': '0',
12      'actions': [
13        {
14          'action_name': 'generate header',
15          'inputs': [],
16          'outputs': ['<(SHARED_INTERMEDIATE_DIR)/generated/header.h'],
17          'action': [
18            'python', '-c', 'open(<(_outputs), "w")'
19          ]
20        },
21      ],
22      'all_dependent_settings': {
23        'include_dirs': [
24          '<(SHARED_INTERMEDIATE_DIR)',
25        ],
26      },
27    },
28
29    # This intermediate target does nothing other than pull in a
30    # dependency on the above generated target.
31    {
32      'target_name': 'chain',
33      'type': 'none',
34      'dependencies': [
35        'generate_header',
36      ],
37    },
38
39    # This final target is:
40    # - a static library (so gyp doesn't transitively pull in dependencies);
41    # - that relies on the generated file two dependencies away.
42    {
43      'target_name': 'chained',
44      'type': 'static_library',
45      'dependencies': [
46        'chain',
47      ],
48      'sources': [
49        'chained.c',
50      ],
51    },
52  ],
53}
54