aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xemcc5
-rwxr-xr-xtests/runner.py6
2 files changed, 11 insertions, 0 deletions
diff --git a/emcc b/emcc
index 41a640b9..a8b9816e 100755
--- a/emcc
+++ b/emcc
@@ -359,6 +359,11 @@ for i in range(1, len(sys.argv)):
if arg.endswith('.h') and sys.argv[i-1] != '-include':
header = True
+if '-M' in sys.argv or '-MM' in sys.argv:
+ cmd = [CC] + sys.argv[1:]
+ if DEBUG: print >> sys.stderr, 'emcc, just dependencies: ', ' '.join(cmd)
+ exit(subprocess.call(cmd))
+
# Check if a target is specified
target = None
for i in range(len(sys.argv)-1):
diff --git a/tests/runner.py b/tests/runner.py
index 796948b2..8a4ee811 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -6683,6 +6683,12 @@ f.close()
output = Popen([NODE_JS, JS_OPTIMIZER, input] + passes, stdin=PIPE, stdout=PIPE).communicate()[0]
self.assertIdentical(expected, output.replace('\n\n', '\n'))
+ def test_m_mm(self):
+ open(os.path.join(self.get_dir(), 'foo.c'), 'w').write('''/* */''')
+ for opt in ['M', 'MM']:
+ output = Popen(['python', EMCC, os.path.join(self.get_dir(), 'foo.c'), '-' + opt], stdout=PIPE).communicate()[0]
+ assert 'foo.o: ' in output, '-%s failed to produce the right output: %s' % (opt, output)
+
def test_llvm_nativizer(self):
# avoid impure_ptr problems etc.
shutil.copyfile(path_from_root('tests', 'files.cpp'), os.path.join(self.get_dir(), 'files.cpp'))