Sha256: fdd74388e0dbac7e3fba54883c82e330b215cbe127fe939f5d7ab7934c5da988

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require 'mj/tools/subprocess'


module BuildTool; module BuildSystem


    # The make buildsystem.
    #
    # Provides helper methods for other build-system currently.
    class Make

        include MJ::Tools::SubProcess

        class MakeError < BuildTool::Error; end

        # Class Methods
        class << self

            def make( target, build_directory, environment )
                rc = self.execute( "make #{target ? target : "" }", build_directory, environment ) do |line|
                    line.chomp
                    if line.index( /[^\w]error:/ )
                        logger.error( line )
                    elsif line.index( /\/ld:/ )
                        logger.error( line )
                    else
                        logger.verbose( line )
                    end
                end

                if rc != 0
                    raise MakeError, "make #{ target || "" } failed with error code #{rc}";
                end
                rc
            end

        end


    end


end; end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
build-tool-0.5.3 lib/build-tool/build-system/make.rb