build: respect --debug configure switch
diff --git a/configure b/configure
index 5b13b5a..6a709c9 100755
--- a/configure
+++ b/configure
@@ -266,13 +266,16 @@
}
pprint.pprint(output, indent=2)
-fn = os.path.join(root_dir, 'config.gypi')
-print "creating ", fn
+def write(filename, data):
+ filename = os.path.join(root_dir, filename)
+ print "creating ", filename
+ with open(filename, 'w+') as f:
+ f.write(data)
-f = open(fn, 'w+')
-f.write("# Do not edit. Generated by the configure script.\n")
-pprint.pprint(output, stream=f, indent=2)
-f.write("\n")
-f.close()
+write('config.gypi', "# Do not edit. Generated by the configure script.\n" +
+ pprint.pformat(output, indent=2))
+
+write('config.mk', "# Do not edit. Generated by the configure script.\n" +
+ ("BUILDTYPE=%s\n" % ('Debug' if options.debug else 'Release')))
subprocess.call(['tools/gyp_node','-f', 'make'])