Class: Header

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

Overview

A generic Header class that installs header files into $(PKGINCLUDEDIR)

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?, #expand_sources, #finalize, #library?, #library_type, #objects

Constructor Details

#initialize(options) ⇒ Header

Returns a new instance of Header.

Raises:

  • (ArgumentError)


5
6
7
8
9
10
11
12
13
14
# File 'lib/makeconf/header.rb', line 5

def initialize(options)
  raise ArgumentError unless options.kind_of?(Hash)

  # KLUDGE - parent constructor will barf unless we delete our 
  #       custom options
  @namespace = options[:namespace]
  options.delete :namespace

  super(options)
end

Instance Method Details

#buildObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/makeconf/header.rb', line 16

def build
  mk = Makefile.new

  mk.distribute(@sources)

  dest = '$(INCLUDEDIR)'
  dest += '/' + @namespace unless @namespace.nil?

  @project.installer.install(
      :sources => @sources,
      :dest => dest,
      :mode => '644' 
   ) 

  return mk
end

#makedependsObject



33
34
35
# File 'lib/makeconf/header.rb', line 33

def makedepends
  []
end