autotype 0.1.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 +7 -0
- data/Gemfile +8 -0
- data/LICENSE +21 -0
- data/README.md +93 -0
- data/Rakefile +21 -0
- data/autotype.example.yml +19 -0
- data/autotype.gemspec +38 -0
- data/exe/autotype +6 -0
- data/ext/autotype/Makefile +273 -0
- data/ext/autotype/autotype.bundle.dSYM/Contents/Info.plist +20 -0
- data/ext/autotype/autotype.bundle.dSYM/Contents/Resources/Relocations/aarch64/autotype.bundle.yml +5 -0
- data/ext/autotype/autotype.c +277 -0
- data/ext/autotype/extconf.rb +15 -0
- data/lib/autotype/discovery_profile.rb +527 -0
- data/lib/autotype/engine.rb +4613 -0
- data/lib/autotype/native.rb +34 -0
- data/lib/autotype/native_bridge.rb +121 -0
- data/lib/autotype/profile.rb +46 -0
- data/lib/autotype/type_string.rb +48 -0
- data/lib/autotype/version.rb +5 -0
- data/lib/autotype.rb +15 -0
- data/native/autotype/Makefile +23 -0
- data/native/autotype/include/stc.h +107 -0
- data/native/autotype/src/main.c +50 -0
- data/native/autotype/src/solver.c +296 -0
- data/native/autotype/src/type.c +223 -0
- data/spec/autotype_config_spec.rb +91 -0
- data/spec/autotype_native_spec.rb +71 -0
- data/spec/autotype_spec.rb +1028 -0
- data/spec/examples.txt +72 -0
- data/spec/fixtures/autotype.yml +9 -0
- data/spec/fixtures/entities/tool_call.rb +7 -0
- data/spec/fixtures/entities/tool_result.rb +7 -0
- data/spec/fixtures/pipeline/actors/demo_actor.rb +8 -0
- data/spec/spec_helper.rb +25 -0
- metadata +149 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: c4cf10cf93d0590a82aa797972c59678579244a055aafa89a1eb6f1a3da8a76b
|
|
4
|
+
data.tar.gz: c348bf039ee72217cb21007c26117432f2f8bcd0454673766e3bbeddd2942450
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: ce753f6b7ade8d2bc5b44d24a22f54f0d72f27c021865b1fa2843a33842b3a58db48a6ab4811ff4550979e22d1eb573f9defff44da29d8aeb0979a70265a2828
|
|
7
|
+
data.tar.gz: 5583085da08b8d54bab10ccc662fc65985e9fbc139608644da035d72aa222587f2ed2c3920e445999e1687beed7746a4287b317a1fde8ab263bfa788c74ee3d4
|
data/Gemfile
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Louis Mullie
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Autotype
|
|
2
|
+
|
|
3
|
+
Syntax-less Ruby type inference: analyze method bodies with [Prism](https://github.com/ruby/prism), accumulate send capabilities, and solve to fixed-point types without requiring source annotations.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
gem install autotype
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or from source:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
bundle exec rake native:compile
|
|
15
|
+
bundle exec rspec
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## CLI
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
autotype app/**/*.rb --json
|
|
22
|
+
autotype lib/**/*.rb --html typedoc.html
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Enable the native C solver priming pass:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
AUTOTYPE_NATIVE=1 autotype app/**/*.rb --json
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
No config file is required. Autotype discovers actor port wiring, emit patterns, entity factories, and type file locations from your Ruby source.
|
|
32
|
+
|
|
33
|
+
## Optional overrides
|
|
34
|
+
|
|
35
|
+
When heuristics get something wrong, add `autotype.yml` (see `autotype.example.yml`):
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
skip:
|
|
39
|
+
- vendor/**
|
|
40
|
+
|
|
41
|
+
types:
|
|
42
|
+
members:
|
|
43
|
+
query: MyApp::Entities::Query # only when name conventions fail
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Set `AUTOTYPE_CONFIG` or pass `--config PATH` to point at a non-default location.
|
|
47
|
+
|
|
48
|
+
### What is discovered automatically
|
|
49
|
+
|
|
50
|
+
| Concern | How |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
| Actor DSL | `input` / `output` / `option` calls at class level |
|
|
53
|
+
| Port handler | Instance method with `from:` (or `source:`) keyword — prefers `process` |
|
|
54
|
+
| Output emit | `emit(x, to: :port)`-style sends on actor classes |
|
|
55
|
+
| Options hash | Classes declaring `option` and reading `options` |
|
|
56
|
+
| Entity factories | `Entity.define`, `*::Entity.define`, `Data.define`, `Struct.new` |
|
|
57
|
+
| Entity file paths | Glob `{snake}.rb` under project root; match constant definition |
|
|
58
|
+
| Member / option types | Common field names (`name`, `step`, `base_url`, …) |
|
|
59
|
+
| Lifecycle methods | `on_*` methods on actor classes → `nil` return |
|
|
60
|
+
| Structured prefixes | Namespaces seen in port `type:` constants (e.g. `MyApp::Entities::`) |
|
|
61
|
+
|
|
62
|
+
Everything in the old verbose config (`dsl`, `wiring`, `pipeline`, `structured`, `locators`, `self_types`) is inferred unless you override it.
|
|
63
|
+
|
|
64
|
+
## Ruby API
|
|
65
|
+
|
|
66
|
+
```ruby
|
|
67
|
+
require "autotype"
|
|
68
|
+
|
|
69
|
+
Autotype.run(["app/models/user.rb", "--json"])
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Native extension
|
|
73
|
+
|
|
74
|
+
The optional C extension accelerates the builtin fixed-point solver. It compiles automatically on gem install via `ext/autotype/extconf.rb`, sharing sources with `native/autotype/`.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
cd native/autotype && make test
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Editor extension
|
|
81
|
+
|
|
82
|
+
The Cursor / VS Code extension lives in `editor/`. It runs `autotype --json` and renders inline signatures.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
cd editor
|
|
86
|
+
npm install
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Configure workspace settings to point at the `autotype` executable on your PATH, or rely on the bundled `exe/autotype` via `bundle exec`.
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT
|
data/Rakefile
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bundler/gem_tasks"
|
|
4
|
+
require "rspec/core/rake_task"
|
|
5
|
+
|
|
6
|
+
RSpec::Core::RakeTask.new(:spec)
|
|
7
|
+
|
|
8
|
+
task default: :spec
|
|
9
|
+
|
|
10
|
+
namespace :native do
|
|
11
|
+
desc "Build standalone C smoke test"
|
|
12
|
+
task :test do
|
|
13
|
+
sh "make -C native/autotype test"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
desc "Build Ruby C extension"
|
|
17
|
+
task :compile do
|
|
18
|
+
sh "ruby ext/autotype/extconf.rb"
|
|
19
|
+
sh "make -C ext/autotype"
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Optional overrides — Autotype discovers wiring and entity paths automatically.
|
|
2
|
+
# Delete this file entirely if you do not need overrides.
|
|
3
|
+
|
|
4
|
+
skip:
|
|
5
|
+
- vendor/**
|
|
6
|
+
- tmp/**
|
|
7
|
+
|
|
8
|
+
# Override a member hint when naming conventions are wrong:
|
|
9
|
+
# types:
|
|
10
|
+
# members:
|
|
11
|
+
# query: MyApp::Entities::Query
|
|
12
|
+
# options:
|
|
13
|
+
# gate_match_mode: String
|
|
14
|
+
|
|
15
|
+
# Pin entity file lookup when auto-discovery picks the wrong file:
|
|
16
|
+
# locators:
|
|
17
|
+
# - prefix: "MyApp::Entities::"
|
|
18
|
+
# paths:
|
|
19
|
+
# - "app/entities/{snake}.rb"
|
data/autotype.gemspec
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "lib/autotype/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "autotype"
|
|
7
|
+
spec.version = Autotype::VERSION
|
|
8
|
+
spec.authors = ["Louis Mullie"]
|
|
9
|
+
spec.email = ["louis.mullie@gmail.com"]
|
|
10
|
+
|
|
11
|
+
spec.summary = "Syntax-less Ruby type inference from method usage"
|
|
12
|
+
spec.description = "Infers Ruby method signatures from Prism AST analysis and fixed-point constraint solving."
|
|
13
|
+
spec.homepage = "https://github.com/louismullie/autotype"
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
spec.required_ruby_version = ">= 3.2.0"
|
|
16
|
+
|
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
18
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
|
19
|
+
|
|
20
|
+
spec.files = Dir.chdir(__dir__) do
|
|
21
|
+
Dir.glob("{exe,ext,lib,native,spec}/**/*", File::FNM_DOTMATCH).select do |path|
|
|
22
|
+
File.file?(path) &&
|
|
23
|
+
!path.end_with?(".o", ".bundle", ".so", ".dylib", "stc_solve", "/.DS_Store") &&
|
|
24
|
+
!path.include?("/.git/")
|
|
25
|
+
end + %w[README.md LICENSE autotype.gemspec Gemfile Rakefile autotype.example.yml]
|
|
26
|
+
end
|
|
27
|
+
spec.bindir = "exe"
|
|
28
|
+
spec.executables = ["autotype"]
|
|
29
|
+
spec.require_paths = ["lib"]
|
|
30
|
+
spec.extensions = ["ext/autotype/extconf.rb"]
|
|
31
|
+
|
|
32
|
+
spec.add_runtime_dependency "async", "~> 2.0"
|
|
33
|
+
spec.add_runtime_dependency "faraday", "~> 2.0"
|
|
34
|
+
spec.add_runtime_dependency "prism", "~> 1.0"
|
|
35
|
+
|
|
36
|
+
spec.add_development_dependency "dotenv", "~> 3.0"
|
|
37
|
+
spec.add_development_dependency "rspec", "~> 3.13"
|
|
38
|
+
end
|
data/exe/autotype
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
|
|
2
|
+
SHELL = /bin/sh
|
|
3
|
+
|
|
4
|
+
# V=0 quiet, V=1 verbose. other values don't work.
|
|
5
|
+
V = 0
|
|
6
|
+
V0 = $(V:0=)
|
|
7
|
+
Q1 = $(V:1=)
|
|
8
|
+
Q = $(Q1:0=@)
|
|
9
|
+
ECHO1 = $(V:1=@ :)
|
|
10
|
+
ECHO = $(ECHO1:0=@ echo)
|
|
11
|
+
NULLCMD = :
|
|
12
|
+
|
|
13
|
+
#### Start of system configuration section. ####
|
|
14
|
+
|
|
15
|
+
srcdir = .
|
|
16
|
+
topdir = /Users/louis-mullie/.rbenv/versions/3.4.7/include/ruby-3.4.0
|
|
17
|
+
hdrdir = $(topdir)
|
|
18
|
+
arch_hdrdir = /Users/louis-mullie/.rbenv/versions/3.4.7/include/ruby-3.4.0/arm64-darwin24
|
|
19
|
+
PATH_SEPARATOR = :
|
|
20
|
+
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby:/Users/louis-mullie/Documents/GitHub/autotype/native/autotype/src
|
|
21
|
+
prefix = $(DESTDIR)/Users/louis-mullie/.rbenv/versions/3.4.7
|
|
22
|
+
rubysitearchprefix = $(rubylibprefix)/$(sitearch)
|
|
23
|
+
rubyarchprefix = $(rubylibprefix)/$(arch)
|
|
24
|
+
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
|
|
25
|
+
exec_prefix = $(prefix)
|
|
26
|
+
vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
|
|
27
|
+
sitearchhdrdir = $(sitehdrdir)/$(sitearch)
|
|
28
|
+
rubyarchhdrdir = $(rubyhdrdir)/$(arch)
|
|
29
|
+
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
|
|
30
|
+
sitehdrdir = $(rubyhdrdir)/site_ruby
|
|
31
|
+
rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
|
|
32
|
+
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
|
33
|
+
vendorlibdir = $(vendordir)/$(ruby_version)
|
|
34
|
+
vendordir = $(rubylibprefix)/vendor_ruby
|
|
35
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
|
36
|
+
sitelibdir = $(sitedir)/$(ruby_version)
|
|
37
|
+
sitedir = $(rubylibprefix)/site_ruby
|
|
38
|
+
rubyarchdir = $(rubylibdir)/$(arch)
|
|
39
|
+
rubylibdir = $(rubylibprefix)/$(ruby_version)
|
|
40
|
+
sitearchincludedir = $(includedir)/$(sitearch)
|
|
41
|
+
archincludedir = $(includedir)/$(arch)
|
|
42
|
+
sitearchlibdir = $(libdir)/$(sitearch)
|
|
43
|
+
archlibdir = $(libdir)/$(arch)
|
|
44
|
+
ridir = $(datarootdir)/$(RI_BASE_NAME)
|
|
45
|
+
modular_gc_dir = $(DESTDIR)
|
|
46
|
+
mandir = $(datarootdir)/man
|
|
47
|
+
localedir = $(datarootdir)/locale
|
|
48
|
+
libdir = $(exec_prefix)/lib
|
|
49
|
+
psdir = $(docdir)
|
|
50
|
+
pdfdir = $(docdir)
|
|
51
|
+
dvidir = $(docdir)
|
|
52
|
+
htmldir = $(docdir)
|
|
53
|
+
infodir = $(datarootdir)/info
|
|
54
|
+
docdir = $(datarootdir)/doc/$(PACKAGE)
|
|
55
|
+
oldincludedir = $(DESTDIR)/usr/include
|
|
56
|
+
includedir = $(SDKROOT)$(prefix)/include
|
|
57
|
+
runstatedir = $(localstatedir)/run
|
|
58
|
+
localstatedir = $(prefix)/var
|
|
59
|
+
sharedstatedir = $(prefix)/com
|
|
60
|
+
sysconfdir = $(prefix)/etc
|
|
61
|
+
datadir = $(datarootdir)
|
|
62
|
+
datarootdir = $(prefix)/share
|
|
63
|
+
libexecdir = $(exec_prefix)/libexec
|
|
64
|
+
sbindir = $(exec_prefix)/sbin
|
|
65
|
+
bindir = $(exec_prefix)/bin
|
|
66
|
+
archdir = $(rubyarchdir)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
CC_WRAPPER =
|
|
70
|
+
CC = clang
|
|
71
|
+
CXX = clang++
|
|
72
|
+
LIBRUBY = $(LIBRUBY_SO)
|
|
73
|
+
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
|
74
|
+
LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
|
|
75
|
+
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework CoreFoundation $(MAINLIBS)
|
|
76
|
+
empty =
|
|
77
|
+
OUTFLAG = -o $(empty)
|
|
78
|
+
COUTFLAG = -o $(empty)
|
|
79
|
+
CSRCFLAG = $(empty)
|
|
80
|
+
|
|
81
|
+
RUBY_EXTCONF_H =
|
|
82
|
+
cflags = $(hardenflags) -fdeclspec $(optflags) $(debugflags) $(warnflags)
|
|
83
|
+
cxxflags =
|
|
84
|
+
optflags = -O3 -fno-fast-math
|
|
85
|
+
debugflags = -ggdb3
|
|
86
|
+
warnflags = -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wmisleading-indentation -Wundef
|
|
87
|
+
cppflags =
|
|
88
|
+
CCDLFLAGS = -fno-common
|
|
89
|
+
CFLAGS = $(CCDLFLAGS) $(cflags) -fno-common -pipe -O3 -std=c11 -Wall -Wextra -DNDEBUG -I/Users/louis-mullie/Documents/GitHub/autotype/native/autotype/include $(ARCH_FLAG)
|
|
90
|
+
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
|
|
91
|
+
DEFS =
|
|
92
|
+
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
|
|
93
|
+
CXXFLAGS = $(CCDLFLAGS) -fdeclspec $(ARCH_FLAG)
|
|
94
|
+
ldflags = -L. -fstack-protector-strong
|
|
95
|
+
dldflags = -Wl,-undefined,dynamic_lookup
|
|
96
|
+
ARCH_FLAG = -arch arm64
|
|
97
|
+
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
|
|
98
|
+
LDSHARED = $(CC) -dynamic -bundle
|
|
99
|
+
LDSHAREDXX = $(CXX) -dynamic -bundle
|
|
100
|
+
POSTLINK = dsymutil $@ 2>/dev/null; { test -z '$(RUBY_CODESIGN)' || codesign -s '$(RUBY_CODESIGN)' $@; }
|
|
101
|
+
AR = ar
|
|
102
|
+
LD = ld
|
|
103
|
+
EXEEXT =
|
|
104
|
+
|
|
105
|
+
RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
|
|
106
|
+
RUBY_SO_NAME = ruby.3.4
|
|
107
|
+
RUBYW_INSTALL_NAME =
|
|
108
|
+
RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
|
|
109
|
+
RUBYW_BASE_NAME = rubyw
|
|
110
|
+
RUBY_BASE_NAME = ruby
|
|
111
|
+
|
|
112
|
+
arch = arm64-darwin24
|
|
113
|
+
sitearch = $(arch)
|
|
114
|
+
ruby_version = 3.4.0
|
|
115
|
+
ruby = $(bindir)/$(RUBY_BASE_NAME)
|
|
116
|
+
RUBY = $(ruby)
|
|
117
|
+
BUILTRUBY = $(bindir)/$(RUBY_BASE_NAME)
|
|
118
|
+
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
|
|
119
|
+
|
|
120
|
+
RM = rm -f
|
|
121
|
+
RM_RF = rm -fr
|
|
122
|
+
RMDIRS = rmdir -p
|
|
123
|
+
MAKEDIRS = mkdir -p
|
|
124
|
+
INSTALL = /usr/bin/install -c
|
|
125
|
+
INSTALL_PROG = $(INSTALL) -m 0755
|
|
126
|
+
INSTALL_DATA = $(INSTALL) -m 644
|
|
127
|
+
COPY = cp
|
|
128
|
+
TOUCH = exit >
|
|
129
|
+
|
|
130
|
+
#### End of system configuration section. ####
|
|
131
|
+
|
|
132
|
+
preload =
|
|
133
|
+
libpath = . $(libdir)
|
|
134
|
+
LIBPATH = -L. -L$(libdir)
|
|
135
|
+
DEFFILE =
|
|
136
|
+
|
|
137
|
+
CLEANFILES = mkmf.log
|
|
138
|
+
DISTCLEANFILES =
|
|
139
|
+
DISTCLEANDIRS =
|
|
140
|
+
|
|
141
|
+
extout =
|
|
142
|
+
extout_prefix =
|
|
143
|
+
target_prefix =
|
|
144
|
+
LOCAL_LIBS =
|
|
145
|
+
LIBS = $(LIBRUBYARG_SHARED) -lpthread
|
|
146
|
+
ORIG_SRCS = autotype.c
|
|
147
|
+
SRCS = $(ORIG_SRCS) type.c solver.c autotype.c
|
|
148
|
+
OBJS = type.o solver.o autotype.o
|
|
149
|
+
HDRS =
|
|
150
|
+
LOCAL_HDRS =
|
|
151
|
+
TARGET = autotype
|
|
152
|
+
TARGET_NAME = autotype
|
|
153
|
+
TARGET_ENTRY = Init_$(TARGET_NAME)
|
|
154
|
+
DLLIB = $(TARGET).bundle
|
|
155
|
+
EXTSTATIC =
|
|
156
|
+
STATIC_LIB =
|
|
157
|
+
|
|
158
|
+
TIMESTAMP_DIR = .
|
|
159
|
+
BINDIR = $(bindir)
|
|
160
|
+
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
|
161
|
+
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
|
162
|
+
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
|
163
|
+
HDRDIR = $(sitehdrdir)$(target_prefix)
|
|
164
|
+
ARCHHDRDIR = $(sitearchhdrdir)$(target_prefix)
|
|
165
|
+
TARGET_SO_DIR =
|
|
166
|
+
TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
|
|
167
|
+
CLEANLIBS = $(TARGET_SO) $(TARGET_SO:=.dSYM)
|
|
168
|
+
CLEANOBJS = $(OBJS) *.bak
|
|
169
|
+
TARGET_SO_DIR_TIMESTAMP = $(TIMESTAMP_DIR)/.sitearchdir.time
|
|
170
|
+
|
|
171
|
+
all: $(DLLIB)
|
|
172
|
+
static: $(STATIC_LIB)
|
|
173
|
+
.PHONY: all install static install-so install-rb
|
|
174
|
+
.PHONY: clean clean-so clean-static clean-rb
|
|
175
|
+
|
|
176
|
+
clean-static::
|
|
177
|
+
clean-rb-default::
|
|
178
|
+
clean-rb::
|
|
179
|
+
clean-so::
|
|
180
|
+
clean: clean-so clean-static clean-rb-default clean-rb
|
|
181
|
+
-$(Q)$(RM_RF) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
|
|
182
|
+
|
|
183
|
+
distclean-rb-default::
|
|
184
|
+
distclean-rb::
|
|
185
|
+
distclean-so::
|
|
186
|
+
distclean-static::
|
|
187
|
+
distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
|
|
188
|
+
-$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
|
189
|
+
-$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
|
190
|
+
-$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
|
|
191
|
+
|
|
192
|
+
realclean: distclean
|
|
193
|
+
install: install-so install-rb
|
|
194
|
+
|
|
195
|
+
install-so: $(DLLIB) $(TARGET_SO_DIR_TIMESTAMP)
|
|
196
|
+
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
|
197
|
+
clean-static::
|
|
198
|
+
-$(Q)$(RM) $(STATIC_LIB)
|
|
199
|
+
install-rb: pre-install-rb do-install-rb install-rb-default
|
|
200
|
+
install-rb-default: pre-install-rb-default do-install-rb-default
|
|
201
|
+
pre-install-rb: Makefile
|
|
202
|
+
pre-install-rb-default: Makefile
|
|
203
|
+
do-install-rb:
|
|
204
|
+
do-install-rb-default:
|
|
205
|
+
pre-install-rb-default:
|
|
206
|
+
@$(NULLCMD)
|
|
207
|
+
$(TARGET_SO_DIR_TIMESTAMP):
|
|
208
|
+
$(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
|
|
209
|
+
$(Q) $(TOUCH) $@
|
|
210
|
+
|
|
211
|
+
site-install: site-install-so site-install-rb
|
|
212
|
+
site-install-so: install-so
|
|
213
|
+
site-install-rb: install-rb
|
|
214
|
+
|
|
215
|
+
.SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
|
|
216
|
+
|
|
217
|
+
.cc.o:
|
|
218
|
+
$(ECHO) compiling $(<)
|
|
219
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
|
220
|
+
|
|
221
|
+
.cc.S:
|
|
222
|
+
$(ECHO) translating $(<)
|
|
223
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
|
224
|
+
|
|
225
|
+
.mm.o:
|
|
226
|
+
$(ECHO) compiling $(<)
|
|
227
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
|
228
|
+
|
|
229
|
+
.mm.S:
|
|
230
|
+
$(ECHO) translating $(<)
|
|
231
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
|
232
|
+
|
|
233
|
+
.cxx.o:
|
|
234
|
+
$(ECHO) compiling $(<)
|
|
235
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
|
236
|
+
|
|
237
|
+
.cxx.S:
|
|
238
|
+
$(ECHO) translating $(<)
|
|
239
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
|
240
|
+
|
|
241
|
+
.cpp.o:
|
|
242
|
+
$(ECHO) compiling $(<)
|
|
243
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
|
244
|
+
|
|
245
|
+
.cpp.S:
|
|
246
|
+
$(ECHO) translating $(<)
|
|
247
|
+
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
|
248
|
+
|
|
249
|
+
.c.o:
|
|
250
|
+
$(ECHO) compiling $(<)
|
|
251
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
|
252
|
+
|
|
253
|
+
.c.S:
|
|
254
|
+
$(ECHO) translating $(<)
|
|
255
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
|
256
|
+
|
|
257
|
+
.m.o:
|
|
258
|
+
$(ECHO) compiling $(<)
|
|
259
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
|
260
|
+
|
|
261
|
+
.m.S:
|
|
262
|
+
$(ECHO) translating $(<)
|
|
263
|
+
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
|
264
|
+
|
|
265
|
+
$(TARGET_SO): $(OBJS) Makefile
|
|
266
|
+
$(ECHO) linking shared-object $(DLLIB)
|
|
267
|
+
-$(Q)$(RM) $(@)
|
|
268
|
+
$(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
|
269
|
+
$(Q) $(POSTLINK)
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
$(OBJS): $(HDRS) $(ruby_headers)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
+
<string>English</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>com.apple.xcode.dsym.autotype.bundle</string>
|
|
9
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
10
|
+
<string>6.0</string>
|
|
11
|
+
<key>CFBundlePackageType</key>
|
|
12
|
+
<string>dSYM</string>
|
|
13
|
+
<key>CFBundleSignature</key>
|
|
14
|
+
<string>????</string>
|
|
15
|
+
<key>CFBundleShortVersionString</key>
|
|
16
|
+
<string>1.0</string>
|
|
17
|
+
<key>CFBundleVersion</key>
|
|
18
|
+
<string>1</string>
|
|
19
|
+
</dict>
|
|
20
|
+
</plist>
|