def load_conf(self): emake_dir = MakeEnv().get_emake_dir() try: with eutils.eopen("make.conf", "r", encoding="utf-8") as fp: self.conf = json.load(fp) except Exception: conf_fname = "%s/templates/make.%s.conf" % (emake_dir, eutils.get_platform()) with eutils.eopen(conf_fname, "r", encoding="utf-8") as fp: self.conf = json.load(fp) obj_conf_fname = "%s/templates/obj.%s.mk" % (emake_dir, eutils.get_platform()) with eutils.eopen(obj_conf_fname, "r", encoding="utf-8") as fp: self.obj_conf = fp.read()
def load_conf(self): emake_dir = MakeEnv().get_emake_dir() try: with eutils.eopen('make.conf', 'r', encoding='utf-8') as fp: self.conf = json.load(fp) except Exception: conf_fname = '%s/templates/make.%s.conf' % (emake_dir, eutils.get_platform()) with eutils.eopen(conf_fname, 'r', encoding='utf-8') as fp: self.conf = json.load(fp) obj_conf_fname = '%s/templates/obj.%s.mk' % (emake_dir, eutils.get_platform()) with eutils.eopen(obj_conf_fname, 'r', encoding='utf-8') as fp: self.obj_conf = fp.read()
def _gen_makefile(self, pf, mk_dict, static=False, shared=False): tempfile = self._get_template_file(pf, static, shared) mk = None with eutils.eopen(tempfile, 'r', encoding='utf-8') as rfp: mk = rfp.read().format(**mk_dict) with open('Makefile', 'w', encoding='utf-8') as wfp: mk and wfp.write(mk)