// file      : build/spec -*- C++ -*-
// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
// license   : MIT; see accompanying LICENSE file

#ifndef BUILD_SPEC
#define BUILD_SPEC

#include <string>
#include <vector>
#include <iosfwd>
#include <utility> // move()

#include <build/path>
#include <build/name>

namespace build
{
  struct targetspec
  {
    typedef build::name name_type;

    explicit
    targetspec (name_type n): name (std::move (n)) {}
    targetspec (path sb, name_type n)
        : src_base (std::move (sb)), name (std::move (n)) {}

    path src_base;
    name_type name;
  };

  struct opspec: std::vector<targetspec>
  {
    opspec () = default;
    opspec (std::string n): name (std::move (n)) {}

    std::string name;
  };

  struct metaopspec: std::vector<opspec>
  {
    metaopspec () = default;
    metaopspec (std::string n): name (std::move (n)) {}

    std::string name;
  };

  typedef std::vector<metaopspec> buildspec;

  std::ostream&
  operator<< (std::ostream&, const targetspec&);

  std::ostream&
  operator<< (std::ostream&, const opspec&);

  std::ostream&
  operator<< (std::ostream&, const metaopspec&);

  std::ostream&
  operator<< (std::ostream&, const buildspec&);
}

#endif // BUILD_SPEC