diff --git a/wscript b/wscript
index 0fcaa02..36530f2 100644
--- a/wscript
+++ b/wscript
@@ -1,2 +1,171 @@
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+VERSION='0.1'
+APPNAME='ndnjs'
+
+YUICOMPRESSOR_URL="http://github.com/downloads/yui/yuicompressor/"
+YUICOMPRESSOR_NAME="yuicompressor-2.4.7"
+
+CLOSURE_COMPILER="http://closure-compiler.googlecode.com/files/compiler-20121212.zip"
+
+from waflib import Task, TaskGen, Utils, Logs
+import urllib, subprocess, os, shutil
+
+def options (opt):
+    opt.add_option('--js-path', action='store',dest='js_path',
+                   help='''Path to install combined and compressed .js files''')
+    opt.add_option('--yui',action='store_true',default=False,dest='yui',
+                   help='''Download and use yuicompressor-2.4.7 (http://yui.github.com/yuicompressor/)''')
+    opt.add_option('--compiler',action='store_true',default=False,dest='compiler',
+                   help='''Download and use closure-compiler-r2388 (https://code.google.com/p/closure-compiler/)''')
+
+def configure (conf):
+    if conf.options.yui:
+        conf.start_msg ("Checking for yuicompressor")
+        if os.path.exists('tools/yuicompressor.jar'):
+            conf.end_msg('tools/yuicompressor.jar')
+            conf.env.HAVE_YUI = 1
+        else:
+            conf.end_msg('not found','YELLOW')
+            url="%s%s.zip" % (YUICOMPRESSOR_URL, YUICOMPRESSOR_NAME)
+            Logs.info ("Downloading yuicompressor from %s..." % url)
+            urllib.urlretrieve (url, "build/yuicompressor.zip")
+
+            filename='%s/build/%s.jar' % (YUICOMPRESSOR_NAME,YUICOMPRESSOR_NAME)
+            subprocess.check_call (['unzip', '-qq', '-o', '-j', 'build/yuicompressor.zip',
+                                    filename, '-d', 'tools/'])
+            os.rename ("tools/%s.jar" % YUICOMPRESSOR_NAME, "tools/yuicompressor.jar")
+            conf.env.HAVE_YUI = 1
+
+    if conf.options.compiler:
+        conf.start_msg ("Checking for closure-compiler")
+        if os.path.exists('tools/compiler.jar'):
+            conf.end_msg('tools/compiler.jar')
+            conf.env.HAVE_COMPILER = 1
+        else:
+            conf.end_msg('not found','YELLOW')
+            Logs.info ("Downloading closure-compiler from %s..." % CLOSURE_COMPILER)
+            urllib.urlretrieve (CLOSURE_COMPILER, "build/closure-compiler.zip")
+
+            subprocess.check_call (['unzip', '-qq', '-o', '-j', 'build/closure-compiler.zip', 'compiler.jar', '-d', 'tools/'])
+            conf.env.HAVE_COMPILER = 1
+
+    if conf.options.js_path:
+        conf.env.JS_PATH = conf.options.js_path
+
 def build (bld):
-    pass
\ No newline at end of file
+    securityLib = ["contrib/securityLib/sha256.js",
+                   "contrib/securityLib/base64.js",
+                   "contrib/securityLib/rsa.js",
+                   "contrib/securityLib/rsa2.js",
+                   "contrib/securityLib/rsapem-1.1.js",
+                   "contrib/securityLib/rsasign-1.2.js",
+                   "contrib/securityLib/asn1hex-1.1.js",
+                   "contrib/securityLib/x509-1.1.js",
+                   "contrib/securityLib/jsbn.js",
+                   "contrib/securityLib/jsbn2.js"]
+
+    ndnjs = ["js/Closure.js",
+             "js/WebSocketTransport.js",
+             "js/util/CCNProtocolDTags.js",
+             "js/util/CCNTime.js",
+             "js/util/ExponentialReExpressClosure.js",
+             "js/Name.js",
+             "js/ContentObject.js",
+             "js/encoding/DateFormat.js",
+             "js/Interest.js",
+             "js/Key.js",
+             "js/PublisherID.js",
+             "js/PublisherPublicKeyDigest.js",
+             "js/FaceInstance.js",
+             "js/ForwardingEntry.js",
+             "js/encoding/DynamicUint8Array.js",
+             "js/encoding/BinaryXMLEncoder.js",
+             "js/encoding/BinaryXMLDecoder.js",
+             "js/encoding/BinaryXMLStructureDecoder.js",
+             "js/encoding/DataUtils.js",
+             "js/encoding/EncodingUtils.js",
+             "js/security/KeyManager.js",
+             "js/security/Witness.js"] + securityLib + ["js/NDN.js"]
+
+    ndnjs = bld (features="combine",
+                 target="ndn",
+                 source=ndnjs)
+
+    if bld.env['HAVE_YUI']:
+        ndnjs.yui = True
+
+    if bld.env['HAVE_COMPILER']:
+        ndnjs.compiler = True
+
+    if bld.env['JS_PATH']:
+        ndnjs.install_path = bld.env['JS_PATH']
+
+
+@TaskGen.extension('.js')
+def js_hook(self, node):
+    node.sig=Utils.h_file (node.abspath())
+
+@TaskGen.feature('combine')
+@TaskGen.after_method('process_source')
+def apply_combine(self):
+    out = "%s.js" % self.target
+    tasks = []
+    task = self.create_task ('combine', self.source)
+    task.set_outputs (task.generator.path.find_or_declare (out))
+    tasks.append (task)
+
+    if getattr(self, 'yui', False):
+        out_yui = "%s.min.yui.js" % self.target
+        yui = self.create_task ('yuicompressor')
+        yui.combine = task
+        yui.set_outputs (yui.generator.path.find_or_declare (out_yui))
+        tasks.append (yui)
+
+    if getattr(self, 'compiler', False):
+        out_min = "%s.min.js" % self.target
+        compiler = self.create_task ('closure_compiler')
+        compiler.combine = task
+        compiler.set_outputs (yui.generator.path.find_or_declare (out_min))
+        tasks.append (compiler)
+
+    try:
+        for task in tasks:
+            self.bld.install_files (self.install_path, task.outputs[:], env=self.env)
+    except:
+        pass
+
+class combine (Task.Task):
+    def run(self):
+        outFile = self.outputs[0]
+        self.outputs[0].write ("", "w") # make file empty
+        for inFile in self.inputs:
+            self.outputs[0].write (inFile.read (), 'a')
+
+class yuicompressor (Task.Task):
+    after="combine"
+    color='PINK'
+    def __str__(self):
+        src_str=self.combine.outputs[0].nice_path()
+        tgt_str=self.outputs[0].nice_path()
+        return'%s: %s -> %s\n'%(self.__class__.__name__.replace('_task',''),src_str,tgt_str)
+
+    def run(self):
+        return self.exec_command(['java',
+                                  '-jar', '../tools/yuicompressor.jar',
+                                  '-o', self.outputs[0].abspath(),
+                                  self.combine.outputs[0].abspath()])
+
+class closure_compiler (Task.Task):
+    after="combine"
+    color='PINK'
+    def __str__(self):
+        src_str=self.combine.outputs[0].nice_path()
+        tgt_str=self.outputs[0].nice_path()
+        return'%s: %s -> %s\n'%(self.__class__.__name__.replace('_task',''),src_str,tgt_str)
+
+    def run(self):
+        return self.exec_command(['java',
+                                  '-jar', '../tools/compiler.jar',
+                                  '--js', self.combine.outputs[0].abspath(),
+                                  '--js_output_file', self.outputs[0].abspath()])
