Class: Calypso::Kbuild

Inherits:
Object
  • Object
show all
Defined in:
lib/calypso/kbuild.rb

Overview

Kbuild model.

Constant Summary collapse

ETAOS_BUILD_TARGETS =

Build targets.

"all".freeze
ETAOS_PREBUILD_TARGETS =

Prebuild targets.

"prepare".freeze
ETAOS_CLEAN_TARGETS =

Clean targets.

"clean".freeze
ETAOS_INSTALL_TARGETS =

Module install targets.

"modules_install".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(conf, test_path) ⇒ Kbuild

Create a new Kconfig controller.

Parameters:

  • conf (String)

    ETA/OS configuration file.

  • test_path (String)

    Unit test path.



41
42
43
44
45
# File 'lib/calypso/kbuild.rb', line 41

def initialize(conf, test_path)
  @conf = conf
  @path = test_path
  FileUtils.copy(@conf, "#{Dir.pwd}/.config")
end

Instance Attribute Details

#confString (readonly)

Returns Absolute path to an ETA/OS configuration file.

Returns:

  • (String)

    Absolute path to an ETA/OS configuration file.



26
27
28
# File 'lib/calypso/kbuild.rb', line 26

def conf
  @conf
end

Instance Method Details

#buildObject

Build ETA/OS.



67
68
69
70
# File 'lib/calypso/kbuild.rb', line 67

def build
  system("make #{ETAOS_PREBUILD_TARGETS}")
  system("make #{ETAOS_BUILD_TARGETS}")
end

#build_allObject

Deprecated.

Build all targets.



88
89
90
91
92
93
94
# File 'lib/calypso/kbuild.rb', line 88

def build_all
  clean
  build
  install_modules
  build_app
  nil
end

#build_test(targets) ⇒ Object

Build the test.

Parameters:

  • targets (String)

    Build targets.



82
83
84
# File 'lib/calypso/kbuild.rb', line 82

def build_test(targets)
  system("make -f scripts/Makefile.calypso TARGETS=\"#{targets}\" TEST=#{@path}")
end

#cleanObject

Run the clean target on ETA/OS.



62
63
64
# File 'lib/calypso/kbuild.rb', line 62

def clean
  system("make #{ETAOS_CLEAN_TARGETS}")
end

#install_modules(libdir) ⇒ Object

Install the ETA/OS modules.

Parameters:

  • libdir (String)

    Library directory.



75
76
77
# File 'lib/calypso/kbuild.rb', line 75

def install_modules(libdir)
  system("make #{ETAOS_INSTALL_TARGETS} INSTALL_MOD_PATH=#{libdir}")
end

#preparenil

Run the prebuild targets.

Returns:

  • (nil)


57
58
59
# File 'lib/calypso/kbuild.rb', line 57

def prepare
  system("make #{ETAOS_PREBUILD_TARGETS}")
end

#save_confignil

Save the configuration file back to the test directory.

Returns:

  • (nil)


50
51
52
# File 'lib/calypso/kbuild.rb', line 50

def save_config
  FileUtils.copy("#{Dir.pwd}/.config", @conf)
end