Sha256: 88a041eb549f94f85d8c1a2063a624a51f3d9dca27846c5d193086298c983f8e

Contents?: true

Size: 1.13 KB

Versions: 9

Compression:

Stored size: 1.13 KB

Contents

# -*- coding: UTF-8 -*-

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 )
                    elsif line.index( /(core dumped)/ )
                        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

9 entries across 9 versions & 1 rubygems

Version Path
build-tool-0.6.6 lib/build-tool/build-system/make.rb
build-tool-0.6.5 lib/build-tool/build-system/make.rb
build-tool-0.6.4 lib/build-tool/build-system/make.rb
build-tool-0.6.3 lib/build-tool/build-system/make.rb
build-tool-0.6.2 lib/build-tool/build-system/make.rb
build-tool-0.6.1 lib/build-tool/build-system/make.rb
build-tool-0.6.0 lib/build-tool/build-system/make.rb
build-tool-0.6.0.rc2 lib/build-tool/build-system/make.rb
build-tool-0.6.0.rc1 lib/build-tool/build-system/make.rb