Module: OSTN02C
- Defined in:
- ext/ostn02c.rb
Class Method Summary collapse
- .compile ⇒ Object
- .include_path ⇒ Object
- .lib_path ⇒ Object
- .library ⇒ Object
- .make ⇒ Object
- .object_path ⇒ Object
- .objects ⇒ Object
- .output_path ⇒ Object
- .package ⇒ Object
- .sources ⇒ Object
Class Method Details
.compile ⇒ Object
11 12 13 14 15 16 17 |
# File 'ext/ostn02c.rb', line 11 def compile puts "Compiling libostn02" FileUtils.mkdir_p object_path Dir.chdir object_path do system RbConfig.("$(CC) -I#{include_path} $(CPPFLAGS) $(CFLAGS) -c #{sources.join(" ")}") end end |
.include_path ⇒ Object
37 38 39 |
# File 'ext/ostn02c.rb', line 37 def include_path File.("ostn02c/OSTN02", __dir__) end |
.lib_path ⇒ Object
41 42 43 |
# File 'ext/ostn02c.rb', line 41 def lib_path File.join(output_path, "lib") end |
.library ⇒ Object
33 34 35 |
# File 'ext/ostn02c.rb', line 33 def library File.join(lib_path, "libostn02.a") end |
.make ⇒ Object
7 8 9 |
# File 'ext/ostn02c.rb', line 7 def make compile and package end |
.object_path ⇒ Object
45 46 47 |
# File 'ext/ostn02c.rb', line 45 def object_path File.join(output_path, "obj") end |
.objects ⇒ Object
29 30 31 |
# File 'ext/ostn02c.rb', line 29 def objects File.join(object_path, "*.o") end |
.output_path ⇒ Object
49 50 51 |
# File 'ext/ostn02c.rb', line 49 def output_path File.("../tmp/ostn02c", __dir__) end |
.package ⇒ Object
19 20 21 22 23 |
# File 'ext/ostn02c.rb', line 19 def package puts "Packaging libostn02" FileUtils.mkdir_p lib_path system RbConfig.("$(AR) -crsv #{library} #{objects}") end |
.sources ⇒ Object
25 26 27 |
# File 'ext/ostn02c.rb', line 25 def sources Dir.glob(File.join(include_path, "*.c")) end |