paper_house 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +46 -12
- data/LICENSE +674 -0
- data/README.md +18 -10
- data/Rakefile +7 -117
- data/features/executable_task.feature +6 -0
- data/features/step_definitions/paper_house_steps.rb +1 -1
- data/features/support/env.rb +3 -32
- data/lib/paper_house/auto_depends.rb +4 -23
- data/lib/paper_house/build_failed.rb +18 -0
- data/lib/paper_house/build_task.rb +10 -24
- data/lib/paper_house/cc_options.rb +1 -23
- data/lib/paper_house/dependency.rb +1 -23
- data/lib/paper_house/executable_task.rb +1 -27
- data/lib/paper_house/library_task.rb +1 -23
- data/lib/paper_house/linker_options.rb +1 -23
- data/lib/paper_house/platform.rb +11 -32
- data/lib/paper_house/ruby_extension_task.rb +1 -27
- data/lib/paper_house/safe_popen.rb +1 -23
- data/lib/paper_house/shared_library_task.rb +1 -27
- data/lib/paper_house/static_library_task.rb +2 -24
- data/lib/paper_house/version.rb +2 -24
- data/lib/paper_house.rb +1 -23
- data/paper_house.gemspec +11 -9
- data/spec/paper_house/executable_task_spec.rb +26 -53
- data/spec/paper_house/ruby_extension_task_spec.rb +26 -53
- data/spec/paper_house/shared_library_task_spec.rb +30 -57
- data/spec/paper_house/static_library_task_spec.rb +41 -68
- data/spec/paper_house/version_spec.rb +1 -23
- data/spec/spec_helper.rb +3 -31
- metadata +24 -67
- data/.gitignore +0 -19
- data/.rspec +0 -3
- data/.rubocop.yml +0 -1
- data/.ruby-version +0 -1
- data/.travis.yml +0 -18
- data/Gemfile +0 -35
- data/Guardfile +0 -22
- data/cucumber.yml +0 -3
- data/examples/executable/.gitignore +0 -4
- data/examples/executable/Rakefile +0 -5
- data/examples/executable/Rakefile.llvm +0 -5
- data/examples/executable/hello.c +0 -7
- data/examples/executable_subdirs/.gitignore +0 -4
- data/examples/executable_subdirs/Rakefile +0 -11
- data/examples/executable_subdirs/includes/hello.h +0 -1
- data/examples/executable_subdirs/sources/hello.c +0 -6
- data/examples/executable_subdirs/sources/main.c +0 -8
- data/examples/ruby_extension/.gitignore +0 -5
- data/examples/ruby_extension/Rakefile +0 -5
- data/examples/ruby_extension/Rakefile.llvm +0 -5
- data/examples/ruby_extension/hello.c +0 -6
- data/examples/shared_library/.gitignore +0 -8
- data/examples/shared_library/Rakefile +0 -23
- data/examples/shared_library/Rakefile.llvm +0 -25
- data/examples/shared_library/hello.c +0 -6
- data/examples/shared_library/hello.h +0 -1
- data/examples/shared_library/main.c +0 -7
- data/examples/shared_library_subdirs/.gitignore +0 -8
- data/examples/shared_library_subdirs/Rakefile +0 -28
- data/examples/shared_library_subdirs/includes/hello.h +0 -1
- data/examples/shared_library_subdirs/sources/hello.c +0 -6
- data/examples/shared_library_subdirs/sources/main.c +0 -8
- data/examples/static_library/.gitignore +0 -7
- data/examples/static_library/Rakefile +0 -14
- data/examples/static_library/Rakefile.llvm +0 -14
- data/examples/static_library/hello.c +0 -6
- data/examples/static_library/hello.h +0 -1
- data/examples/static_library/main.c +0 -7
- data/examples/static_library_subdirs/.gitignore +0 -7
- data/examples/static_library_subdirs/Rakefile +0 -19
- data/examples/static_library_subdirs/includes/hello.h +0 -1
- data/examples/static_library_subdirs/sources/hello.c +0 -6
- data/examples/static_library_subdirs/sources/main.c +0 -8
- data/rake_simplecov_hook.rb +0 -24
- data/rubocop-todo.yml +0 -6
data/README.md
CHANGED
@@ -1,10 +1,16 @@
|
|
1
1
|
Paper House
|
2
2
|
===========
|
3
|
-
[][gem]
|
4
|
+
[][travis]
|
5
|
+
[][codeclimate]
|
6
|
+
[][coveralls]
|
7
|
+
[][gemnasium]
|
8
|
+
|
9
|
+
[gem]: https://rubygems.org/gems/paper_house
|
10
|
+
[travis]: http://travis-ci.org/trema/paper-house
|
11
|
+
[codeclimate]: https://codeclimate.com/github/trema/paper-house
|
12
|
+
[coveralls]: https://coveralls.io/r/trema/paper-house?branch=develop
|
13
|
+
[gemnasium]: https://gemnasium.com/trema/paper-house
|
8
14
|
|
9
15
|
<a href="http://www.flickr.com/photos/studiobeerhorst/8221979536/" title="paper houses - 3d woodcut prints by Rick&Brenda Beerhorst, on Flickr"><img src="http://farm9.staticflickr.com/8202/8221979536_60404c309d_n.jpg" width="320" height="240" alt="paper houses - 3d woodcut prints" align="right"></a>
|
10
16
|
|
@@ -22,9 +28,10 @@ Features Overview
|
|
22
28
|
* Provides a simple yet a powerful syntax to build above mentioned
|
23
29
|
targets using predefined Rake tasks.
|
24
30
|
* Pure Ruby. No additional dependency on other external tools
|
25
|
-
(
|
31
|
+
([makedepend](http://linux.die.net/man/1/makedepend) etc.) to
|
32
|
+
resolve file dependencies.
|
26
33
|
* Multi-Platform. Runs on both Linux and MacOSX, and supports all
|
27
|
-
major version of Ruby (1.
|
34
|
+
major version of Ruby (1.9.3, 2.0.0).
|
28
35
|
|
29
36
|
|
30
37
|
Example
|
@@ -35,17 +42,18 @@ and `*.h` files in the current directory, just add the following lines
|
|
35
42
|
to your `Rakefile`.
|
36
43
|
|
37
44
|
```ruby
|
38
|
-
require
|
45
|
+
require 'paper_house'
|
39
46
|
|
40
47
|
PaperHouse::ExecutableTask.new :hello
|
41
48
|
```
|
42
49
|
|
43
50
|
This defines a new task `hello`, and `rake hello` will automatically
|
44
51
|
analyze all file dependencies of the source files, compile them into
|
45
|
-
an executable named `hello
|
52
|
+
an executable named `hello`.
|
46
53
|
|
47
54
|
If you wish to customize the build process more, please set the
|
48
|
-
following options defined in
|
55
|
+
following options defined in
|
56
|
+
[PaperHouse::ExecutableTask](http://rubydoc.info/github/trema/paper-house/PaperHouse/ExecutableTask):
|
49
57
|
|
50
58
|
```ruby
|
51
59
|
PaperHouse::ExecutableTask.new :hello do |task|
|
data/Rakefile
CHANGED
@@ -1,126 +1,16 @@
|
|
1
|
-
#
|
2
|
-
# Copyright (C) 2013 NEC Corporation
|
3
|
-
#
|
4
|
-
# This program is free software; you can redistribute it and/or modify
|
5
|
-
# it under the terms of the GNU General Public License, version 3, as
|
6
|
-
# published by the Free Software Foundation.
|
7
|
-
#
|
8
|
-
# This program is distributed in the hope that it will be useful,
|
9
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11
|
-
# GNU General Public License for more details.
|
12
|
-
#
|
13
|
-
# You should have received a copy of the GNU General Public License along
|
14
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
15
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
16
|
-
#
|
1
|
+
# encoding: utf-8
|
17
2
|
|
18
3
|
require 'bundler/gem_tasks'
|
19
|
-
require 'coveralls/rake/task'
|
20
|
-
require 'flay'
|
21
|
-
require 'flay_task'
|
22
|
-
require 'flog'
|
23
|
-
require 'rake/tasklib'
|
24
|
-
require 'reek/rake/task'
|
25
|
-
require 'rspec/core'
|
26
|
-
require 'rspec/core/rake_task'
|
27
|
-
require 'yaml'
|
28
|
-
require 'yard'
|
29
4
|
|
30
|
-
|
5
|
+
# rubocop:disable HashSyntax
|
31
6
|
|
32
7
|
task :default => :travis
|
33
|
-
task :travis => [:spec, :cucumber, :quality, 'coveralls:push']
|
34
|
-
task :quality => [:reek, :flog, :flay]
|
35
|
-
|
36
|
-
Coveralls::RakeTask.new
|
37
|
-
|
38
|
-
RSpec::Core::RakeTask.new
|
39
|
-
|
40
|
-
require 'cucumber/rake/task'
|
41
|
-
Cucumber::Rake::Task.new do |t|
|
42
|
-
profile = %w(--profile)
|
43
|
-
require 'paper_house/platform'
|
44
|
-
if PaperHouse::Platform::MAC
|
45
|
-
profile << 'mac'
|
46
|
-
else
|
47
|
-
profile << 'linux'
|
48
|
-
end
|
49
|
-
t.cucumber_opts = profile.join(' ')
|
50
|
-
end
|
51
|
-
|
52
|
-
Reek::Rake::Task.new do |t|
|
53
|
-
t.fail_on_error = true
|
54
|
-
t.verbose = false
|
55
|
-
t.ruby_opts = ['-rubygems']
|
56
|
-
t.reek_opts = '--quiet'
|
57
|
-
t.source_files = ruby_source
|
58
|
-
end
|
59
|
-
|
60
|
-
desc 'Analyze for code complexity'
|
61
|
-
task :flog do
|
62
|
-
flog = Flog.new(:continue => true)
|
63
|
-
flog.flog(*ruby_source)
|
64
|
-
threshold = 10
|
65
|
-
|
66
|
-
bad_methods = flog.totals.select do |name, score|
|
67
|
-
!(/##{flog.no_method}$/ =~ name) && score > threshold
|
68
|
-
end
|
69
|
-
bad_methods.sort { |a, b| a[1] <=> b[1] }.reverse.each do |name, score|
|
70
|
-
puts sprintf('%8.1f: %s', [score, name])
|
71
|
-
end
|
72
|
-
unless bad_methods.empty?
|
73
|
-
fail "#{bad_methods.size} methods have a flog complexity > #{threshold}"
|
74
|
-
end
|
75
|
-
end
|
76
8
|
|
77
|
-
|
78
|
-
t.dirs = ruby_source.map do |each|
|
79
|
-
each[/[^\/]+/]
|
80
|
-
end.uniq
|
81
|
-
t.threshold = 0
|
82
|
-
t.verbose = true
|
83
|
-
end
|
84
|
-
|
85
|
-
if RUBY_VERSION >= '1.9.0'
|
86
|
-
task :quality => :rubocop
|
87
|
-
require 'rubocop/rake_task'
|
88
|
-
Rubocop::RakeTask.new
|
89
|
-
end
|
90
|
-
|
91
|
-
task :relish do
|
92
|
-
sh 'relish push trema/paper-house'
|
93
|
-
end
|
94
|
-
|
95
|
-
YARD::Rake::YardocTask.new do |t|
|
96
|
-
t.options = ['--no-private']
|
97
|
-
t.options << '--debug' << '--verbose' if Rake.verbose
|
98
|
-
end
|
99
|
-
|
100
|
-
def travis_yml
|
101
|
-
File.join File.dirname(__FILE__), '.travis.yml'
|
102
|
-
end
|
103
|
-
|
104
|
-
def rubies
|
105
|
-
(['1.8.7'] + YAML.load_file(travis_yml)['rvm']).uniq.sort
|
106
|
-
end
|
107
|
-
|
108
|
-
desc 'Run tests against multiple rubies'
|
109
|
-
task :portability
|
9
|
+
task :travis => [:spec, :cucumber, :quality, 'coveralls:push']
|
110
10
|
|
111
|
-
|
112
|
-
|
113
|
-
task :portability => portability_task_name
|
11
|
+
desc 'Check for code quality'
|
12
|
+
task :quality => [:reek, :flog, :flay, :rubocop]
|
114
13
|
|
115
|
-
|
116
|
-
task portability_task_name do
|
117
|
-
sh "rvm #{each} exec bundle"
|
118
|
-
sh "rvm #{each} exec bundle exec rake"
|
119
|
-
end
|
120
|
-
end
|
14
|
+
# rubocop:enable HashSyntax
|
121
15
|
|
122
|
-
|
123
|
-
### mode: Ruby
|
124
|
-
### coding: utf-8-unix
|
125
|
-
### indent-tabs-mode: nil
|
126
|
-
### End:
|
16
|
+
Dir.glob('tasks/*.rake').each { |each| import each }
|
@@ -69,3 +69,9 @@ Feature: PaperHouse::ExecutableTask
|
|
69
69
|
Then a file named "hello.o" should not exist
|
70
70
|
And a file named ".hello.depends" should not exist
|
71
71
|
And a file named "hello" should not exist
|
72
|
+
|
73
|
+
Scenario: Failure
|
74
|
+
Given the current project directory is "examples/fail"
|
75
|
+
When I run `rake hello`
|
76
|
+
Then the exit status should not be 0
|
77
|
+
And the stderr should contain "failed with status"
|
data/features/support/env.rb
CHANGED
@@ -1,38 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
18
|
-
|
19
|
-
require 'rubygems'
|
20
|
-
|
21
|
-
require 'simplecov'
|
22
|
-
SimpleCov.start
|
1
|
+
# encoding: utf-8
|
23
2
|
|
24
3
|
require 'aruba/cucumber'
|
25
4
|
require 'rake'
|
26
5
|
|
27
6
|
ENV['LD_LIBRARY_PATH'] = '.'
|
28
7
|
|
29
|
-
|
30
|
-
|
31
|
-
Coveralls.wear_merged!
|
32
|
-
end
|
33
|
-
|
34
|
-
### Local variables:
|
35
|
-
### mode: Ruby
|
36
|
-
### coding: utf-8-unix
|
37
|
-
### indent-tabs-mode: nil
|
38
|
-
### End:
|
8
|
+
require 'coveralls'
|
9
|
+
Coveralls.wear_merged!
|
@@ -1,21 +1,8 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
3
|
+
# encoding: utf-8
|
18
4
|
|
5
|
+
require 'paper_house/build_failed'
|
19
6
|
require 'paper_house/safe_popen'
|
20
7
|
|
21
8
|
module PaperHouse
|
@@ -38,7 +25,7 @@ module PaperHouse
|
|
38
25
|
def run
|
39
26
|
@out.puts @command
|
40
27
|
exit_status = popen_command
|
41
|
-
fail
|
28
|
+
fail BuildFailed.new(@command, exit_status) if exit_status != 0
|
42
29
|
end
|
43
30
|
|
44
31
|
private
|
@@ -47,7 +34,7 @@ module PaperHouse
|
|
47
34
|
SafePopen.popen(@command) do |stdout, stderr, stdin, |
|
48
35
|
stdin.close
|
49
36
|
parse_cc_h_stderr stderr
|
50
|
-
end
|
37
|
+
end
|
51
38
|
end
|
52
39
|
|
53
40
|
def parse_cc_h_stderr(stderr)
|
@@ -82,9 +69,3 @@ module PaperHouse
|
|
82
69
|
end
|
83
70
|
end
|
84
71
|
end
|
85
|
-
|
86
|
-
### Local variables:
|
87
|
-
### mode: Ruby
|
88
|
-
### coding: utf-8-unix
|
89
|
-
### indent-tabs-mode: nil
|
90
|
-
### End:
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
module PaperHouse
|
4
|
+
# Exception raised if a build task fails
|
5
|
+
class BuildFailed < ::StandardError
|
6
|
+
attr_reader :command
|
7
|
+
attr_reader :status
|
8
|
+
|
9
|
+
def initialize(command, status)
|
10
|
+
@command = command
|
11
|
+
@status = status
|
12
|
+
end
|
13
|
+
|
14
|
+
def message
|
15
|
+
"Command `#{command}' failed with status #{status.exitstatus}"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -1,24 +1,9 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
require 'paper_house/auto_depends'
|
20
|
-
require 'paper_house/
|
4
|
+
require 'paper_house/build_failed'
|
21
5
|
require 'paper_house/cc_options'
|
6
|
+
require 'paper_house/dependency'
|
22
7
|
require 'rake/clean'
|
23
8
|
require 'rake/tasklib'
|
24
9
|
|
@@ -154,11 +139,12 @@ module PaperHouse
|
|
154
139
|
def dependency
|
155
140
|
@dependency ||= Dependency.new(@name)
|
156
141
|
end
|
142
|
+
|
143
|
+
def generate_target
|
144
|
+
command = ([cc] + cc_options).join(' ')
|
145
|
+
sh(command) do |ok, status|
|
146
|
+
ok || fail(BuildFailed.new(command, status))
|
147
|
+
end
|
148
|
+
end
|
157
149
|
end
|
158
150
|
end
|
159
|
-
|
160
|
-
### Local variables:
|
161
|
-
### mode: Ruby
|
162
|
-
### coding: utf-8-unix
|
163
|
-
### indent-tabs-mode: nil
|
164
|
-
### End:
|
@@ -1,20 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
module PaperHouse
|
20
4
|
# CC option utilities.
|
@@ -63,9 +47,3 @@ module PaperHouse
|
|
63
47
|
end
|
64
48
|
end
|
65
49
|
end
|
66
|
-
|
67
|
-
### Local variables:
|
68
|
-
### mode: Ruby
|
69
|
-
### coding: utf-8-unix
|
70
|
-
### indent-tabs-mode: nil
|
71
|
-
### End:
|
@@ -1,20 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
require 'pstore'
|
20
4
|
require 'rake'
|
@@ -57,9 +41,3 @@ module PaperHouse
|
|
57
41
|
end
|
58
42
|
end
|
59
43
|
end
|
60
|
-
|
61
|
-
### Local variables:
|
62
|
-
### mode: Ruby
|
63
|
-
### coding: utf-8-unix
|
64
|
-
### indent-tabs-mode: nil
|
65
|
-
### End:
|
@@ -1,20 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
require 'paper_house/build_task'
|
20
4
|
require 'paper_house/linker_options'
|
@@ -46,10 +30,6 @@ module PaperHouse
|
|
46
30
|
|
47
31
|
private
|
48
32
|
|
49
|
-
def generate_target
|
50
|
-
sh(([cc] + cc_options).join(' '))
|
51
|
-
end
|
52
|
-
|
53
33
|
def cc_options
|
54
34
|
[o_option, objects, ldflags, l_options].flatten
|
55
35
|
end
|
@@ -59,9 +39,3 @@ module PaperHouse
|
|
59
39
|
end
|
60
40
|
end
|
61
41
|
end
|
62
|
-
|
63
|
-
### Local variables:
|
64
|
-
### mode: Ruby
|
65
|
-
### coding: utf-8-unix
|
66
|
-
### indent-tabs-mode: nil
|
67
|
-
### End:
|
@@ -1,20 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
require 'paper_house/build_task'
|
20
4
|
|
@@ -54,9 +38,3 @@ module PaperHouse
|
|
54
38
|
end
|
55
39
|
end
|
56
40
|
end
|
57
|
-
|
58
|
-
### Local variables:
|
59
|
-
### mode: Ruby
|
60
|
-
### coding: utf-8-unix
|
61
|
-
### indent-tabs-mode: nil
|
62
|
-
### End:
|
@@ -1,20 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
module PaperHouse
|
20
4
|
#
|
@@ -71,9 +55,3 @@ module PaperHouse
|
|
71
55
|
end
|
72
56
|
end
|
73
57
|
end
|
74
|
-
|
75
|
-
### Local variables:
|
76
|
-
### mode: Ruby
|
77
|
-
### coding: utf-8-unix
|
78
|
-
### indent-tabs-mode: nil
|
79
|
-
### End:
|
data/lib/paper_house/platform.rb
CHANGED
@@ -1,20 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
require 'rbconfig'
|
20
4
|
|
@@ -38,23 +22,18 @@ module PaperHouse
|
|
38
22
|
SONAME_OPTION = MAC ? '-install_name' : '-soname'
|
39
23
|
|
40
24
|
# Include directories for compiling C extensions.
|
41
|
-
RUBY_INCLUDES =
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
else
|
48
|
-
[CONFIG['archdir']]
|
49
|
-
end
|
25
|
+
RUBY_INCLUDES =
|
26
|
+
[
|
27
|
+
File.join(CONFIG['rubyhdrdir'], CONFIG['arch']),
|
28
|
+
File.join(CONFIG['rubyhdrdir'], 'ruby/backward'),
|
29
|
+
CONFIG['rubyhdrdir']
|
30
|
+
]
|
50
31
|
|
51
32
|
# Library directories for compiling C extensions.
|
52
33
|
RUBY_LIBDIR = CONFIG['libdir']
|
34
|
+
|
35
|
+
def self.name
|
36
|
+
MAC ? 'mac' : 'linux'
|
37
|
+
end
|
53
38
|
end
|
54
39
|
end
|
55
|
-
|
56
|
-
### Local variables:
|
57
|
-
### mode: Ruby
|
58
|
-
### coding: utf-8-unix
|
59
|
-
### indent-tabs-mode: nil
|
60
|
-
### End:
|
@@ -1,20 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
require 'paper_house/library_task'
|
20
4
|
require 'paper_house/linker_options'
|
@@ -46,10 +30,6 @@ module PaperHouse
|
|
46
30
|
|
47
31
|
private
|
48
32
|
|
49
|
-
def generate_target
|
50
|
-
sh(([cc] + cc_options).join(' '))
|
51
|
-
end
|
52
|
-
|
53
33
|
def cc_options
|
54
34
|
[LDSHARED, o_option, objects, ldflags, libdir_option, l_options].flatten
|
55
35
|
end
|
@@ -67,9 +47,3 @@ module PaperHouse
|
|
67
47
|
end
|
68
48
|
end
|
69
49
|
end
|
70
|
-
|
71
|
-
### Local variables:
|
72
|
-
### mode: Ruby
|
73
|
-
### coding: utf-8-unix
|
74
|
-
### indent-tabs-mode: nil
|
75
|
-
### End:
|
@@ -1,20 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
require 'popen4'
|
20
4
|
|
@@ -40,9 +24,3 @@ module PaperHouse
|
|
40
24
|
end
|
41
25
|
end
|
42
26
|
end
|
43
|
-
|
44
|
-
### Local variables:
|
45
|
-
### mode: Ruby
|
46
|
-
### coding: utf-8-unix
|
47
|
-
### indent-tabs-mode: nil
|
48
|
-
### End:
|