Class: Binary

Inherits:
Buildable show all
Defined in:
lib/makeconf/binary.rb

Overview

An executable binary file

Direct Known Subclasses

Test

Instance Attribute Summary

Attributes inherited from Buildable

#buildable, #cflags, #distributable, #enable, #id, #installable, #ldadd, #localdep, #output, #output_type, #project, #rpath, #sources, #sysdep, #topdir

Instance Method Summary collapse

Methods inherited from Buildable

#binary?, #build, #expand_sources, #finalize, #library?, #library_type, #makedepends, #objects

Constructor Details

#initialize(options) ⇒ Binary

Returns a new instance of Binary.

Raises:

  • (ArgumentError)


4
5
6
7
8
9
# File 'lib/makeconf/binary.rb', line 4

def initialize(options)
  raise ArgumentError unless options.kind_of?(Hash)
  super(options)
  @output = @id + Platform.executable_extension
  @output_type = 'binary'
end

Instance Method Details

#DEADWOOD_buildObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/makeconf/binary.rb', line 11

def DEADWOOD_build
  binfile = @id + Platform.executable_extension
  cc = @compiler.clone
  cc.is_library = false
  cc.sources = @sources
  cc.output = binfile

#XXX-BROKEN cc.add_targets(@makefile)

  @makefile.merge!(cc.to_make(binfile))

  @makefile.clean(cc.objs)
  @makefile.install(binfile, '$(BINDIR)', { 'mode' => '755' }) \
      if @installable
  @output.push binfile
  super()
end