| 1 | # Build::Hopen::Toolchain - SUPERSEDED base class for hopen toolchains | ||
| 2 | package Build::Hopen::Toolchain; | ||
| 3 | use Build::Hopen; | ||
| 4 | use Build::Hopen::Base; | ||
| 5 | |||
| 6 | our $VERSION = '0.000008'; # TRIAL | ||
| 7 | |||
| 8 | use Class::Tiny qw(proj_dir dest_dir), { | ||
| 9 | architecture => '', | ||
| 10 | }; | ||
| 11 | |||
| 12 | # Docs {{{1 | ||
| 13 | |||
| 14 | =head1 NAME | ||
| 15 | |||
| 16 | Build::Hopen::Toolchain - SUPERSEDED base class for hopen toolchains | ||
| 17 | |||
| 18 | =head1 SYNOPSIS | ||
| 19 | |||
| 20 | TODO | ||
| 21 | - change this to "Tool" instead of "Toolchain" | ||
| 22 | - permit loading any number of tools | ||
| 23 | - The Generator specifies a default list of tools rather than a | ||
| 24 | single default toolchain. | ||
| 25 | - add G::ToolOp to invoke tools. A ToolOp will take a language | ||
| 26 | and an opcode and invoke a corresponding Tool. E.g., a GNU C | ||
| 27 | Tool will generate command-line options for gcc-style command lines. | ||
| 28 | - Only one Tool may be loaded for each (language, opcode) pair. | ||
| 29 | Otherwise the build would be ambiguous. | ||
| 30 | - In Conventions, define the formats for languages and opcodes. | ||
| 31 | |||
| 32 | Maybe TODO: | ||
| 33 | - Each Generator must specify a list of Content-Types (media types) | ||
| 34 | it can consume. Each Tool must specify a specific content-type | ||
| 35 | it produces. Mismatches are an error unless overriden on the | ||
| 36 | hopen command line. | ||
| 37 | |||
| 38 | The code that generates command lines to invoke specific toolchains lives under | ||
| 39 | C<Build::Hopen::Toolchain>. Those modules must implement the interface defined | ||
| 40 | here. | ||
| 41 | |||
| 42 | =head1 ATTRIBUTES | ||
| 43 | |||
| 44 | =head2 proj_dir | ||
| 45 | |||
| 46 | A L<Path::Class::Dir> instance specifying the root directory of the project | ||
| 47 | |||
| 48 | =head2 dest_dir | ||
| 49 | |||
| 50 | A L<Path::Class::Dir> instance specifying where the generated output | ||
| 51 | should be written. | ||
| 52 | |||
| 53 | =head1 FUNCTIONS | ||
| 54 | |||
| 55 | A toolchain (C<Build::Hopen::Toolchain> subclass) is a Visitor. | ||
| 56 | |||
| 57 | TODO Figure out if the toolchain has access to L<Build::Hopen::G::Link> | ||
| 58 | instances. | ||
| 59 | |||
| 60 | =cut | ||
| 61 | |||
| 62 | # }}}1 | ||
| 63 | |||
| 64 | =head2 visit_goal | ||
| 65 | |||
| 66 | Do whatever the toolchain wants to do with a L<Build::Hopen::G::Goal>. | ||
| 67 | By default, no-op. | ||
| 68 | |||
| 69 | =cut | ||
| 70 | |||
| 71 | sub visit_goal { } | ||
| 72 | |||
| 73 | =head2 visit_op | ||
| 74 | |||
| 75 | Do whatever the toolchain wants to do with a L<Build::Hopen::G::Op> that | ||
| 76 | is not a Goal (see L</visit_goal>). By default, no-op. | ||
| 77 | |||
| 78 | =cut | ||
| 79 | |||
| 80 | sub visit_op { } | ||
| 81 | |||
| 82 | =head2 finalize | ||
| 83 | |||
| 84 | Do whatever the toolchain wants to do to finish up. | ||
| 85 | |||
| 86 | =cut | ||
| 87 | |||
| 88 | sub finalize { } | ||
| 89 | |||
| 90 | false; # SUPERSEDED --- will be removed. | ||
| 91 | __END__ |