waf

FORK: waf with some random patches
git clone https://git.neptards.moe/neptards/waf.git
Log | Files | Refs | README

build.py (762B)


      1 #! /usr/bin/env python
      2 # encoding: utf-8
      3 
      4 import sys
      5 import os
      6 import codecs
      7 import bottle
      8 import shutil
      9 
     10 def stpl(tsk):
     11     ps = tsk.inputs[0].abspath()
     12     pt = tsk.outputs[0].abspath()
     13     bld = tsk.generator.bld
     14     lookup,name=os.path.split(ps)
     15     st=bottle.template(name,template_lookup=[lookup], company = bld.env.company, guiname=bld.env.guiname, version=bld.env.version,
     16             dllname=bld.env.dllname, maxfuni=bld.env.maxfuni)
     17     with codecs.open(pt,mode='w',encoding="utf-8") as f: f.write(st)
     18     os.chmod(pt, 493)
     19 
     20 # copy files that already exist
     21 def src2bld(self, filename):
     22     self(features='subst', source=filename, target=filename, is_copy=True)
     23 
     24 def build(bld):
     25     # clean initialization
     26     bld.src2bld = src2bld
     27     bld.stpl = stpl
     28