<commit_before>"""
The Make module.  This module provides an interface to `make'.
"""

env = {}  #: The environment flags to pass to make, aka -D...

def make_target(origin, targets=None, args=[]):
  """
     Run make to build a target with the given arguments and the appropriate
     addition settings

     @param origin: The port for which to run make
     @type origin: C{str}
     @param targets: The targets to build
     @type targets: C{str} or C{(str)}
     @param args: Additional arguments for make
     @type args: C{(str)}
     @return: The make process interface
     @rtype: C{Popen}
  """
  from ports import ports_dir
  from subprocess import Popen, PIPE, STDOUT

  args = args + ["%s=%s" % (k, v) for k, v in env.iteritems()]
  if type(targets) == str:
    targets = [targets]
  elif targets == None:
    targets = []
  make = Popen(['make', '-C', ports_dir + origin] + targets + args,
               stdout=PIPE, stderr=STDOUT)

  return make<commit_msg>- Allow output to not be piped (used for 'make config')<commit_after>"""
The Make module.  This module provides an interface to `make'.
"""

env = {}  #: The environment flags to pass to make, aka -D...

def make_target(origin, targets=None, args=[], pipe=True):
  """
     Run make to build a target with the given arguments and the appropriate
     addition settings

     @param origin: The port for which to run make
     @type origin: C{str}
     @param targets: The targets to build
     @type targets: C{str} or C{(str)}
     @param args: Additional arguments for make
     @type args: C{(str)}
     @return: The make process interface
     @rtype: C{Popen}
  """
  from ports import ports_dir
  from subprocess import Popen, PIPE, STDOUT

  if pipe:
    stdout, stderr = PIPE, STDOUT
  else:
    stdout, stderr = None, None

  args = args + ["%s=%s" % (k, v) for k, v in env.iteritems()]
  if type(targets) == str:
    targets = [targets]
  elif targets == None:
    targets = []
  make = Popen(['make', '-C', ports_dir + origin] + targets + args,
               stdout=stdout, stderr=stderr)

  return make
{'fraction_non_alphanumeric': 0.12206797510770703, 'fraction_numerical': 0.0, 'mean_word_length': 2.9961759082217974, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2412464', 'n_tokens_mistral': 658, 'n_tokens_neox': 638, 'n_words': 259}