summaryrefslogtreecommitdiff
path: root/deps/gyp/test/rules-dirname/src/subdir
diff options
context:
space:
mode:
Diffstat (limited to 'deps/gyp/test/rules-dirname/src/subdir')
-rw-r--r--deps/gyp/test/rules-dirname/src/subdir/a/b/c.gencc8
-rw-r--r--deps/gyp/test/rules-dirname/src/subdir/a/b/c.printvars1
-rw-r--r--deps/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc8
-rw-r--r--deps/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars1
-rw-r--r--deps/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp140
-rw-r--r--deps/gyp/test/rules-dirname/src/subdir/main.cc14
-rw-r--r--deps/gyp/test/rules-dirname/src/subdir/nodir.gencc8
-rwxr-xr-xdeps/gyp/test/rules-dirname/src/subdir/printvars.py14
8 files changed, 194 insertions, 0 deletions
diff --git a/deps/gyp/test/rules-dirname/src/subdir/a/b/c.gencc b/deps/gyp/test/rules-dirname/src/subdir/a/b/c.gencc
new file mode 100644
index 0000000000..29cb5f79ad
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/subdir/a/b/c.gencc
@@ -0,0 +1,8 @@
+// -*- mode: c++ -*-
+#include <stdio.h>
+
+namespace gen {
+ void c() {
+ printf("hi c\n");
+ }
+}
diff --git a/deps/gyp/test/rules-dirname/src/subdir/a/b/c.printvars b/deps/gyp/test/rules-dirname/src/subdir/a/b/c.printvars
new file mode 100644
index 0000000000..cc4561dc41
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/subdir/a/b/c.printvars
@@ -0,0 +1 @@
+# Empty file for testing build rules
diff --git a/deps/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc b/deps/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc
new file mode 100644
index 0000000000..90b4ce9243
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc
@@ -0,0 +1,8 @@
+// -*- mode: c++ -*-
+#include <stdio.h>
+
+namespace gen {
+ void baz() {
+ printf("hello baz\n");
+ }
+}
diff --git a/deps/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars b/deps/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars
new file mode 100644
index 0000000000..cc4561dc41
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars
@@ -0,0 +1 @@
+# Empty file for testing build rules
diff --git a/deps/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp b/deps/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp
new file mode 100644
index 0000000000..da749a2231
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/subdir/input-rule-dirname.gyp
@@ -0,0 +1,140 @@
+# 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': 'print_rule_input_dirname',
+ 'type': 'none',
+ 'msvs_cygwin_shell': 0,
+ 'sources': [
+ 'foo/bar/baz.printvars',
+ 'a/b/c.printvars',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'printvars',
+ 'extension': 'printvars',
+ 'inputs': [
+ 'printvars.py',
+ ],
+ 'outputs': [
+ '<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).dirname',
+ ],
+ 'action': [
+ 'python', '<@(_inputs)', '<(RULE_INPUT_DIRNAME)', '<@(_outputs)',
+ ],
+ },
+ ],
+ },
+ {
+ 'target_name': 'print_rule_input_path',
+ 'type': 'none',
+ 'msvs_cygwin_shell': 0,
+ 'sources': [
+ 'foo/bar/baz.printvars',
+ 'a/b/c.printvars',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'printvars',
+ 'extension': 'printvars',
+ 'inputs': [
+ 'printvars.py',
+ ],
+ 'outputs': [
+ '<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).path',
+ ],
+ 'action': [
+ 'python', '<@(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)',
+ ],
+ },
+ ],
+ },
+ {
+ 'target_name': 'gencc_int_output',
+ 'type': 'executable',
+ 'msvs_cygwin_shell': 0,
+ 'sources': [
+ 'nodir.gencc',
+ 'foo/bar/baz.gencc',
+ 'a/b/c.gencc',
+ 'main.cc',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'gencc',
+ 'extension': 'gencc',
+ 'inputs': [
+ '<(DEPTH)/copy-file.py',
+ ],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).cc',
+ ],
+ 'action': [
+ 'python', '<@(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)',
+ ],
+ 'process_outputs_as_sources': 1,
+ },
+ ],
+ },
+ ],
+ 'conditions': [
+ ['OS=="win"', {
+ 'targets': [
+ {
+ 'target_name': 'gencc_int_output_external',
+ 'type': 'executable',
+ 'msvs_cygwin_shell': 0,
+ 'msvs_cygwin_dirs': ['../../../../../../<(DEPTH)/third_party/cygwin'],
+ 'sources': [
+ 'nodir.gencc',
+ 'foo/bar/baz.gencc',
+ 'a/b/c.gencc',
+ 'main.cc',
+ ],
+ 'dependencies': [
+ 'cygwin',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'gencc',
+ 'extension': 'gencc',
+ 'msvs_external_rule': 1,
+ 'inputs': [
+ '<(DEPTH)/copy-file.py',
+ ],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/<(RULE_INPUT_DIRNAME)/<(RULE_INPUT_ROOT).cc',
+ ],
+ 'action': [
+ 'python', '<@(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)',
+ ],
+ 'process_outputs_as_sources': 1,
+ },
+ ],
+ },
+ {
+ '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/deps/gyp/test/rules-dirname/src/subdir/main.cc b/deps/gyp/test/rules-dirname/src/subdir/main.cc
new file mode 100644
index 0000000000..3bb8e01395
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/subdir/main.cc
@@ -0,0 +1,14 @@
+// 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.
+namespace gen {
+ extern void nodir();
+ extern void c();
+ extern void baz();
+}
+
+int main() {
+ gen::nodir();
+ gen::c();
+ gen::baz();
+}
diff --git a/deps/gyp/test/rules-dirname/src/subdir/nodir.gencc b/deps/gyp/test/rules-dirname/src/subdir/nodir.gencc
new file mode 100644
index 0000000000..720f589bc2
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/subdir/nodir.gencc
@@ -0,0 +1,8 @@
+// -*- mode: c++ -*-
+#include <stdio.h>
+
+namespace gen {
+ void nodir() {
+ printf("no dir here\n");
+ }
+}
diff --git a/deps/gyp/test/rules-dirname/src/subdir/printvars.py b/deps/gyp/test/rules-dirname/src/subdir/printvars.py
new file mode 100755
index 0000000000..ef3d92e8cf
--- /dev/null
+++ b/deps/gyp/test/rules-dirname/src/subdir/printvars.py
@@ -0,0 +1,14 @@
+#!/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.
+
+"""
+Prints interesting vars
+"""
+
+import sys;
+
+out = open(sys.argv[2], 'w')
+out.write(sys.argv[1]);