summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/rules/src
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/python/gyp/test/rules/src
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/python/gyp/test/rules/src')
-rw-r--r--third_party/python/gyp/test/rules/src/actions.gyp23
-rw-r--r--third_party/python/gyp/test/rules/src/an_asm.S6
-rw-r--r--third_party/python/gyp/test/rules/src/as.bat7
-rwxr-xr-xthird_party/python/gyp/test/rules/src/copy-file.py11
-rw-r--r--third_party/python/gyp/test/rules/src/external/external.gyp66
-rw-r--r--third_party/python/gyp/test/rules/src/external/file1.in1
-rw-r--r--third_party/python/gyp/test/rules/src/external/file2.in1
-rw-r--r--third_party/python/gyp/test/rules/src/input-root.gyp24
-rw-r--r--third_party/python/gyp/test/rules/src/noaction/file1.in1
-rw-r--r--third_party/python/gyp/test/rules/src/noaction/no_action_with_rules_fails.gyp37
-rwxr-xr-xthird_party/python/gyp/test/rules/src/rule.py17
-rw-r--r--third_party/python/gyp/test/rules/src/somefile.ext0
-rw-r--r--third_party/python/gyp/test/rules/src/special-variables.gyp34
-rw-r--r--third_party/python/gyp/test/rules/src/subdir1/executable.gyp37
-rw-r--r--third_party/python/gyp/test/rules/src/subdir1/function1.in6
-rw-r--r--third_party/python/gyp/test/rules/src/subdir1/function2.in6
-rw-r--r--third_party/python/gyp/test/rules/src/subdir1/program.c12
-rw-r--r--third_party/python/gyp/test/rules/src/subdir2/both_rule_and_action_input.gyp50
-rw-r--r--third_party/python/gyp/test/rules/src/subdir2/file1.in1
-rw-r--r--third_party/python/gyp/test/rules/src/subdir2/file2.in1
-rw-r--r--third_party/python/gyp/test/rules/src/subdir2/never_used.gyp31
-rw-r--r--third_party/python/gyp/test/rules/src/subdir2/no_action.gyp38
-rw-r--r--third_party/python/gyp/test/rules/src/subdir2/no_inputs.gyp32
-rw-r--r--third_party/python/gyp/test/rules/src/subdir2/none.gyp33
-rw-r--r--third_party/python/gyp/test/rules/src/subdir2/program.c12
-rw-r--r--third_party/python/gyp/test/rules/src/subdir3/executable2.gyp37
-rw-r--r--third_party/python/gyp/test/rules/src/subdir3/function3.in6
-rw-r--r--third_party/python/gyp/test/rules/src/subdir3/program.c10
-rw-r--r--third_party/python/gyp/test/rules/src/subdir4/asm-function.assem10
-rw-r--r--third_party/python/gyp/test/rules/src/subdir4/build-asm.gyp49
-rw-r--r--third_party/python/gyp/test/rules/src/subdir4/program.c19
31 files changed, 618 insertions, 0 deletions
diff --git a/third_party/python/gyp/test/rules/src/actions.gyp b/third_party/python/gyp/test/rules/src/actions.gyp
new file mode 100644
index 0000000000..84376a7193
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/actions.gyp
@@ -0,0 +1,23 @@
+# Copyright (c) 2011 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'pull_in_all_actions',
+ 'type': 'none',
+ 'dependencies': [
+ 'subdir1/executable.gyp:*',
+ 'subdir2/both_rule_and_action_input.gyp:*',
+ 'subdir2/never_used.gyp:*',
+ 'subdir2/no_inputs.gyp:*',
+ 'subdir2/no_action.gyp:*',
+ 'subdir2/none.gyp:*',
+ 'subdir3/executable2.gyp:*',
+ 'subdir4/build-asm.gyp:*',
+ 'external/external.gyp:*',
+ ],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/rules/src/an_asm.S b/third_party/python/gyp/test/rules/src/an_asm.S
new file mode 100644
index 0000000000..eeb1345550
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/an_asm.S
@@ -0,0 +1,6 @@
+// Copyright (c) 2012 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Fake asm file.
+int main() {}
diff --git a/third_party/python/gyp/test/rules/src/as.bat b/third_party/python/gyp/test/rules/src/as.bat
new file mode 100644
index 0000000000..903c31a726
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/as.bat
@@ -0,0 +1,7 @@
+@echo off
+:: Copyright (c) 2011 Google Inc. All rights reserved.
+:: Use of this source code is governed by a BSD-style license that can be
+:: found in the LICENSE file.
+
+:: Fake assembler for Windows
+cl /TP /c %1 /Fo%2
diff --git a/third_party/python/gyp/test/rules/src/copy-file.py b/third_party/python/gyp/test/rules/src/copy-file.py
new file mode 100755
index 0000000000..7bdfbfd4bd
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/copy-file.py
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+import sys
+
+contents = open(sys.argv[1], 'r').read()
+open(sys.argv[2], 'w').write(contents)
+
+sys.exit(0)
diff --git a/third_party/python/gyp/test/rules/src/external/external.gyp b/third_party/python/gyp/test/rules/src/external/external.gyp
new file mode 100644
index 0000000000..b28174f57c
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/external/external.gyp
@@ -0,0 +1,66 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Test that the case where there are no inputs (other than the
+# file the rule applies to).
+{
+ 'target_defaults': {
+ 'msvs_cygwin_dirs': ['../../../../../../<(DEPTH)/third_party/cygwin'],
+ },
+ 'targets': [
+ {
+ 'target_name': 'external_rules',
+ 'type': 'none',
+ 'sources': [
+ 'file1.in',
+ 'file2.in',
+ ],
+ 'conditions': [
+ ['OS=="win"', {
+ 'dependencies': [
+ 'cygwin',
+ ],
+ }],
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'copy_file',
+ 'extension': 'in',
+ 'msvs_external_rule': 1,
+ 'outputs': [
+ '<(RULE_INPUT_ROOT).external_rules.out',
+ ],
+ 'action': [
+ 'python', '../copy-file.py', '<(RULE_INPUT_PATH)', '<@(_outputs)',
+ ],
+ },
+ ],
+ },
+ ],
+ 'conditions': [
+ ['OS=="win"', {
+ 'targets': [
+ {
+ 'target_name': 'cygwin',
+ 'type': 'none',
+ 'actions': [
+ {
+ 'action_name': 'setup_mount',
+ 'msvs_cygwin_shell': 0,
+ 'inputs': [
+ '../../../../../../<(DEPTH)/third_party/cygwin/setup_mount.bat',
+ ],
+ # Visual Studio requires an output file, or else the
+ # custom build step won't run.
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/_always_run_setup_mount.marker',
+ ],
+ 'action': ['<@(_inputs)'],
+ },
+ ],
+ },
+ ],
+ }],
+ ],
+}
diff --git a/third_party/python/gyp/test/rules/src/external/file1.in b/third_party/python/gyp/test/rules/src/external/file1.in
new file mode 100644
index 0000000000..86ac3ad389
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/external/file1.in
@@ -0,0 +1 @@
+Hello from file1.in
diff --git a/third_party/python/gyp/test/rules/src/external/file2.in b/third_party/python/gyp/test/rules/src/external/file2.in
new file mode 100644
index 0000000000..bf83d8ecec
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/external/file2.in
@@ -0,0 +1 @@
+Hello from file2.in
diff --git a/third_party/python/gyp/test/rules/src/input-root.gyp b/third_party/python/gyp/test/rules/src/input-root.gyp
new file mode 100644
index 0000000000..b6600e767c
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/input-root.gyp
@@ -0,0 +1,24 @@
+# Copyright (c) 2011 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test',
+ 'type': 'executable',
+ 'sources': [ 'somefile.ext', ],
+ 'rules': [{
+ 'rule_name': 'rule',
+ 'extension': 'ext',
+ 'inputs': [ 'rule.py', ],
+ 'outputs': [ '<(RULE_INPUT_ROOT).cc', ],
+ 'action': [ 'python', 'rule.py', '<(RULE_INPUT_ROOT)', ],
+ 'message': 'Processing <(RULE_INPUT_PATH)',
+ 'process_outputs_as_sources': 1,
+ # Allows the test to run without hermetic cygwin on windows.
+ 'msvs_cygwin_shell': 0,
+ }],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/rules/src/noaction/file1.in b/third_party/python/gyp/test/rules/src/noaction/file1.in
new file mode 100644
index 0000000000..86ac3ad389
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/noaction/file1.in
@@ -0,0 +1 @@
+Hello from file1.in
diff --git a/third_party/python/gyp/test/rules/src/noaction/no_action_with_rules_fails.gyp b/third_party/python/gyp/test/rules/src/noaction/no_action_with_rules_fails.gyp
new file mode 100644
index 0000000000..9b6a65629f
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/noaction/no_action_with_rules_fails.gyp
@@ -0,0 +1,37 @@
+# Copyright (c) 2012 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Test the case where there's no action but there are input rules that should
+# be processed results in a gyp failure.
+{
+ 'targets': [
+ {
+ 'target_name': 'extension_does_match_sources_but_no_action',
+ 'type': 'none',
+ 'msvs_cygwin_shell': 0,
+ 'sources': [
+ 'file1.in',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'assembled',
+ 'extension': 'in',
+ 'outputs': [
+ '<(RULE_INPUT_ROOT).in',
+ ],
+ 'conditions': [
+ # Always fails.
+ [ '"true"=="false"', {
+ 'action': [
+ 'python', '../copy-file.py', '<(RULE_INPUT_PATH)', '<@(_outputs)',
+ ],
+ 'process_outputs_as_sources': 1,
+ 'message': 'test_rule',
+ }],
+ ],
+ },
+ ],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/rules/src/rule.py b/third_party/python/gyp/test/rules/src/rule.py
new file mode 100755
index 0000000000..8a1f36dedb
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/rule.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+# Copyright (c) 2011 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import sys
+
+f = open(sys.argv[1] + ".cc", "w")
+f.write("""\
+#include <stdio.h>
+
+int main() {
+ puts("Hello %s");
+ return 0;
+}
+""" % sys.argv[1])
+f.close()
diff --git a/third_party/python/gyp/test/rules/src/somefile.ext b/third_party/python/gyp/test/rules/src/somefile.ext
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/somefile.ext
diff --git a/third_party/python/gyp/test/rules/src/special-variables.gyp b/third_party/python/gyp/test/rules/src/special-variables.gyp
new file mode 100644
index 0000000000..d1443af5ba
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/special-variables.gyp
@@ -0,0 +1,34 @@
+# Copyright (c) 2012 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'targets': [
+ {
+ 'rules': [
+ {
+ 'rule_name': 'assembler (gnu-compatible)',
+ 'msvs_cygwin_shell': 0,
+ 'msvs_quote_cmd': 0,
+ 'extension': 'S',
+ 'inputs': [
+ 'as.bat',
+ ],
+ 'outputs': [
+ '$(IntDir)/$(InputName).obj',
+ ],
+ 'action': [
+ 'as.bat',
+ '$(InputPath)',
+ '$(IntDir)/$(InputName).obj',
+ ],
+ 'message': 'Building assembly language file $(InputPath)',
+ 'process_outputs_as_sources': 1,
+ },
+ ],
+ 'target_name': 'test',
+ 'type': 'static_library',
+ 'sources': [ 'an_asm.S' ],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/rules/src/subdir1/executable.gyp b/third_party/python/gyp/test/rules/src/subdir1/executable.gyp
new file mode 100644
index 0000000000..c34cce5a92
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir1/executable.gyp
@@ -0,0 +1,37 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'program',
+ 'type': 'executable',
+ 'msvs_cygwin_shell': 0,
+ 'sources': [
+ 'program.c',
+ 'function1.in',
+ 'function2.in',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'copy_file',
+ 'extension': 'in',
+ 'inputs': [
+ '../copy-file.py',
+ ],
+ 'outputs': [
+ # TODO: fix Make to support generated files not
+ # in a variable-named path like <(INTERMEDIATE_DIR)
+ #'<(RULE_INPUT_ROOT).c',
+ '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).c',
+ ],
+ 'action': [
+ 'python', '<(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)',
+ ],
+ 'process_outputs_as_sources': 1,
+ },
+ ],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/rules/src/subdir1/function1.in b/third_party/python/gyp/test/rules/src/subdir1/function1.in
new file mode 100644
index 0000000000..60ff28949b
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir1/function1.in
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void function1(void)
+{
+ printf("Hello from function1.in\n");
+}
diff --git a/third_party/python/gyp/test/rules/src/subdir1/function2.in b/third_party/python/gyp/test/rules/src/subdir1/function2.in
new file mode 100644
index 0000000000..0fcfc03fdb
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir1/function2.in
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void function2(void)
+{
+ printf("Hello from function2.in\n");
+}
diff --git a/third_party/python/gyp/test/rules/src/subdir1/program.c b/third_party/python/gyp/test/rules/src/subdir1/program.c
new file mode 100644
index 0000000000..6b11ff9f67
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir1/program.c
@@ -0,0 +1,12 @@
+#include <stdio.h>
+
+extern void function1(void);
+extern void function2(void);
+
+int main(void)
+{
+ printf("Hello from program.c\n");
+ function1();
+ function2();
+ return 0;
+}
diff --git a/third_party/python/gyp/test/rules/src/subdir2/both_rule_and_action_input.gyp b/third_party/python/gyp/test/rules/src/subdir2/both_rule_and_action_input.gyp
new file mode 100644
index 0000000000..e5e6f3ec2b
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir2/both_rule_and_action_input.gyp
@@ -0,0 +1,50 @@
+# Copyright (c) 2014 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Tests that if a rule input is also an action input, both the rule and action
+# are executed
+{
+ 'targets': [
+ {
+ 'target_name': 'files_both_rule_and_action_input',
+ 'type': 'executable',
+ 'msvs_cygwin_shell': 0,
+ 'sources': [
+ 'program.c',
+ 'file1.in',
+ 'file2.in',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'copy_file',
+ 'extension': 'in',
+ 'inputs': [
+ '../copy-file.py',
+ ],
+ 'outputs': [
+ '<(RULE_INPUT_ROOT).out4',
+ ],
+ 'action': [
+ 'python', '<(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)',
+ ],
+ },
+ ],
+ 'actions': [
+ {
+ 'action_name': 'copy_file1_in',
+ 'inputs': [
+ '../copy-file.py',
+ 'file1.in',
+ ],
+ 'outputs': [
+ 'file1.copy',
+ ],
+ 'action': [
+ 'python', '<@(_inputs)', '<(_outputs)'
+ ],
+ },
+ ],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/rules/src/subdir2/file1.in b/third_party/python/gyp/test/rules/src/subdir2/file1.in
new file mode 100644
index 0000000000..86ac3ad389
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir2/file1.in
@@ -0,0 +1 @@
+Hello from file1.in
diff --git a/third_party/python/gyp/test/rules/src/subdir2/file2.in b/third_party/python/gyp/test/rules/src/subdir2/file2.in
new file mode 100644
index 0000000000..bf83d8ecec
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir2/file2.in
@@ -0,0 +1 @@
+Hello from file2.in
diff --git a/third_party/python/gyp/test/rules/src/subdir2/never_used.gyp b/third_party/python/gyp/test/rules/src/subdir2/never_used.gyp
new file mode 100644
index 0000000000..17f6f55371
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir2/never_used.gyp
@@ -0,0 +1,31 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Test that the case where there is a rule that doesn't apply to anything.
+{
+ 'targets': [
+ {
+ 'target_name': 'files_no_input2',
+ 'type': 'none',
+ 'msvs_cygwin_shell': 0,
+ 'sources': [
+ 'file1.in',
+ 'file2.in',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'copy_file3',
+ 'extension': 'in2',
+ 'outputs': [
+ '<(RULE_INPUT_ROOT).out3',
+ ],
+ 'action': [
+ 'python', '../copy-file.py', '<(RULE_INPUT_PATH)', '<@(_outputs)',
+ ],
+ 'process_outputs_as_sources': 1,
+ },
+ ],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/rules/src/subdir2/no_action.gyp b/third_party/python/gyp/test/rules/src/subdir2/no_action.gyp
new file mode 100644
index 0000000000..ffa1cefe18
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir2/no_action.gyp
@@ -0,0 +1,38 @@
+# Copyright (c) 2012 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Test that the case where an action is only specified under a conditional is
+# evaluated appropriately.
+{
+ 'targets': [
+ {
+ 'target_name': 'extension_does_not_match_sources_and_no_action',
+ 'type': 'none',
+ 'msvs_cygwin_shell': 0,
+ 'sources': [
+ 'file1.in',
+ 'file2.in',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'assemble',
+ 'extension': 'asm',
+ 'outputs': [
+ '<(RULE_INPUT_ROOT).fail',
+ ],
+ 'conditions': [
+ # Always fails.
+ [ '"true"=="false"', {
+ 'action': [
+ 'python', '../copy-file.py', '<(RULE_INPUT_PATH)', '<@(_outputs)',
+ ],
+ 'process_outputs_as_sources': 1,
+ 'message': 'test_rule',
+ }],
+ ],
+ },
+ ],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/rules/src/subdir2/no_inputs.gyp b/third_party/python/gyp/test/rules/src/subdir2/no_inputs.gyp
new file mode 100644
index 0000000000..e61a1a3ff6
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir2/no_inputs.gyp
@@ -0,0 +1,32 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Test that the case where there are no inputs (other than the
+# file the rule applies to).
+{
+ 'targets': [
+ {
+ 'target_name': 'files_no_input',
+ 'type': 'none',
+ 'msvs_cygwin_shell': 0,
+ 'sources': [
+ 'file1.in',
+ 'file2.in',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'copy_file2',
+ 'extension': 'in',
+ 'outputs': [
+ '<(RULE_INPUT_ROOT).out2',
+ ],
+ 'action': [
+ 'python', '../copy-file.py', '<(RULE_INPUT_PATH)', '<@(_outputs)',
+ ],
+ 'process_outputs_as_sources': 1,
+ },
+ ],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/rules/src/subdir2/none.gyp b/third_party/python/gyp/test/rules/src/subdir2/none.gyp
new file mode 100644
index 0000000000..38bcdabdf6
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir2/none.gyp
@@ -0,0 +1,33 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'files',
+ 'type': 'none',
+ 'msvs_cygwin_shell': 0,
+ 'sources': [
+ 'file1.in',
+ 'file2.in',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'copy_file',
+ 'extension': 'in',
+ 'inputs': [
+ '../copy-file.py',
+ ],
+ 'outputs': [
+ '<(RULE_INPUT_ROOT).out',
+ ],
+ 'action': [
+ 'python', '<(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)',
+ ],
+ 'process_outputs_as_sources': 1,
+ },
+ ],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/rules/src/subdir2/program.c b/third_party/python/gyp/test/rules/src/subdir2/program.c
new file mode 100644
index 0000000000..e5db175148
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir2/program.c
@@ -0,0 +1,12 @@
+/* Copyright (c) 2014 Google Inc. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include <stdio.h>
+
+int main(void)
+{
+ printf("Hello from program.c\n");
+ return 0;
+}
diff --git a/third_party/python/gyp/test/rules/src/subdir3/executable2.gyp b/third_party/python/gyp/test/rules/src/subdir3/executable2.gyp
new file mode 100644
index 0000000000..a2a528fc7b
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir3/executable2.gyp
@@ -0,0 +1,37 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This one tests that rules are properly written if extensions are different
+# between the target's sources (program.c) and the generated files
+# (function3.cc)
+
+{
+ 'targets': [
+ {
+ 'target_name': 'program2',
+ 'type': 'executable',
+ 'msvs_cygwin_shell': 0,
+ 'sources': [
+ 'program.c',
+ 'function3.in',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'copy_file',
+ 'extension': 'in',
+ 'inputs': [
+ '../copy-file.py',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).cc',
+ ],
+ 'action': [
+ 'python', '<(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)',
+ ],
+ 'process_outputs_as_sources': 1,
+ },
+ ],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/rules/src/subdir3/function3.in b/third_party/python/gyp/test/rules/src/subdir3/function3.in
new file mode 100644
index 0000000000..99f46ab05e
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir3/function3.in
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+extern "C" void function3(void)
+{
+ printf("Hello from function3.in\n");
+}
diff --git a/third_party/python/gyp/test/rules/src/subdir3/program.c b/third_party/python/gyp/test/rules/src/subdir3/program.c
new file mode 100644
index 0000000000..c38eead50e
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir3/program.c
@@ -0,0 +1,10 @@
+#include <stdio.h>
+
+extern void function3(void);
+
+int main(void)
+{
+ printf("Hello from program.c\n");
+ function3();
+ return 0;
+}
diff --git a/third_party/python/gyp/test/rules/src/subdir4/asm-function.assem b/third_party/python/gyp/test/rules/src/subdir4/asm-function.assem
new file mode 100644
index 0000000000..ed47cade95
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir4/asm-function.assem
@@ -0,0 +1,10 @@
+#if PLATFORM_WINDOWS || PLATFORM_MAC
+# define IDENTIFIER(n) _##n
+#else /* Linux */
+# define IDENTIFIER(n) n
+#endif
+
+.globl IDENTIFIER(asm_function)
+IDENTIFIER(asm_function):
+ movl $41, %eax
+ ret
diff --git a/third_party/python/gyp/test/rules/src/subdir4/build-asm.gyp b/third_party/python/gyp/test/rules/src/subdir4/build-asm.gyp
new file mode 100644
index 0000000000..fe0fe93787
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir4/build-asm.gyp
@@ -0,0 +1,49 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This one tests that assembly files ended as .s and .S are compiled.
+
+{
+ 'target_defaults': {
+ 'conditions': [
+ ['OS=="win"', {
+ 'defines': ['PLATFORM_WIN'],
+ }],
+ ['OS=="mac"', {
+ 'defines': ['PLATFORM_MAC'],
+ }],
+ ['OS=="linux"', {
+ 'defines': ['PLATFORM_LINUX'],
+ }],
+ ],
+ },
+ 'targets': [
+ {
+ 'target_name': 'program4',
+ 'type': 'executable',
+ 'sources': [
+ 'asm-function.assem',
+ 'program.c',
+ ],
+ 'conditions': [
+ ['OS=="linux" or OS=="mac"', {
+ 'rules': [
+ {
+ 'rule_name': 'convert_assem',
+ 'extension': 'assem',
+ 'inputs': [],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).S',
+ ],
+ 'action': [
+ 'bash', '-c', 'cp <(RULE_INPUT_PATH) <@(_outputs)',
+ ],
+ 'process_outputs_as_sources': 1,
+ },
+ ],
+ }],
+ ],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/rules/src/subdir4/program.c b/third_party/python/gyp/test/rules/src/subdir4/program.c
new file mode 100644
index 0000000000..ad647f4eb9
--- /dev/null
+++ b/third_party/python/gyp/test/rules/src/subdir4/program.c
@@ -0,0 +1,19 @@
+#include <stdio.h>
+
+// Use the assembly function in linux and mac where it is built.
+#if PLATFORM_LINUX || PLATFORM_MAC
+extern int asm_function(void);
+#else
+int asm_function() {
+ return 41;
+}
+#endif
+
+int main(void)
+{
+ fprintf(stdout, "Hello from program.c\n");
+ fflush(stdout);
+ fprintf(stdout, "Got %d.\n", asm_function());
+ fflush(stdout);
+ return 0;
+}