summaryrefslogtreecommitdiff
path: root/deps/gyp/test/rules-rebuild/src
diff options
context:
space:
mode:
authorMike Morris <michael.patrick.morris@gmail.com>2015-12-04 13:29:51 -0500
committerMike Morris <michael.patrick.morris@gmail.com>2015-12-07 15:48:34 -0800
commitd467ae6e7867044b8d7b466776fb37089292c52b (patch)
tree730ee0656e6bf9f0dff33346f07acd800e83ab25 /deps/gyp/test/rules-rebuild/src
parent59ef8da69549cf6308078c6f656affba96e9439e (diff)
downloadqtlocation-mapboxgl-d467ae6e7867044b8d7b466776fb37089292c52b.tar.gz
[core] upgrade gyp to git commit 6fb8bd8
https://chromium.googlesource.com/external/gyp/+/6fb8bd829f0ca8fd432fd85ede788b6881c4f09f
Diffstat (limited to 'deps/gyp/test/rules-rebuild/src')
-rw-r--r--deps/gyp/test/rules-rebuild/src/main.c12
-rwxr-xr-xdeps/gyp/test/rules-rebuild/src/make-sources.py19
-rw-r--r--deps/gyp/test/rules-rebuild/src/prog1.in7
-rw-r--r--deps/gyp/test/rules-rebuild/src/prog2.in7
-rw-r--r--deps/gyp/test/rules-rebuild/src/same_target.gyp31
5 files changed, 76 insertions, 0 deletions
diff --git a/deps/gyp/test/rules-rebuild/src/main.c b/deps/gyp/test/rules-rebuild/src/main.c
new file mode 100644
index 0000000000..bd8fbb20ea
--- /dev/null
+++ b/deps/gyp/test/rules-rebuild/src/main.c
@@ -0,0 +1,12 @@
+#include <stdio.h>
+
+extern void prog1(void);
+extern void prog2(void);
+
+int main(void)
+{
+ printf("Hello from main.c\n");
+ prog1();
+ prog2();
+ return 0;
+}
diff --git a/deps/gyp/test/rules-rebuild/src/make-sources.py b/deps/gyp/test/rules-rebuild/src/make-sources.py
new file mode 100755
index 0000000000..7ec022780c
--- /dev/null
+++ b/deps/gyp/test/rules-rebuild/src/make-sources.py
@@ -0,0 +1,19 @@
+#!/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
+
+assert len(sys.argv) == 4, sys.argv
+
+(in_file, c_file, h_file) = sys.argv[1:]
+
+def write_file(filename, contents):
+ open(filename, 'wb').write(contents)
+
+write_file(c_file, open(in_file, 'rb').read())
+
+write_file(h_file, '#define NAME "%s"\n' % in_file)
+
+sys.exit(0)
diff --git a/deps/gyp/test/rules-rebuild/src/prog1.in b/deps/gyp/test/rules-rebuild/src/prog1.in
new file mode 100644
index 0000000000..191b00ef1e
--- /dev/null
+++ b/deps/gyp/test/rules-rebuild/src/prog1.in
@@ -0,0 +1,7 @@
+#include <stdio.h>
+#include "prog1.h"
+
+void prog1(void)
+{
+ printf("Hello from %s!\n", NAME);
+}
diff --git a/deps/gyp/test/rules-rebuild/src/prog2.in b/deps/gyp/test/rules-rebuild/src/prog2.in
new file mode 100644
index 0000000000..7bfac5104c
--- /dev/null
+++ b/deps/gyp/test/rules-rebuild/src/prog2.in
@@ -0,0 +1,7 @@
+#include <stdio.h>
+#include "prog2.h"
+
+void prog2(void)
+{
+ printf("Hello from %s!\n", NAME);
+}
diff --git a/deps/gyp/test/rules-rebuild/src/same_target.gyp b/deps/gyp/test/rules-rebuild/src/same_target.gyp
new file mode 100644
index 0000000000..22ba56056d
--- /dev/null
+++ b/deps/gyp/test/rules-rebuild/src/same_target.gyp
@@ -0,0 +1,31 @@
+{
+ 'targets': [
+ {
+ 'target_name': 'program',
+ 'type': 'executable',
+ 'msvs_cygwin_shell': 0,
+ 'sources': [
+ 'main.c',
+ 'prog1.in',
+ 'prog2.in',
+ ],
+ 'rules': [
+ {
+ 'rule_name': 'make_sources',
+ 'extension': 'in',
+ 'inputs': [
+ 'make-sources.py',
+ ],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).c',
+ '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).h',
+ ],
+ 'action': [
+ 'python', '<(_inputs)', '<(RULE_INPUT_NAME)', '<@(_outputs)',
+ ],
+ 'process_outputs_as_sources': 1,
+ },
+ ],
+ },
+ ],
+}