extpp 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/text/news.md +11 -0
- data/ext/extpp/class.cpp +4 -1
- data/ext/extpp/extconf.rb +36 -7
- data/ext/extpp/object.cpp +7 -4
- data/lib/extpp.rb +5 -2
- data/lib/extpp/compiler.rb +26 -3
- data/lib/extpp/platform.rb +14 -0
- data/lib/extpp/version.rb +1 -1
- data/test/fixtures/cast/Makefile +65 -62
- data/test/fixtures/cast/cast.o +0 -0
- data/test/fixtures/cast/cast.so +0 -0
- data/test/fixtures/class/Makefile +65 -62
- data/test/fixtures/class/class.o +0 -0
- data/test/fixtures/class/class.so +0 -0
- data/test/fixtures/object/Makefile +65 -62
- data/test/fixtures/object/object.o +0 -0
- data/test/fixtures/object/object.so +0 -0
- metadata +20 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab73bb785e133a943037b1ceb34ca052b50cc6b6
|
4
|
+
data.tar.gz: 2d6eb1206d3e5d919d8cab0200515655b4cde36b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98487232c1998b95667dc561545f37f29684c6ba778470eeafd3be3e0ef3db29701111d8d843172814d7ab29d937d1c743ce234e239ca7f9c67d8ceee94b326d
|
7
|
+
data.tar.gz: 84bac288d828db338c208da99a4fe2c023409adfdb736518f8ed411a9605237d5efcb6804e68673dd814f770140f945bea0bf09d94cab68ac70db4221977e4bb
|
data/doc/text/news.md
CHANGED
data/ext/extpp/class.cpp
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
#include "function.hpp"
|
2
2
|
|
3
|
+
#include <string>
|
3
4
|
#include <unordered_map>
|
4
5
|
#include <vector>
|
5
6
|
|
@@ -126,7 +127,9 @@ namespace {
|
|
126
127
|
rb_scan_args(argc, argv, "1*", &rb_name_symbol, &rb_args);
|
127
128
|
auto function = (*method_table)[rb_sym2id(rb_name_symbol)];
|
128
129
|
if (function) {
|
129
|
-
return function->call(self,
|
130
|
+
return function->call(self,
|
131
|
+
static_cast<int>(RARRAY_LEN(rb_args)),
|
132
|
+
RARRAY_PTR(rb_args));
|
130
133
|
}
|
131
134
|
}
|
132
135
|
|
data/ext/extpp/extconf.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
require_relative "../../lib/extpp/compiler"
|
2
|
+
require_relative "../../lib/extpp/platform"
|
2
3
|
|
3
4
|
cxxflags = RbConfig::CONFIG["CXXFLAGS"]
|
4
|
-
compiler =
|
5
|
+
compiler = ExtPP::Compiler.new(cxxflags)
|
5
6
|
compiler.check
|
6
7
|
cxxflags = compiler.cxx_flags
|
7
8
|
|
@@ -27,9 +28,19 @@ public_headers = collect_headers(include_dir)
|
|
27
28
|
private_headers = collect_headers(__dir__)
|
28
29
|
headers = public_headers + private_headers
|
29
30
|
|
31
|
+
platform = ExtPP::Platform.new
|
32
|
+
case RUBY_PLATFORM
|
33
|
+
when /darwin/
|
34
|
+
ldsharedxx = RbConfig::CONFIG["LDSHAREDXX"]
|
35
|
+
ldsharedxx = ldsharedxx.gsub(/ (?:-dynamic|-bundle)/, "") + " -shared"
|
36
|
+
ldsharedxx += " -install_name #{Dir.pwd.quote}/$(LIBRARY)"
|
37
|
+
else
|
38
|
+
ldsharedxx = RbConfig::CONFIG["LDSHAREDXX"]
|
39
|
+
end
|
40
|
+
|
30
41
|
File.open("Makefile", "w") do |makefile|
|
31
42
|
makefile.puts(<<-MAKEFILE)
|
32
|
-
LIBRARY = libruby-extpp.#{
|
43
|
+
LIBRARY = libruby-extpp.#{platform.dynamic_library_extension}
|
33
44
|
|
34
45
|
SOURCES = #{sources.collect(&:quote).join(" ")}
|
35
46
|
OBJECTS = #{objects.collect(&:quote).join(" ")}
|
@@ -42,7 +53,16 @@ CXX = #{RbConfig::CONFIG["CXX"].quote}
|
|
42
53
|
RUBY = #{RbConfig.ruby.quote}
|
43
54
|
RUBY_HEADER_DIR = #{RbConfig::CONFIG["rubyhdrdir"].quote}
|
44
55
|
RUBY_ARCH_HEADER_DIR = #{RbConfig::CONFIG["rubyarchhdrdir"].quote}
|
45
|
-
|
56
|
+
|
57
|
+
sitearchdir = #{RbConfig::CONFIG["sitearchdir"].quote}
|
58
|
+
sitelibdir = #{RbConfig::CONFIG["sitelibdir"].quote}
|
59
|
+
|
60
|
+
LIBRUBYARG_SHARED = #{RbConfig::CONFIG["LIBRUBYARG_SHARED"]}
|
61
|
+
ARCH_FLAG = #{RbConfig::CONFIG["ARCH_FLAG"]}
|
62
|
+
LDFLAGS = #{RbConfig::CONFIG["LDFLAGS"]}
|
63
|
+
DLDFLAGS = #{RbConfig::CONFIG["DLDFLAGS"]}
|
64
|
+
EXTDLDFLAGS = #{RbConfig::CONFIG["EXTDLDFLAGS"]}
|
65
|
+
LDSHAREDXX = #{ldsharedxx}
|
46
66
|
CCDLFLAGS = #{RbConfig::CONFIG["CCDLFLAGS"]}
|
47
67
|
|
48
68
|
INCLUDEFLAGS = \
|
@@ -61,11 +81,20 @@ dist-clean:
|
|
61
81
|
$(MAKE) clean
|
62
82
|
rm -rf Makefile
|
63
83
|
|
64
|
-
install:
|
65
|
-
|
84
|
+
install: install-so
|
85
|
+
|
86
|
+
install-so: $(LIBRARY)
|
87
|
+
"$(RUBY)" -run -e install -- $(LIBRARY) $(sitearchdir)
|
66
88
|
|
67
|
-
$(LIBRARY): $(OBJECTS)
|
68
|
-
$(LDSHAREDXX)
|
89
|
+
$(LIBRARY): $(OBJECTS) Makefile
|
90
|
+
$(LDSHAREDXX) \\
|
91
|
+
-o $@ \\
|
92
|
+
$(OBJECTS) \\
|
93
|
+
$(LDFLAGS) \\
|
94
|
+
$(DLDFLAGS) \\
|
95
|
+
$(EXTDLDFLAGS) \\
|
96
|
+
$(ARCH_FLAG) \\
|
97
|
+
$(LIBRUBYARG_SHARED)
|
69
98
|
|
70
99
|
.cpp.o:
|
71
100
|
$(CXX) $(INCLUDEFLAGS) $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
|
data/ext/extpp/object.cpp
CHANGED
@@ -15,20 +15,23 @@ namespace rb {
|
|
15
15
|
|
16
16
|
Object Object::send(ID name_id,
|
17
17
|
std::initializer_list<VALUE> args) {
|
18
|
-
|
18
|
+
auto n = args.size();
|
19
19
|
VALUE rb_args[n];
|
20
20
|
int i = 0;
|
21
21
|
for (auto arg : args) {
|
22
22
|
rb_args[i++] = arg;
|
23
23
|
}
|
24
|
-
VALUE rb_result = rb_funcallv(rb_object_,
|
24
|
+
VALUE rb_result = rb_funcallv(rb_object_,
|
25
|
+
name_id,
|
26
|
+
static_cast<int>(n),
|
27
|
+
rb_args);
|
25
28
|
return Object(rb_result);
|
26
29
|
}
|
27
30
|
|
28
31
|
Object Object::send(ID name_id,
|
29
32
|
std::initializer_list<VALUE> args,
|
30
33
|
MethodWithoutArguments block) {
|
31
|
-
|
34
|
+
auto n = args.size();
|
32
35
|
VALUE rb_args[n];
|
33
36
|
int i = 0;
|
34
37
|
for (auto arg : args) {
|
@@ -36,7 +39,7 @@ namespace rb {
|
|
36
39
|
}
|
37
40
|
VALUE rb_result = rb_block_call(rb_object_,
|
38
41
|
name_id,
|
39
|
-
n,
|
42
|
+
static_cast<int>(n),
|
40
43
|
rb_args,
|
41
44
|
reinterpret_cast<MethodFunc>(call_block),
|
42
45
|
reinterpret_cast<VALUE>(block));
|
data/lib/extpp.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "extpp/compiler"
|
2
|
+
require "extpp/platform"
|
2
3
|
|
3
|
-
compiler =
|
4
|
+
compiler = ExtPP::Compiler.new($CXXFLAGS)
|
4
5
|
compiler.check
|
5
6
|
$CXXFLAGS = compiler.cxx_flags
|
6
7
|
|
@@ -26,11 +27,13 @@ $(OBJS): $(extpp_headers)
|
|
26
27
|
end
|
27
28
|
extend(header_files_dependency_injector)
|
28
29
|
|
30
|
+
platform = ExtPP::Platform.new
|
31
|
+
|
29
32
|
[
|
30
33
|
File.join(__dir__, "..", "ext", "extpp"),
|
31
34
|
__dir__,
|
32
35
|
].each do |candidate_dir|
|
33
|
-
so_name = "libruby-extpp.#{
|
36
|
+
so_name = "libruby-extpp.#{platform.dynamic_library_extension}"
|
34
37
|
lib_path = File.expand_path(File.join(candidate_dir, so_name))
|
35
38
|
$LIBS += " #{lib_path.quote}" if File.exist?(lib_path)
|
36
39
|
end
|
data/lib/extpp/compiler.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "mkmf"
|
2
2
|
|
3
|
-
module
|
3
|
+
module ExtPP
|
4
4
|
class Compiler
|
5
5
|
attr_reader :cxx_flags
|
6
6
|
def initialize(cxx_flags)
|
@@ -30,17 +30,40 @@ module Extpp
|
|
30
30
|
|
31
31
|
def check_version
|
32
32
|
return unless gcc?
|
33
|
+
|
33
34
|
checking_for(checking_message("g++ version"), "%g%s") do
|
34
|
-
version =
|
35
|
+
version = 0.0
|
35
36
|
std = nil
|
36
|
-
|
37
|
+
|
38
|
+
case `#{RbConfig.expand("$(CXX) --version")}`
|
39
|
+
when /\Ag\+\+ .+ (\d\.\d)\.\d/
|
37
40
|
version = Float($1)
|
38
41
|
if version < 5.1
|
39
42
|
std = "gnu++11"
|
40
43
|
elsif version < 6.1
|
41
44
|
std = "gnu++14"
|
42
45
|
end
|
46
|
+
when /\A.+ clang version (\d\.\d)\.\d/
|
47
|
+
version = Float($1)
|
48
|
+
if version < 3.5
|
49
|
+
std = "gnu++11"
|
50
|
+
elsif version < 5
|
51
|
+
std = "gnu++14"
|
52
|
+
else
|
53
|
+
std = "gnu++17"
|
54
|
+
end
|
55
|
+
when /\AApple LLVM version (\d\.\d)\.\d/
|
56
|
+
version = Float($1)
|
57
|
+
# TODO: Is it right?
|
58
|
+
if version < 9.0
|
59
|
+
std = "gnu++11"
|
60
|
+
elsif version < 9.1
|
61
|
+
std = "gnu++14"
|
62
|
+
else
|
63
|
+
std = "gnu++17"
|
64
|
+
end
|
43
65
|
end
|
66
|
+
|
44
67
|
if std
|
45
68
|
@cxx_flags += " -std=#{std}"
|
46
69
|
[version, " (#{std})"]
|
data/lib/extpp/version.rb
CHANGED
data/test/fixtures/cast/Makefile
CHANGED
@@ -5,60 +5,60 @@ SHELL = /bin/sh
|
|
5
5
|
V = 0
|
6
6
|
Q1 = $(V:1=)
|
7
7
|
Q = $(Q1:0=@)
|
8
|
-
ECHO1 = $(V:1
|
9
|
-
ECHO = $(ECHO1:0=@echo)
|
8
|
+
ECHO1 = $(V:1=@ :)
|
9
|
+
ECHO = $(ECHO1:0=@ echo)
|
10
10
|
NULLCMD = :
|
11
11
|
|
12
12
|
#### Start of system configuration section. ####
|
13
13
|
|
14
14
|
srcdir = .
|
15
|
-
topdir = /
|
15
|
+
topdir = /tmp/local/include/ruby-2.6.0
|
16
16
|
hdrdir = $(topdir)
|
17
|
-
arch_hdrdir = /
|
17
|
+
arch_hdrdir = /tmp/local/include/ruby-2.6.0/x86_64-linux
|
18
18
|
PATH_SEPARATOR = :
|
19
19
|
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
|
20
|
-
prefix = $(DESTDIR)/
|
21
|
-
rubysitearchprefix = $(
|
22
|
-
rubyarchprefix = $(
|
20
|
+
prefix = $(DESTDIR)/tmp/local
|
21
|
+
rubysitearchprefix = $(rubylibprefix)/$(sitearch)
|
22
|
+
rubyarchprefix = $(rubylibprefix)/$(arch)
|
23
23
|
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
|
24
24
|
exec_prefix = $(prefix)
|
25
|
-
vendorarchhdrdir = $(
|
26
|
-
sitearchhdrdir = $(
|
27
|
-
rubyarchhdrdir = $(
|
25
|
+
vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
|
26
|
+
sitearchhdrdir = $(sitehdrdir)/$(sitearch)
|
27
|
+
rubyarchhdrdir = $(rubyhdrdir)/$(arch)
|
28
28
|
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
|
29
29
|
sitehdrdir = $(rubyhdrdir)/site_ruby
|
30
30
|
rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
|
31
|
-
vendorarchdir = $(
|
31
|
+
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
32
32
|
vendorlibdir = $(vendordir)/$(ruby_version)
|
33
33
|
vendordir = $(rubylibprefix)/vendor_ruby
|
34
|
-
sitearchdir = $(
|
34
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
35
35
|
sitelibdir = $(sitedir)/$(ruby_version)
|
36
|
-
sitedir = $(
|
37
|
-
rubyarchdir = $(
|
36
|
+
sitedir = $(rubylibprefix)/site_ruby
|
37
|
+
rubyarchdir = $(rubylibdir)/$(arch)
|
38
38
|
rubylibdir = $(rubylibprefix)/$(ruby_version)
|
39
39
|
sitearchincludedir = $(includedir)/$(sitearch)
|
40
40
|
archincludedir = $(includedir)/$(arch)
|
41
41
|
sitearchlibdir = $(libdir)/$(sitearch)
|
42
42
|
archlibdir = $(libdir)/$(arch)
|
43
43
|
ridir = $(datarootdir)/$(RI_BASE_NAME)
|
44
|
-
mandir = $(
|
44
|
+
mandir = $(datarootdir)/man
|
45
45
|
localedir = $(datarootdir)/locale
|
46
46
|
libdir = $(exec_prefix)/lib
|
47
47
|
psdir = $(docdir)
|
48
48
|
pdfdir = $(docdir)
|
49
49
|
dvidir = $(docdir)
|
50
50
|
htmldir = $(docdir)
|
51
|
-
infodir = $(
|
51
|
+
infodir = $(datarootdir)/info
|
52
52
|
docdir = $(datarootdir)/doc/$(PACKAGE)
|
53
53
|
oldincludedir = $(DESTDIR)/usr/include
|
54
54
|
includedir = $(prefix)/include
|
55
55
|
runstatedir = $(localstatedir)/run
|
56
|
-
localstatedir = $(
|
56
|
+
localstatedir = $(prefix)/var
|
57
57
|
sharedstatedir = $(prefix)/com
|
58
|
-
sysconfdir = $(
|
58
|
+
sysconfdir = $(prefix)/etc
|
59
59
|
datadir = $(datarootdir)
|
60
60
|
datarootdir = $(prefix)/share
|
61
|
-
libexecdir = $(
|
61
|
+
libexecdir = $(exec_prefix)/libexec
|
62
62
|
sbindir = $(exec_prefix)/sbin
|
63
63
|
bindir = $(exec_prefix)/bin
|
64
64
|
archdir = $(rubyarchdir)
|
@@ -66,28 +66,29 @@ archdir = $(rubyarchdir)
|
|
66
66
|
|
67
67
|
CC = gcc
|
68
68
|
CXX = g++
|
69
|
-
LIBRUBY = $(
|
69
|
+
LIBRUBY = $(LIBRUBY_A)
|
70
70
|
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
71
|
-
LIBRUBYARG_SHARED = -
|
72
|
-
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
|
71
|
+
LIBRUBYARG_SHARED = -Wl,-rpath,$(libdir) -L$(libdir)
|
72
|
+
LIBRUBYARG_STATIC = -Wl,-rpath,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static
|
73
73
|
empty =
|
74
74
|
OUTFLAG = -o $(empty)
|
75
75
|
COUTFLAG = -o $(empty)
|
76
|
+
CSRCFLAG = $(empty)
|
76
77
|
|
77
78
|
RUBY_EXTCONF_H =
|
78
|
-
cflags =
|
79
|
-
cxxflags =
|
80
|
-
optflags = -
|
79
|
+
cflags = $(optflags) $(debugflags) $(warnflags)
|
80
|
+
cxxflags = $(optflags) $(debugflags) $(warnflags)
|
81
|
+
optflags = -O0
|
81
82
|
debugflags = -ggdb3
|
82
|
-
warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat
|
83
|
+
warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-overlength-strings -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wmissing-noreturn -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict
|
83
84
|
CCDLFLAGS = -fPIC
|
84
|
-
CFLAGS = $(CCDLFLAGS)
|
85
|
+
CFLAGS = $(CCDLFLAGS) $(cflags) $(ARCH_FLAG)
|
85
86
|
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir) -I/home/kou/work/ruby/extpp/include
|
86
87
|
DEFS =
|
87
|
-
CPPFLAGS =
|
88
|
-
CXXFLAGS = $(CCDLFLAGS)
|
89
|
-
ldflags = -L. -
|
90
|
-
dldflags =
|
88
|
+
CPPFLAGS = $(DEFS) $(cppflags)
|
89
|
+
CXXFLAGS = $(CCDLFLAGS) $(cxxflags) $(ARCH_FLAG)
|
90
|
+
ldflags = -L. -fstack-protector -rdynamic -Wl,-export-dynamic
|
91
|
+
dldflags = -Wl,--compress-debug-sections=zlib
|
91
92
|
ARCH_FLAG =
|
92
93
|
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
|
93
94
|
LDSHARED = $(CC) -shared
|
@@ -95,19 +96,19 @@ LDSHAREDXX = $(CXX) -shared
|
|
95
96
|
AR = ar
|
96
97
|
EXEEXT =
|
97
98
|
|
98
|
-
RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
|
99
|
-
RUBY_SO_NAME = ruby
|
99
|
+
RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
|
100
|
+
RUBY_SO_NAME = ruby
|
100
101
|
RUBYW_INSTALL_NAME =
|
101
102
|
RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
|
102
103
|
RUBYW_BASE_NAME = rubyw
|
103
104
|
RUBY_BASE_NAME = ruby
|
104
105
|
|
105
|
-
arch = x86_64-linux
|
106
|
+
arch = x86_64-linux
|
106
107
|
sitearch = $(arch)
|
107
|
-
ruby_version = 2.
|
108
|
-
ruby = $(bindir)/$(RUBY_BASE_NAME)
|
108
|
+
ruby_version = 2.6.0
|
109
|
+
ruby = $(bindir)/$(RUBY_BASE_NAME)
|
109
110
|
RUBY = $(ruby)
|
110
|
-
ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
|
111
|
+
ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
|
111
112
|
|
112
113
|
RM = rm -f
|
113
114
|
RM_RF = $(RUBY) -run -e rm -- -rf
|
@@ -122,9 +123,8 @@ TOUCH = exit >
|
|
122
123
|
#### End of system configuration section. ####
|
123
124
|
|
124
125
|
preload =
|
125
|
-
|
126
|
-
|
127
|
-
LIBPATH = -L. -L$(archlibdir)
|
126
|
+
libpath = . $(libdir)
|
127
|
+
LIBPATH = -L. -L$(libdir) -Wl,-rpath,$(libdir)
|
128
128
|
DEFFILE =
|
129
129
|
|
130
130
|
CLEANFILES = mkmf.log
|
@@ -135,11 +135,12 @@ extout =
|
|
135
135
|
extout_prefix =
|
136
136
|
target_prefix =
|
137
137
|
LOCAL_LIBS =
|
138
|
-
LIBS =
|
138
|
+
LIBS = -lpthread -lgmp -ldl -lcrypt -lm -lc /home/kou/work/ruby/extpp/ext/extpp/libruby-extpp.so
|
139
139
|
ORIG_SRCS = cast.cpp
|
140
140
|
SRCS = $(ORIG_SRCS)
|
141
141
|
OBJS = cast.o
|
142
142
|
HDRS =
|
143
|
+
LOCAL_HDRS =
|
143
144
|
TARGET = cast
|
144
145
|
TARGET_NAME = cast
|
145
146
|
TARGET_ENTRY = Init_$(TARGET_NAME)
|
@@ -154,9 +155,9 @@ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
|
154
155
|
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
155
156
|
HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
|
156
157
|
ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
|
157
|
-
|
158
|
-
TARGET_SO = $(DLLIB)
|
159
|
-
CLEANLIBS = $(
|
158
|
+
TARGET_SO_DIR =
|
159
|
+
TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
|
160
|
+
CLEANLIBS = $(TARGET_SO)
|
160
161
|
CLEANOBJS = *.o *.bak
|
161
162
|
|
162
163
|
all: $(DLLIB)
|
@@ -183,17 +184,19 @@ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
|
|
183
184
|
realclean: distclean
|
184
185
|
install: install-so install-rb
|
185
186
|
|
186
|
-
install-so: $(DLLIB) $(TIMESTAMP_DIR)/.
|
187
|
+
install-so: $(DLLIB) $(TIMESTAMP_DIR)/.sitearchdir.time
|
187
188
|
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
188
189
|
clean-static::
|
189
190
|
-$(Q)$(RM) $(STATIC_LIB)
|
190
|
-
install-rb: pre-install-rb install-rb-default
|
191
|
-
install-rb-default: pre-install-rb-default
|
191
|
+
install-rb: pre-install-rb do-install-rb install-rb-default
|
192
|
+
install-rb-default: pre-install-rb-default do-install-rb-default
|
192
193
|
pre-install-rb: Makefile
|
193
194
|
pre-install-rb-default: Makefile
|
195
|
+
do-install-rb:
|
196
|
+
do-install-rb-default:
|
194
197
|
pre-install-rb-default:
|
195
198
|
@$(NULLCMD)
|
196
|
-
$(TIMESTAMP_DIR)/.
|
199
|
+
$(TIMESTAMP_DIR)/.sitearchdir.time:
|
197
200
|
$(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
|
198
201
|
$(Q) $(TOUCH) $@
|
199
202
|
|
@@ -205,53 +208,53 @@ site-install-rb: install-rb
|
|
205
208
|
|
206
209
|
.cc.o:
|
207
210
|
$(ECHO) compiling $(<)
|
208
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
211
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
209
212
|
|
210
213
|
.cc.S:
|
211
214
|
$(ECHO) translating $(<)
|
212
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
|
215
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
213
216
|
|
214
217
|
.mm.o:
|
215
218
|
$(ECHO) compiling $(<)
|
216
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
219
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
217
220
|
|
218
221
|
.mm.S:
|
219
222
|
$(ECHO) translating $(<)
|
220
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
|
223
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
221
224
|
|
222
225
|
.cxx.o:
|
223
226
|
$(ECHO) compiling $(<)
|
224
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
227
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
225
228
|
|
226
229
|
.cxx.S:
|
227
230
|
$(ECHO) translating $(<)
|
228
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
|
231
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
229
232
|
|
230
233
|
.cpp.o:
|
231
234
|
$(ECHO) compiling $(<)
|
232
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
235
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
233
236
|
|
234
237
|
.cpp.S:
|
235
238
|
$(ECHO) translating $(<)
|
236
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
|
239
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
237
240
|
|
238
241
|
.c.o:
|
239
242
|
$(ECHO) compiling $(<)
|
240
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
|
243
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
241
244
|
|
242
245
|
.c.S:
|
243
246
|
$(ECHO) translating $(<)
|
244
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $<
|
247
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
245
248
|
|
246
249
|
.m.o:
|
247
250
|
$(ECHO) compiling $(<)
|
248
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
|
251
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
249
252
|
|
250
253
|
.m.S:
|
251
254
|
$(ECHO) translating $(<)
|
252
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $<
|
255
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
253
256
|
|
254
|
-
$(
|
257
|
+
$(TARGET_SO): $(OBJS) Makefile
|
255
258
|
$(ECHO) linking shared-object $(DLLIB)
|
256
259
|
-$(Q)$(RM) $(@)
|
257
260
|
$(Q) $(LDSHAREDXX) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
@@ -260,5 +263,5 @@ $(DLLIB): $(OBJS) Makefile
|
|
260
263
|
|
261
264
|
$(OBJS): $(HDRS) $(ruby_headers)
|
262
265
|
|
263
|
-
extpp_headers = /home/kou/work/ruby/extpp/include/ruby.hpp /home/kou/work/ruby/extpp/include/ruby/
|
266
|
+
extpp_headers = /home/kou/work/ruby/extpp/include/ruby/object.hpp /home/kou/work/ruby/extpp/include/ruby/class.hpp /home/kou/work/ruby/extpp/include/ruby/cast.hpp /home/kou/work/ruby/extpp/include/ruby/type.hpp /home/kou/work/ruby/extpp/include/ruby.hpp
|
264
267
|
$(OBJS): $(extpp_headers)
|
data/test/fixtures/cast/cast.o
CHANGED
Binary file
|
data/test/fixtures/cast/cast.so
CHANGED
Binary file
|
@@ -5,60 +5,60 @@ SHELL = /bin/sh
|
|
5
5
|
V = 0
|
6
6
|
Q1 = $(V:1=)
|
7
7
|
Q = $(Q1:0=@)
|
8
|
-
ECHO1 = $(V:1
|
9
|
-
ECHO = $(ECHO1:0=@echo)
|
8
|
+
ECHO1 = $(V:1=@ :)
|
9
|
+
ECHO = $(ECHO1:0=@ echo)
|
10
10
|
NULLCMD = :
|
11
11
|
|
12
12
|
#### Start of system configuration section. ####
|
13
13
|
|
14
14
|
srcdir = .
|
15
|
-
topdir = /
|
15
|
+
topdir = /tmp/local/include/ruby-2.6.0
|
16
16
|
hdrdir = $(topdir)
|
17
|
-
arch_hdrdir = /
|
17
|
+
arch_hdrdir = /tmp/local/include/ruby-2.6.0/x86_64-linux
|
18
18
|
PATH_SEPARATOR = :
|
19
19
|
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
|
20
|
-
prefix = $(DESTDIR)/
|
21
|
-
rubysitearchprefix = $(
|
22
|
-
rubyarchprefix = $(
|
20
|
+
prefix = $(DESTDIR)/tmp/local
|
21
|
+
rubysitearchprefix = $(rubylibprefix)/$(sitearch)
|
22
|
+
rubyarchprefix = $(rubylibprefix)/$(arch)
|
23
23
|
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
|
24
24
|
exec_prefix = $(prefix)
|
25
|
-
vendorarchhdrdir = $(
|
26
|
-
sitearchhdrdir = $(
|
27
|
-
rubyarchhdrdir = $(
|
25
|
+
vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
|
26
|
+
sitearchhdrdir = $(sitehdrdir)/$(sitearch)
|
27
|
+
rubyarchhdrdir = $(rubyhdrdir)/$(arch)
|
28
28
|
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
|
29
29
|
sitehdrdir = $(rubyhdrdir)/site_ruby
|
30
30
|
rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
|
31
|
-
vendorarchdir = $(
|
31
|
+
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
32
32
|
vendorlibdir = $(vendordir)/$(ruby_version)
|
33
33
|
vendordir = $(rubylibprefix)/vendor_ruby
|
34
|
-
sitearchdir = $(
|
34
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
35
35
|
sitelibdir = $(sitedir)/$(ruby_version)
|
36
|
-
sitedir = $(
|
37
|
-
rubyarchdir = $(
|
36
|
+
sitedir = $(rubylibprefix)/site_ruby
|
37
|
+
rubyarchdir = $(rubylibdir)/$(arch)
|
38
38
|
rubylibdir = $(rubylibprefix)/$(ruby_version)
|
39
39
|
sitearchincludedir = $(includedir)/$(sitearch)
|
40
40
|
archincludedir = $(includedir)/$(arch)
|
41
41
|
sitearchlibdir = $(libdir)/$(sitearch)
|
42
42
|
archlibdir = $(libdir)/$(arch)
|
43
43
|
ridir = $(datarootdir)/$(RI_BASE_NAME)
|
44
|
-
mandir = $(
|
44
|
+
mandir = $(datarootdir)/man
|
45
45
|
localedir = $(datarootdir)/locale
|
46
46
|
libdir = $(exec_prefix)/lib
|
47
47
|
psdir = $(docdir)
|
48
48
|
pdfdir = $(docdir)
|
49
49
|
dvidir = $(docdir)
|
50
50
|
htmldir = $(docdir)
|
51
|
-
infodir = $(
|
51
|
+
infodir = $(datarootdir)/info
|
52
52
|
docdir = $(datarootdir)/doc/$(PACKAGE)
|
53
53
|
oldincludedir = $(DESTDIR)/usr/include
|
54
54
|
includedir = $(prefix)/include
|
55
55
|
runstatedir = $(localstatedir)/run
|
56
|
-
localstatedir = $(
|
56
|
+
localstatedir = $(prefix)/var
|
57
57
|
sharedstatedir = $(prefix)/com
|
58
|
-
sysconfdir = $(
|
58
|
+
sysconfdir = $(prefix)/etc
|
59
59
|
datadir = $(datarootdir)
|
60
60
|
datarootdir = $(prefix)/share
|
61
|
-
libexecdir = $(
|
61
|
+
libexecdir = $(exec_prefix)/libexec
|
62
62
|
sbindir = $(exec_prefix)/sbin
|
63
63
|
bindir = $(exec_prefix)/bin
|
64
64
|
archdir = $(rubyarchdir)
|
@@ -66,28 +66,29 @@ archdir = $(rubyarchdir)
|
|
66
66
|
|
67
67
|
CC = gcc
|
68
68
|
CXX = g++
|
69
|
-
LIBRUBY = $(
|
69
|
+
LIBRUBY = $(LIBRUBY_A)
|
70
70
|
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
71
|
-
LIBRUBYARG_SHARED = -
|
72
|
-
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
|
71
|
+
LIBRUBYARG_SHARED = -Wl,-rpath,$(libdir) -L$(libdir)
|
72
|
+
LIBRUBYARG_STATIC = -Wl,-rpath,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static
|
73
73
|
empty =
|
74
74
|
OUTFLAG = -o $(empty)
|
75
75
|
COUTFLAG = -o $(empty)
|
76
|
+
CSRCFLAG = $(empty)
|
76
77
|
|
77
78
|
RUBY_EXTCONF_H =
|
78
|
-
cflags =
|
79
|
-
cxxflags =
|
80
|
-
optflags = -
|
79
|
+
cflags = $(optflags) $(debugflags) $(warnflags)
|
80
|
+
cxxflags = $(optflags) $(debugflags) $(warnflags)
|
81
|
+
optflags = -O0
|
81
82
|
debugflags = -ggdb3
|
82
|
-
warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat
|
83
|
+
warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-overlength-strings -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wmissing-noreturn -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict
|
83
84
|
CCDLFLAGS = -fPIC
|
84
|
-
CFLAGS = $(CCDLFLAGS)
|
85
|
+
CFLAGS = $(CCDLFLAGS) $(cflags) $(ARCH_FLAG)
|
85
86
|
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir) -I/home/kou/work/ruby/extpp/include
|
86
87
|
DEFS =
|
87
|
-
CPPFLAGS =
|
88
|
-
CXXFLAGS = $(CCDLFLAGS)
|
89
|
-
ldflags = -L. -
|
90
|
-
dldflags =
|
88
|
+
CPPFLAGS = $(DEFS) $(cppflags)
|
89
|
+
CXXFLAGS = $(CCDLFLAGS) $(cxxflags) $(ARCH_FLAG)
|
90
|
+
ldflags = -L. -fstack-protector -rdynamic -Wl,-export-dynamic
|
91
|
+
dldflags = -Wl,--compress-debug-sections=zlib
|
91
92
|
ARCH_FLAG =
|
92
93
|
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
|
93
94
|
LDSHARED = $(CC) -shared
|
@@ -95,19 +96,19 @@ LDSHAREDXX = $(CXX) -shared
|
|
95
96
|
AR = ar
|
96
97
|
EXEEXT =
|
97
98
|
|
98
|
-
RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
|
99
|
-
RUBY_SO_NAME = ruby
|
99
|
+
RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
|
100
|
+
RUBY_SO_NAME = ruby
|
100
101
|
RUBYW_INSTALL_NAME =
|
101
102
|
RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
|
102
103
|
RUBYW_BASE_NAME = rubyw
|
103
104
|
RUBY_BASE_NAME = ruby
|
104
105
|
|
105
|
-
arch = x86_64-linux
|
106
|
+
arch = x86_64-linux
|
106
107
|
sitearch = $(arch)
|
107
|
-
ruby_version = 2.
|
108
|
-
ruby = $(bindir)/$(RUBY_BASE_NAME)
|
108
|
+
ruby_version = 2.6.0
|
109
|
+
ruby = $(bindir)/$(RUBY_BASE_NAME)
|
109
110
|
RUBY = $(ruby)
|
110
|
-
ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
|
111
|
+
ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
|
111
112
|
|
112
113
|
RM = rm -f
|
113
114
|
RM_RF = $(RUBY) -run -e rm -- -rf
|
@@ -122,9 +123,8 @@ TOUCH = exit >
|
|
122
123
|
#### End of system configuration section. ####
|
123
124
|
|
124
125
|
preload =
|
125
|
-
|
126
|
-
|
127
|
-
LIBPATH = -L. -L$(archlibdir)
|
126
|
+
libpath = . $(libdir)
|
127
|
+
LIBPATH = -L. -L$(libdir) -Wl,-rpath,$(libdir)
|
128
128
|
DEFFILE =
|
129
129
|
|
130
130
|
CLEANFILES = mkmf.log
|
@@ -135,11 +135,12 @@ extout =
|
|
135
135
|
extout_prefix =
|
136
136
|
target_prefix =
|
137
137
|
LOCAL_LIBS =
|
138
|
-
LIBS =
|
138
|
+
LIBS = -lpthread -lgmp -ldl -lcrypt -lm -lc /home/kou/work/ruby/extpp/ext/extpp/libruby-extpp.so
|
139
139
|
ORIG_SRCS = class.cpp
|
140
140
|
SRCS = $(ORIG_SRCS)
|
141
141
|
OBJS = class.o
|
142
142
|
HDRS =
|
143
|
+
LOCAL_HDRS =
|
143
144
|
TARGET = class
|
144
145
|
TARGET_NAME = class
|
145
146
|
TARGET_ENTRY = Init_$(TARGET_NAME)
|
@@ -154,9 +155,9 @@ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
|
154
155
|
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
155
156
|
HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
|
156
157
|
ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
|
157
|
-
|
158
|
-
TARGET_SO = $(DLLIB)
|
159
|
-
CLEANLIBS = $(
|
158
|
+
TARGET_SO_DIR =
|
159
|
+
TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
|
160
|
+
CLEANLIBS = $(TARGET_SO)
|
160
161
|
CLEANOBJS = *.o *.bak
|
161
162
|
|
162
163
|
all: $(DLLIB)
|
@@ -183,17 +184,19 @@ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
|
|
183
184
|
realclean: distclean
|
184
185
|
install: install-so install-rb
|
185
186
|
|
186
|
-
install-so: $(DLLIB) $(TIMESTAMP_DIR)/.
|
187
|
+
install-so: $(DLLIB) $(TIMESTAMP_DIR)/.sitearchdir.time
|
187
188
|
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
188
189
|
clean-static::
|
189
190
|
-$(Q)$(RM) $(STATIC_LIB)
|
190
|
-
install-rb: pre-install-rb install-rb-default
|
191
|
-
install-rb-default: pre-install-rb-default
|
191
|
+
install-rb: pre-install-rb do-install-rb install-rb-default
|
192
|
+
install-rb-default: pre-install-rb-default do-install-rb-default
|
192
193
|
pre-install-rb: Makefile
|
193
194
|
pre-install-rb-default: Makefile
|
195
|
+
do-install-rb:
|
196
|
+
do-install-rb-default:
|
194
197
|
pre-install-rb-default:
|
195
198
|
@$(NULLCMD)
|
196
|
-
$(TIMESTAMP_DIR)/.
|
199
|
+
$(TIMESTAMP_DIR)/.sitearchdir.time:
|
197
200
|
$(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
|
198
201
|
$(Q) $(TOUCH) $@
|
199
202
|
|
@@ -205,53 +208,53 @@ site-install-rb: install-rb
|
|
205
208
|
|
206
209
|
.cc.o:
|
207
210
|
$(ECHO) compiling $(<)
|
208
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
211
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
209
212
|
|
210
213
|
.cc.S:
|
211
214
|
$(ECHO) translating $(<)
|
212
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
|
215
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
213
216
|
|
214
217
|
.mm.o:
|
215
218
|
$(ECHO) compiling $(<)
|
216
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
219
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
217
220
|
|
218
221
|
.mm.S:
|
219
222
|
$(ECHO) translating $(<)
|
220
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
|
223
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
221
224
|
|
222
225
|
.cxx.o:
|
223
226
|
$(ECHO) compiling $(<)
|
224
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
227
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
225
228
|
|
226
229
|
.cxx.S:
|
227
230
|
$(ECHO) translating $(<)
|
228
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
|
231
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
229
232
|
|
230
233
|
.cpp.o:
|
231
234
|
$(ECHO) compiling $(<)
|
232
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
235
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
233
236
|
|
234
237
|
.cpp.S:
|
235
238
|
$(ECHO) translating $(<)
|
236
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
|
239
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
237
240
|
|
238
241
|
.c.o:
|
239
242
|
$(ECHO) compiling $(<)
|
240
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
|
243
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
241
244
|
|
242
245
|
.c.S:
|
243
246
|
$(ECHO) translating $(<)
|
244
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $<
|
247
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
245
248
|
|
246
249
|
.m.o:
|
247
250
|
$(ECHO) compiling $(<)
|
248
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
|
251
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
249
252
|
|
250
253
|
.m.S:
|
251
254
|
$(ECHO) translating $(<)
|
252
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $<
|
255
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
253
256
|
|
254
|
-
$(
|
257
|
+
$(TARGET_SO): $(OBJS) Makefile
|
255
258
|
$(ECHO) linking shared-object $(DLLIB)
|
256
259
|
-$(Q)$(RM) $(@)
|
257
260
|
$(Q) $(LDSHAREDXX) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
@@ -260,5 +263,5 @@ $(DLLIB): $(OBJS) Makefile
|
|
260
263
|
|
261
264
|
$(OBJS): $(HDRS) $(ruby_headers)
|
262
265
|
|
263
|
-
extpp_headers = /home/kou/work/ruby/extpp/include/ruby.hpp /home/kou/work/ruby/extpp/include/ruby/
|
266
|
+
extpp_headers = /home/kou/work/ruby/extpp/include/ruby/object.hpp /home/kou/work/ruby/extpp/include/ruby/class.hpp /home/kou/work/ruby/extpp/include/ruby/cast.hpp /home/kou/work/ruby/extpp/include/ruby/type.hpp /home/kou/work/ruby/extpp/include/ruby.hpp
|
264
267
|
$(OBJS): $(extpp_headers)
|
data/test/fixtures/class/class.o
CHANGED
Binary file
|
Binary file
|
@@ -5,60 +5,60 @@ SHELL = /bin/sh
|
|
5
5
|
V = 0
|
6
6
|
Q1 = $(V:1=)
|
7
7
|
Q = $(Q1:0=@)
|
8
|
-
ECHO1 = $(V:1
|
9
|
-
ECHO = $(ECHO1:0=@echo)
|
8
|
+
ECHO1 = $(V:1=@ :)
|
9
|
+
ECHO = $(ECHO1:0=@ echo)
|
10
10
|
NULLCMD = :
|
11
11
|
|
12
12
|
#### Start of system configuration section. ####
|
13
13
|
|
14
14
|
srcdir = .
|
15
|
-
topdir = /
|
15
|
+
topdir = /tmp/local/include/ruby-2.6.0
|
16
16
|
hdrdir = $(topdir)
|
17
|
-
arch_hdrdir = /
|
17
|
+
arch_hdrdir = /tmp/local/include/ruby-2.6.0/x86_64-linux
|
18
18
|
PATH_SEPARATOR = :
|
19
19
|
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
|
20
|
-
prefix = $(DESTDIR)/
|
21
|
-
rubysitearchprefix = $(
|
22
|
-
rubyarchprefix = $(
|
20
|
+
prefix = $(DESTDIR)/tmp/local
|
21
|
+
rubysitearchprefix = $(rubylibprefix)/$(sitearch)
|
22
|
+
rubyarchprefix = $(rubylibprefix)/$(arch)
|
23
23
|
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
|
24
24
|
exec_prefix = $(prefix)
|
25
|
-
vendorarchhdrdir = $(
|
26
|
-
sitearchhdrdir = $(
|
27
|
-
rubyarchhdrdir = $(
|
25
|
+
vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
|
26
|
+
sitearchhdrdir = $(sitehdrdir)/$(sitearch)
|
27
|
+
rubyarchhdrdir = $(rubyhdrdir)/$(arch)
|
28
28
|
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
|
29
29
|
sitehdrdir = $(rubyhdrdir)/site_ruby
|
30
30
|
rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
|
31
|
-
vendorarchdir = $(
|
31
|
+
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
32
32
|
vendorlibdir = $(vendordir)/$(ruby_version)
|
33
33
|
vendordir = $(rubylibprefix)/vendor_ruby
|
34
|
-
sitearchdir = $(
|
34
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
35
35
|
sitelibdir = $(sitedir)/$(ruby_version)
|
36
|
-
sitedir = $(
|
37
|
-
rubyarchdir = $(
|
36
|
+
sitedir = $(rubylibprefix)/site_ruby
|
37
|
+
rubyarchdir = $(rubylibdir)/$(arch)
|
38
38
|
rubylibdir = $(rubylibprefix)/$(ruby_version)
|
39
39
|
sitearchincludedir = $(includedir)/$(sitearch)
|
40
40
|
archincludedir = $(includedir)/$(arch)
|
41
41
|
sitearchlibdir = $(libdir)/$(sitearch)
|
42
42
|
archlibdir = $(libdir)/$(arch)
|
43
43
|
ridir = $(datarootdir)/$(RI_BASE_NAME)
|
44
|
-
mandir = $(
|
44
|
+
mandir = $(datarootdir)/man
|
45
45
|
localedir = $(datarootdir)/locale
|
46
46
|
libdir = $(exec_prefix)/lib
|
47
47
|
psdir = $(docdir)
|
48
48
|
pdfdir = $(docdir)
|
49
49
|
dvidir = $(docdir)
|
50
50
|
htmldir = $(docdir)
|
51
|
-
infodir = $(
|
51
|
+
infodir = $(datarootdir)/info
|
52
52
|
docdir = $(datarootdir)/doc/$(PACKAGE)
|
53
53
|
oldincludedir = $(DESTDIR)/usr/include
|
54
54
|
includedir = $(prefix)/include
|
55
55
|
runstatedir = $(localstatedir)/run
|
56
|
-
localstatedir = $(
|
56
|
+
localstatedir = $(prefix)/var
|
57
57
|
sharedstatedir = $(prefix)/com
|
58
|
-
sysconfdir = $(
|
58
|
+
sysconfdir = $(prefix)/etc
|
59
59
|
datadir = $(datarootdir)
|
60
60
|
datarootdir = $(prefix)/share
|
61
|
-
libexecdir = $(
|
61
|
+
libexecdir = $(exec_prefix)/libexec
|
62
62
|
sbindir = $(exec_prefix)/sbin
|
63
63
|
bindir = $(exec_prefix)/bin
|
64
64
|
archdir = $(rubyarchdir)
|
@@ -66,28 +66,29 @@ archdir = $(rubyarchdir)
|
|
66
66
|
|
67
67
|
CC = gcc
|
68
68
|
CXX = g++
|
69
|
-
LIBRUBY = $(
|
69
|
+
LIBRUBY = $(LIBRUBY_A)
|
70
70
|
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
71
|
-
LIBRUBYARG_SHARED = -
|
72
|
-
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
|
71
|
+
LIBRUBYARG_SHARED = -Wl,-rpath,$(libdir) -L$(libdir)
|
72
|
+
LIBRUBYARG_STATIC = -Wl,-rpath,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static
|
73
73
|
empty =
|
74
74
|
OUTFLAG = -o $(empty)
|
75
75
|
COUTFLAG = -o $(empty)
|
76
|
+
CSRCFLAG = $(empty)
|
76
77
|
|
77
78
|
RUBY_EXTCONF_H =
|
78
|
-
cflags =
|
79
|
-
cxxflags =
|
80
|
-
optflags = -
|
79
|
+
cflags = $(optflags) $(debugflags) $(warnflags)
|
80
|
+
cxxflags = $(optflags) $(debugflags) $(warnflags)
|
81
|
+
optflags = -O0
|
81
82
|
debugflags = -ggdb3
|
82
|
-
warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat
|
83
|
+
warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wmisleading-indentation -Wno-overlength-strings -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wmissing-noreturn -Wimplicit-fallthrough=0 -Wduplicated-cond -Wrestrict
|
83
84
|
CCDLFLAGS = -fPIC
|
84
|
-
CFLAGS = $(CCDLFLAGS)
|
85
|
+
CFLAGS = $(CCDLFLAGS) $(cflags) $(ARCH_FLAG)
|
85
86
|
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir) -I/home/kou/work/ruby/extpp/include
|
86
87
|
DEFS =
|
87
|
-
CPPFLAGS =
|
88
|
-
CXXFLAGS = $(CCDLFLAGS)
|
89
|
-
ldflags = -L. -
|
90
|
-
dldflags =
|
88
|
+
CPPFLAGS = $(DEFS) $(cppflags)
|
89
|
+
CXXFLAGS = $(CCDLFLAGS) $(cxxflags) $(ARCH_FLAG)
|
90
|
+
ldflags = -L. -fstack-protector -rdynamic -Wl,-export-dynamic
|
91
|
+
dldflags = -Wl,--compress-debug-sections=zlib
|
91
92
|
ARCH_FLAG =
|
92
93
|
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
|
93
94
|
LDSHARED = $(CC) -shared
|
@@ -95,19 +96,19 @@ LDSHAREDXX = $(CXX) -shared
|
|
95
96
|
AR = ar
|
96
97
|
EXEEXT =
|
97
98
|
|
98
|
-
RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
|
99
|
-
RUBY_SO_NAME = ruby
|
99
|
+
RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
|
100
|
+
RUBY_SO_NAME = ruby
|
100
101
|
RUBYW_INSTALL_NAME =
|
101
102
|
RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
|
102
103
|
RUBYW_BASE_NAME = rubyw
|
103
104
|
RUBY_BASE_NAME = ruby
|
104
105
|
|
105
|
-
arch = x86_64-linux
|
106
|
+
arch = x86_64-linux
|
106
107
|
sitearch = $(arch)
|
107
|
-
ruby_version = 2.
|
108
|
-
ruby = $(bindir)/$(RUBY_BASE_NAME)
|
108
|
+
ruby_version = 2.6.0
|
109
|
+
ruby = $(bindir)/$(RUBY_BASE_NAME)
|
109
110
|
RUBY = $(ruby)
|
110
|
-
ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
|
111
|
+
ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
|
111
112
|
|
112
113
|
RM = rm -f
|
113
114
|
RM_RF = $(RUBY) -run -e rm -- -rf
|
@@ -122,9 +123,8 @@ TOUCH = exit >
|
|
122
123
|
#### End of system configuration section. ####
|
123
124
|
|
124
125
|
preload =
|
125
|
-
|
126
|
-
|
127
|
-
LIBPATH = -L. -L$(archlibdir)
|
126
|
+
libpath = . $(libdir)
|
127
|
+
LIBPATH = -L. -L$(libdir) -Wl,-rpath,$(libdir)
|
128
128
|
DEFFILE =
|
129
129
|
|
130
130
|
CLEANFILES = mkmf.log
|
@@ -135,11 +135,12 @@ extout =
|
|
135
135
|
extout_prefix =
|
136
136
|
target_prefix =
|
137
137
|
LOCAL_LIBS =
|
138
|
-
LIBS =
|
138
|
+
LIBS = -lpthread -lgmp -ldl -lcrypt -lm -lc /home/kou/work/ruby/extpp/ext/extpp/libruby-extpp.so
|
139
139
|
ORIG_SRCS = object.cpp
|
140
140
|
SRCS = $(ORIG_SRCS)
|
141
141
|
OBJS = object.o
|
142
142
|
HDRS =
|
143
|
+
LOCAL_HDRS =
|
143
144
|
TARGET = object
|
144
145
|
TARGET_NAME = object
|
145
146
|
TARGET_ENTRY = Init_$(TARGET_NAME)
|
@@ -154,9 +155,9 @@ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
|
154
155
|
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
155
156
|
HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
|
156
157
|
ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
|
157
|
-
|
158
|
-
TARGET_SO = $(DLLIB)
|
159
|
-
CLEANLIBS = $(
|
158
|
+
TARGET_SO_DIR =
|
159
|
+
TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
|
160
|
+
CLEANLIBS = $(TARGET_SO)
|
160
161
|
CLEANOBJS = *.o *.bak
|
161
162
|
|
162
163
|
all: $(DLLIB)
|
@@ -183,17 +184,19 @@ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
|
|
183
184
|
realclean: distclean
|
184
185
|
install: install-so install-rb
|
185
186
|
|
186
|
-
install-so: $(DLLIB) $(TIMESTAMP_DIR)/.
|
187
|
+
install-so: $(DLLIB) $(TIMESTAMP_DIR)/.sitearchdir.time
|
187
188
|
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
188
189
|
clean-static::
|
189
190
|
-$(Q)$(RM) $(STATIC_LIB)
|
190
|
-
install-rb: pre-install-rb install-rb-default
|
191
|
-
install-rb-default: pre-install-rb-default
|
191
|
+
install-rb: pre-install-rb do-install-rb install-rb-default
|
192
|
+
install-rb-default: pre-install-rb-default do-install-rb-default
|
192
193
|
pre-install-rb: Makefile
|
193
194
|
pre-install-rb-default: Makefile
|
195
|
+
do-install-rb:
|
196
|
+
do-install-rb-default:
|
194
197
|
pre-install-rb-default:
|
195
198
|
@$(NULLCMD)
|
196
|
-
$(TIMESTAMP_DIR)/.
|
199
|
+
$(TIMESTAMP_DIR)/.sitearchdir.time:
|
197
200
|
$(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
|
198
201
|
$(Q) $(TOUCH) $@
|
199
202
|
|
@@ -205,53 +208,53 @@ site-install-rb: install-rb
|
|
205
208
|
|
206
209
|
.cc.o:
|
207
210
|
$(ECHO) compiling $(<)
|
208
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
211
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
209
212
|
|
210
213
|
.cc.S:
|
211
214
|
$(ECHO) translating $(<)
|
212
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
|
215
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
213
216
|
|
214
217
|
.mm.o:
|
215
218
|
$(ECHO) compiling $(<)
|
216
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
219
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
217
220
|
|
218
221
|
.mm.S:
|
219
222
|
$(ECHO) translating $(<)
|
220
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
|
223
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
221
224
|
|
222
225
|
.cxx.o:
|
223
226
|
$(ECHO) compiling $(<)
|
224
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
227
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
225
228
|
|
226
229
|
.cxx.S:
|
227
230
|
$(ECHO) translating $(<)
|
228
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
|
231
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
229
232
|
|
230
233
|
.cpp.o:
|
231
234
|
$(ECHO) compiling $(<)
|
232
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
235
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
233
236
|
|
234
237
|
.cpp.S:
|
235
238
|
$(ECHO) translating $(<)
|
236
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
|
239
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
237
240
|
|
238
241
|
.c.o:
|
239
242
|
$(ECHO) compiling $(<)
|
240
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
|
243
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
241
244
|
|
242
245
|
.c.S:
|
243
246
|
$(ECHO) translating $(<)
|
244
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $<
|
247
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
245
248
|
|
246
249
|
.m.o:
|
247
250
|
$(ECHO) compiling $(<)
|
248
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
|
251
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
249
252
|
|
250
253
|
.m.S:
|
251
254
|
$(ECHO) translating $(<)
|
252
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $<
|
255
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
253
256
|
|
254
|
-
$(
|
257
|
+
$(TARGET_SO): $(OBJS) Makefile
|
255
258
|
$(ECHO) linking shared-object $(DLLIB)
|
256
259
|
-$(Q)$(RM) $(@)
|
257
260
|
$(Q) $(LDSHAREDXX) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
@@ -260,5 +263,5 @@ $(DLLIB): $(OBJS) Makefile
|
|
260
263
|
|
261
264
|
$(OBJS): $(HDRS) $(ruby_headers)
|
262
265
|
|
263
|
-
extpp_headers = /home/kou/work/ruby/extpp/include/ruby.hpp /home/kou/work/ruby/extpp/include/ruby/
|
266
|
+
extpp_headers = /home/kou/work/ruby/extpp/include/ruby/object.hpp /home/kou/work/ruby/extpp/include/ruby/class.hpp /home/kou/work/ruby/extpp/include/ruby/cast.hpp /home/kou/work/ruby/extpp/include/ruby/type.hpp /home/kou/work/ruby/extpp/include/ruby.hpp
|
264
267
|
$(OBJS): $(extpp_headers)
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: extpp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- include/ruby/type.hpp
|
121
121
|
- lib/extpp.rb
|
122
122
|
- lib/extpp/compiler.rb
|
123
|
+
- lib/extpp/platform.rb
|
123
124
|
- lib/extpp/version.rb
|
124
125
|
- sample/hello/Rakefile
|
125
126
|
- sample/hello/extconf.rb
|
@@ -172,26 +173,26 @@ signing_key:
|
|
172
173
|
specification_version: 4
|
173
174
|
summary: Ext++ is a Ruby extension that provides C++ API for writing Ruby extension.
|
174
175
|
test_files:
|
175
|
-
- test/run-test.rb
|
176
|
-
- test/helper.rb
|
177
176
|
- test/test-object.rb
|
178
177
|
- test/test-class.rb
|
179
|
-
- test/test-cast.rb
|
180
|
-
- test/fixtures/object/object.o
|
181
|
-
- test/fixtures/object/object.so
|
182
|
-
- test/fixtures/object/object.cpp
|
183
|
-
- test/fixtures/object/mkmf.log
|
184
|
-
- test/fixtures/object/Makefile
|
185
|
-
- test/fixtures/object/extconf.rb
|
186
|
-
- test/fixtures/cast/mkmf.log
|
187
|
-
- test/fixtures/cast/Makefile
|
188
|
-
- test/fixtures/cast/extconf.rb
|
189
|
-
- test/fixtures/cast/cast.cpp
|
190
|
-
- test/fixtures/cast/cast.so
|
191
|
-
- test/fixtures/cast/cast.o
|
192
178
|
- test/fixtures/class/class.so
|
193
179
|
- test/fixtures/class/mkmf.log
|
180
|
+
- test/fixtures/class/class.cpp
|
181
|
+
- test/fixtures/class/class.o
|
194
182
|
- test/fixtures/class/Makefile
|
195
183
|
- test/fixtures/class/extconf.rb
|
196
|
-
- test/fixtures/
|
197
|
-
- test/fixtures/
|
184
|
+
- test/fixtures/cast/mkmf.log
|
185
|
+
- test/fixtures/cast/cast.cpp
|
186
|
+
- test/fixtures/cast/cast.so
|
187
|
+
- test/fixtures/cast/Makefile
|
188
|
+
- test/fixtures/cast/cast.o
|
189
|
+
- test/fixtures/cast/extconf.rb
|
190
|
+
- test/fixtures/object/mkmf.log
|
191
|
+
- test/fixtures/object/object.so
|
192
|
+
- test/fixtures/object/Makefile
|
193
|
+
- test/fixtures/object/object.cpp
|
194
|
+
- test/fixtures/object/object.o
|
195
|
+
- test/fixtures/object/extconf.rb
|
196
|
+
- test/helper.rb
|
197
|
+
- test/run-test.rb
|
198
|
+
- test/test-cast.rb
|