mirror of
https://github.com/facebook/proxygen.git
synced 2025-08-08 18:02:05 +03:00
fbcode_builder: getdeps: add MakeBuilder
Summary: the make builder runs `make` in the source directory. The `make.args` section from the manifest is passed as arguments to the `make` invocation. Reviewed By: simpkins Differential Revision: D14690996 fbshipit-source-id: 180d657ad05f0c0266a8c1d30979d8d1473958c9
This commit is contained in:
committed by
Facebook Github Bot
parent
04a5ea2f97
commit
6fa72196f4
@@ -88,3 +88,18 @@ class BuilderBase(object):
|
||||
that the sources have changed in such a way that the build
|
||||
system needs to regenerate its rules. """
|
||||
pass
|
||||
|
||||
|
||||
class MakeBuilder(BuilderBase):
|
||||
def __init__(self, build_opts, ctx, manifest, src_dir, build_dir, inst_dir, args):
|
||||
super(MakeBuilder, self).__init__(
|
||||
build_opts, ctx, manifest, src_dir, build_dir, inst_dir
|
||||
)
|
||||
self.args = args or []
|
||||
|
||||
def _build(self, install_dirs, reconfigure):
|
||||
cmd = ["make", "-j%s" % self.build_opts.num_jobs] + self.args
|
||||
self._run_cmd(cmd)
|
||||
|
||||
install_cmd = ["make", "install", "PREFIX=" + self.inst_dir]
|
||||
self._run_cmd(install_cmd)
|
||||
|
@@ -10,6 +10,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
||||
|
||||
import io
|
||||
|
||||
from .builder import MakeBuilder
|
||||
from .expr import parse_expr
|
||||
from .fetcher import (
|
||||
ArchiveFetcher,
|
||||
@@ -301,4 +302,8 @@ class ManifestParser(object):
|
||||
build_dir = src_dir
|
||||
print("build_dir is %s" % build_dir) # just to quiet lint
|
||||
|
||||
if builder == "make":
|
||||
args = self.get_section_as_args("make.args", ctx)
|
||||
return MakeBuilder(build_options, ctx, self, src_dir, None, inst_dir, args)
|
||||
|
||||
raise KeyError("project %s has no known builder" % (self.name))
|
||||
|
Reference in New Issue
Block a user