Ejemplo n.º 1
0
    def remakecb(self, remade):
        if remade:
            if self.restarts > 0:
                _log.info("make.py[%i]: Restarting makefile parsing",
                          self.makelevel)

            self.makefile = data.Makefile(
                restarts=self.restarts,
                make='%s %s' % (sys.executable.replace(
                    '\\', '/'), makepypath.replace('\\', '/')),
                makeflags=self.makeflags,
                makeoverrides=self.overrides,
                workdir=self.workdir,
                context=self.context,
                env=self.env,
                makelevel=self.makelevel,
                targets=self.targets,
                keepgoing=self.options.keepgoing)

            self.restarts += 1

            try:
                self.ostmts.execute(self.makefile)
                for f in self.options.makefiles:
                    self.makefile.include(f)
                self.makefile.finishparsing()
                self.makefile.remakemakefiles(self.remakecb)
            except util.MakeError, e:
                print e
                self.context.defer(self.cb, 2)

            return
Ejemplo n.º 2
0
    def remakecb(self, remade, error=None):
        if error is not None:
            print(error)
            self.context.defer(self.cb, 2)
            return

        if remade:
            if self.restarts > 0:
                _log.info("make.py[%i]: Restarting makefile parsing",
                          self.makelevel)

            self.makefile = data.Makefile(
                restarts=self.restarts,
                make='%s %s' % (sys.executable.replace(
                    '\\', '/'), makepypath.replace('\\', '/')),
                makeflags=self.makeflags,
                makeoverrides=self.overrides,
                workdir=self.workdir,
                context=self.context,
                env=self.env,
                makelevel=self.makelevel,
                targets=self.targets,
                keepgoing=self.options.keepgoing,
                silent=self.options.silent,
                justprint=self.options.justprint)

            self.restarts += 1

            try:
                self.ostmts.execute(self.makefile)
                for f in self.options.makefiles:
                    self.makefile.include(f)
                self.makefile.finishparsing()
                self.makefile.remakemakefiles(self.remakecb)
            except errors.MakeError as e:
                print(e)
                self.context.defer(self.cb, 2)

            return

        if len(self.targets) == 0:
            if self.makefile.defaulttarget is None:
                print("No target specified and no default target found.")
                self.context.defer(self.cb, 2)
                return

            _log.info("Making default target %s", self.makefile.defaulttarget)
            self.realtargets = [self.makefile.defaulttarget]
            self.tstack = ['<default-target>']
        else:
            self.realtargets = self.targets
            self.tstack = ['<command-line>']

        self.makefile.gettarget(self.realtargets.pop(0)).make(self.makefile,
                                                              self.tstack,
                                                              cb=self.makecb)