Commit 06b37c9d authored by Wez Furlong's avatar Wez Furlong Committed by Facebook Github Bot

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
parent 1274933e
......@@ -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))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment