ndtypes 0.2.0dev4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTING.md +50 -0
  3. data/Gemfile +2 -0
  4. data/History.md +0 -0
  5. data/README.md +19 -0
  6. data/Rakefile +125 -0
  7. data/ext/ruby_ndtypes/extconf.rb +55 -0
  8. data/ext/ruby_ndtypes/gc_guard.c +36 -0
  9. data/ext/ruby_ndtypes/gc_guard.h +12 -0
  10. data/ext/ruby_ndtypes/ndtypes/AUTHORS.txt +5 -0
  11. data/ext/ruby_ndtypes/ndtypes/INSTALL.txt +101 -0
  12. data/ext/ruby_ndtypes/ndtypes/LICENSE.txt +29 -0
  13. data/ext/ruby_ndtypes/ndtypes/MANIFEST.in +3 -0
  14. data/ext/ruby_ndtypes/ndtypes/Makefile.in +87 -0
  15. data/ext/ruby_ndtypes/ndtypes/README.rst +47 -0
  16. data/ext/ruby_ndtypes/ndtypes/config.guess +1530 -0
  17. data/ext/ruby_ndtypes/ndtypes/config.h.in +67 -0
  18. data/ext/ruby_ndtypes/ndtypes/config.sub +1782 -0
  19. data/ext/ruby_ndtypes/ndtypes/configure +5260 -0
  20. data/ext/ruby_ndtypes/ndtypes/configure.ac +161 -0
  21. data/ext/ruby_ndtypes/ndtypes/doc/Makefile +14 -0
  22. data/ext/ruby_ndtypes/ndtypes/doc/_static/copybutton.js +66 -0
  23. data/ext/ruby_ndtypes/ndtypes/doc/conf.py +26 -0
  24. data/ext/ruby_ndtypes/ndtypes/doc/grammar/grammar.rst +27 -0
  25. data/ext/ruby_ndtypes/ndtypes/doc/index.rst +56 -0
  26. data/ext/ruby_ndtypes/ndtypes/doc/libndtypes/context.rst +131 -0
  27. data/ext/ruby_ndtypes/ndtypes/doc/libndtypes/encodings.rst +68 -0
  28. data/ext/ruby_ndtypes/ndtypes/doc/libndtypes/fields-values.rst +175 -0
  29. data/ext/ruby_ndtypes/ndtypes/doc/libndtypes/functions.rst +72 -0
  30. data/ext/ruby_ndtypes/ndtypes/doc/libndtypes/index.rst +43 -0
  31. data/ext/ruby_ndtypes/ndtypes/doc/libndtypes/init.rst +48 -0
  32. data/ext/ruby_ndtypes/ndtypes/doc/libndtypes/io.rst +100 -0
  33. data/ext/ruby_ndtypes/ndtypes/doc/libndtypes/memory.rst +124 -0
  34. data/ext/ruby_ndtypes/ndtypes/doc/libndtypes/predicates.rst +110 -0
  35. data/ext/ruby_ndtypes/ndtypes/doc/libndtypes/typedef.rst +31 -0
  36. data/ext/ruby_ndtypes/ndtypes/doc/libndtypes/types.rst +594 -0
  37. data/ext/ruby_ndtypes/ndtypes/doc/libndtypes/util.rst +166 -0
  38. data/ext/ruby_ndtypes/ndtypes/doc/ndtypes/buffer-protocol.rst +27 -0
  39. data/ext/ruby_ndtypes/ndtypes/doc/ndtypes/index.rst +21 -0
  40. data/ext/ruby_ndtypes/ndtypes/doc/ndtypes/pattern-matching.rst +330 -0
  41. data/ext/ruby_ndtypes/ndtypes/doc/ndtypes/quickstart.rst +144 -0
  42. data/ext/ruby_ndtypes/ndtypes/doc/ndtypes/types.rst +544 -0
  43. data/ext/ruby_ndtypes/ndtypes/doc/releases/index.rst +35 -0
  44. data/ext/ruby_ndtypes/ndtypes/install-sh +527 -0
  45. data/ext/ruby_ndtypes/ndtypes/libndtypes/Makefile.in +271 -0
  46. data/ext/ruby_ndtypes/ndtypes/libndtypes/Makefile.vc +269 -0
  47. data/ext/ruby_ndtypes/ndtypes/libndtypes/alloc.c +230 -0
  48. data/ext/ruby_ndtypes/ndtypes/libndtypes/attr.c +268 -0
  49. data/ext/ruby_ndtypes/ndtypes/libndtypes/attr.h +109 -0
  50. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/Makefile.in +73 -0
  51. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/Makefile.vc +70 -0
  52. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/README.txt +16 -0
  53. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/bpgrammar.c +2179 -0
  54. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/bpgrammar.h +134 -0
  55. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/bpgrammar.y +428 -0
  56. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/bplexer.c +2543 -0
  57. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/bplexer.h +735 -0
  58. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/bplexer.l +176 -0
  59. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/export.c +543 -0
  60. data/ext/ruby_ndtypes/ndtypes/libndtypes/compat/import.c +110 -0
  61. data/ext/ruby_ndtypes/ndtypes/libndtypes/context.c +228 -0
  62. data/ext/ruby_ndtypes/ndtypes/libndtypes/copy.c +634 -0
  63. data/ext/ruby_ndtypes/ndtypes/libndtypes/encodings.c +116 -0
  64. data/ext/ruby_ndtypes/ndtypes/libndtypes/equal.c +288 -0
  65. data/ext/ruby_ndtypes/ndtypes/libndtypes/grammar.c +3067 -0
  66. data/ext/ruby_ndtypes/ndtypes/libndtypes/grammar.h +180 -0
  67. data/ext/ruby_ndtypes/ndtypes/libndtypes/grammar.y +417 -0
  68. data/ext/ruby_ndtypes/ndtypes/libndtypes/io.c +1658 -0
  69. data/ext/ruby_ndtypes/ndtypes/libndtypes/lexer.c +2773 -0
  70. data/ext/ruby_ndtypes/ndtypes/libndtypes/lexer.h +734 -0
  71. data/ext/ruby_ndtypes/ndtypes/libndtypes/lexer.l +222 -0
  72. data/ext/ruby_ndtypes/ndtypes/libndtypes/match.c +1132 -0
  73. data/ext/ruby_ndtypes/ndtypes/libndtypes/ndtypes.c +2323 -0
  74. data/ext/ruby_ndtypes/ndtypes/libndtypes/ndtypes.h.in +893 -0
  75. data/ext/ruby_ndtypes/ndtypes/libndtypes/overflow.h +161 -0
  76. data/ext/ruby_ndtypes/ndtypes/libndtypes/parsefuncs.c +473 -0
  77. data/ext/ruby_ndtypes/ndtypes/libndtypes/parsefuncs.h +92 -0
  78. data/ext/ruby_ndtypes/ndtypes/libndtypes/parser.c +246 -0
  79. data/ext/ruby_ndtypes/ndtypes/libndtypes/seq.c +269 -0
  80. data/ext/ruby_ndtypes/ndtypes/libndtypes/seq.h +197 -0
  81. data/ext/ruby_ndtypes/ndtypes/libndtypes/serialize/Makefile.in +48 -0
  82. data/ext/ruby_ndtypes/ndtypes/libndtypes/serialize/Makefile.vc +46 -0
  83. data/ext/ruby_ndtypes/ndtypes/libndtypes/serialize/deserialize.c +1007 -0
  84. data/ext/ruby_ndtypes/ndtypes/libndtypes/serialize/serialize.c +442 -0
  85. data/ext/ruby_ndtypes/ndtypes/libndtypes/slice.h +42 -0
  86. data/ext/ruby_ndtypes/ndtypes/libndtypes/substitute.c +238 -0
  87. data/ext/ruby_ndtypes/ndtypes/libndtypes/substitute.h +50 -0
  88. data/ext/ruby_ndtypes/ndtypes/libndtypes/symtable.c +371 -0
  89. data/ext/ruby_ndtypes/ndtypes/libndtypes/symtable.h +100 -0
  90. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/Makefile.in +55 -0
  91. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/Makefile.vc +45 -0
  92. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/alloc_fail.c +82 -0
  93. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/alloc_fail.h +49 -0
  94. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/runtest.c +1657 -0
  95. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test.h +85 -0
  96. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_array.c +115 -0
  97. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_buffer.c +137 -0
  98. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_indent.c +201 -0
  99. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_match.c +2397 -0
  100. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_numba.c +57 -0
  101. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_parse.c +349 -0
  102. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_parse_error.c +27839 -0
  103. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_parse_roundtrip.c +350 -0
  104. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_record.c +231 -0
  105. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_typecheck.c +375 -0
  106. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/test_typedef.c +65 -0
  107. data/ext/ruby_ndtypes/ndtypes/libndtypes/tests/valgrind.supp +30 -0
  108. data/ext/ruby_ndtypes/ndtypes/libndtypes/tools/bench.c +79 -0
  109. data/ext/ruby_ndtypes/ndtypes/libndtypes/tools/indent.c +94 -0
  110. data/ext/ruby_ndtypes/ndtypes/libndtypes/tools/print_ast.c +96 -0
  111. data/ext/ruby_ndtypes/ndtypes/libndtypes/util.c +474 -0
  112. data/ext/ruby_ndtypes/ndtypes/libndtypes/values.c +228 -0
  113. data/ext/ruby_ndtypes/ndtypes/python/bench.py +49 -0
  114. data/ext/ruby_ndtypes/ndtypes/python/ndt_randtype.py +409 -0
  115. data/ext/ruby_ndtypes/ndtypes/python/ndt_support.py +14 -0
  116. data/ext/ruby_ndtypes/ndtypes/python/ndtypes/__init__.py +70 -0
  117. data/ext/ruby_ndtypes/ndtypes/python/ndtypes/_ndtypes.c +1332 -0
  118. data/ext/ruby_ndtypes/ndtypes/python/ndtypes/docstrings.h +319 -0
  119. data/ext/ruby_ndtypes/ndtypes/python/ndtypes/pyndtypes.h +154 -0
  120. data/ext/ruby_ndtypes/ndtypes/python/test_ndtypes.py +1977 -0
  121. data/ext/ruby_ndtypes/ndtypes/setup.py +288 -0
  122. data/ext/ruby_ndtypes/ndtypes/vcbuild/INSTALL.txt +41 -0
  123. data/ext/ruby_ndtypes/ndtypes/vcbuild/runtest32.bat +15 -0
  124. data/ext/ruby_ndtypes/ndtypes/vcbuild/runtest64.bat +13 -0
  125. data/ext/ruby_ndtypes/ndtypes/vcbuild/vcbuild32.bat +38 -0
  126. data/ext/ruby_ndtypes/ndtypes/vcbuild/vcbuild64.bat +38 -0
  127. data/ext/ruby_ndtypes/ndtypes/vcbuild/vcclean.bat +13 -0
  128. data/ext/ruby_ndtypes/ndtypes/vcbuild/vcdistclean.bat +14 -0
  129. data/ext/ruby_ndtypes/ruby_ndtypes.c +1003 -0
  130. data/ext/ruby_ndtypes/ruby_ndtypes.h +37 -0
  131. data/ext/ruby_ndtypes/ruby_ndtypes_internal.h +28 -0
  132. data/lib/ndtypes.rb +45 -0
  133. data/lib/ndtypes/errors.rb +2 -0
  134. data/lib/ndtypes/version.rb +6 -0
  135. data/ndtypes.gemspec +47 -0
  136. data/spec/gc_table_spec.rb +10 -0
  137. data/spec/ndtypes_spec.rb +289 -0
  138. data/spec/spec_helper.rb +241 -0
  139. metadata +242 -0
@@ -0,0 +1,271 @@
1
+
2
+ # ==============================================================================
3
+ # Unix Makefile for libndtypes
4
+ # ==============================================================================
5
+
6
+
7
+ LIBSTATIC = @LIBSTATIC@
8
+ LIBNAME = @LIBNAME@
9
+ LIBSONAME = @LIBSONAME@
10
+ LIBSHARED = @LIBSHARED@
11
+
12
+ CC = @CC@
13
+ LD = @LD@
14
+ AR = @AR@
15
+ RANLIB = @RANLIB@
16
+
17
+ CONFIGURE_CFLAGS = @CONFIGURE_CFLAGS@
18
+ NDT_CFLAGS = $(strip $(CONFIGURE_CFLAGS) $(CFLAGS))
19
+ NDT_CFLAGS_SHARED = $(NDT_CFLAGS) -fPIC
20
+
21
+ CONFIGURE_LDFLAGS = @CONFIGURE_LDFLAGS@
22
+ NDT_LDFLAGS = $(strip $(CONFIGURE_LDFLAGS) $(LDFLAGS))
23
+
24
+ CONFIGURE_COV_CFLAGS = @CONFIGURE_COV_CFLAGS@
25
+ CONFIGURE_COV_LDFLAGS = @CONFIGURE_COV_LDFLAGS@
26
+ ifeq ($(MAKECMDGOALS), coverage)
27
+ NDT_CFLAGS = $(strip $(CONFIGURE_COV_CFLAGS) $(CFLAGS))
28
+ NDT_LDFLAGS = $(strip $(CONFIGURE_COV_LDFLAGS) $(LDFLAGS))
29
+ endif
30
+
31
+
32
+ default: $(LIBSTATIC) $(LIBSHARED)
33
+
34
+
35
+ OBJS = alloc.o attr.o context.o copy.o encodings.o equal.o grammar.o io.o \
36
+ lexer.o match.o ndtypes.o parsefuncs.o parser.o seq.o substitute.o \
37
+ symtable.o util.o values.o
38
+
39
+ SHARED_OBJS = .objs/alloc.o .objs/attr.o .objs/context.o .objs/copy.o \
40
+ .objs/encodings.o .objs/equal.o .objs/grammar.o .objs/io.o \
41
+ .objs/lexer.o .objs/match.o .objs/ndtypes.o .objs/parsefuncs.o \
42
+ .objs/parser.o .objs/seq.o .objs/substitute.o .objs/symtable.o \
43
+ .objs/util.o .objs/values.o
44
+
45
+
46
+ COMPAT_OBJS = compat/bpgrammar.o compat/bplexer.o compat/import.o compat/export.o
47
+
48
+ COMPAT_SHARED_OBJS = compat/.objs/bpgrammar.o compat/.objs/bplexer.o \
49
+ compat/.objs/import.o compat/.objs/export.o
50
+
51
+ SERIALIZE_OBJS = serialize/serialize.o serialize/deserialize.o
52
+
53
+ SERIALIZE_SHARED_OBJS = serialize/.objs/serialize.o serialize/.objs/deserialize.o
54
+
55
+
56
+ $(LIBSTATIC): Makefile $(OBJS) $(COMPAT_OBJS) $(SERIALIZE_OBJS)
57
+ $(AR) rc $(LIBSTATIC) $(OBJS) $(COMPAT_OBJS) $(SERIALIZE_OBJS)
58
+ $(RANLIB) $(LIBSTATIC)
59
+
60
+
61
+ $(LIBSHARED): Makefile $(SHARED_OBJS) $(COMPAT_SHARED_OBJS) $(SERIALIZE_SHARED_OBJS)
62
+ $(LD) $(NDT_LDFLAGS) -o $(LIBSHARED) $(SHARED_OBJS) $(COMPAT_SHARED_OBJS) $(SERIALIZE_SHARED_OBJS)
63
+ ln -sf $(LIBSHARED) $(LIBNAME)
64
+ ln -sf $(LIBSHARED) $(LIBSONAME)
65
+
66
+
67
+ alloc.o:\
68
+ Makefile alloc.c ndtypes.h
69
+ $(CC) $(NDT_CFLAGS) -c alloc.c
70
+
71
+ .objs/alloc.o:\
72
+ Makefile alloc.c ndtypes.h
73
+ $(CC) $(NDT_CFLAGS_SHARED) -c alloc.c -o .objs/alloc.o
74
+
75
+ attr.o:\
76
+ Makefile attr.c attr.h ndtypes.h
77
+ $(CC) $(NDT_CFLAGS) -c attr.c
78
+
79
+ .objs/attr.o:\
80
+ Makefile attr.c attr.h ndtypes.h
81
+ $(CC) $(NDT_CFLAGS_SHARED) -c attr.c -o .objs/attr.o
82
+
83
+ context.o:\
84
+ Makefile context.c ndtypes.h
85
+ $(CC) $(NDT_CFLAGS) -c context.c
86
+
87
+ .objs/context.o:\
88
+ Makefile context.c ndtypes.h
89
+ $(CC) $(NDT_CFLAGS_SHARED) -c context.c -o .objs/context.o
90
+
91
+ copy.o:\
92
+ Makefile copy.c ndtypes.h
93
+ $(CC) $(NDT_CFLAGS) -c copy.c
94
+
95
+ .objs/copy.o:\
96
+ Makefile copy.c ndtypes.h
97
+ $(CC) $(NDT_CFLAGS_SHARED) -c copy.c -o .objs/copy.o
98
+
99
+ encodings.o:\
100
+ Makefile encodings.c ndtypes.h
101
+ $(CC) $(NDT_CFLAGS) -c encodings.c
102
+
103
+ .objs/encodings.o:\
104
+ Makefile encodings.c ndtypes.h
105
+ $(CC) $(NDT_CFLAGS_SHARED) -c encodings.c -o .objs/encodings.o
106
+
107
+ io.o:\
108
+ Makefile io.c ndtypes.h
109
+ $(CC) $(NDT_CFLAGS) -c io.c
110
+
111
+ .objs/io.o:\
112
+ Makefile io.c ndtypes.h
113
+ $(CC) $(NDT_CFLAGS_SHARED) -c io.c -o .objs/io.o
114
+
115
+ equal.o:\
116
+ Makefile equal.c ndtypes.h
117
+ $(CC) $(NDT_CFLAGS) -c equal.c
118
+
119
+ .objs/equal.o:\
120
+ Makefile equal.c ndtypes.h
121
+ $(CC) $(NDT_CFLAGS_SHARED) -c equal.c -o .objs/equal.o
122
+
123
+ grammar.o:\
124
+ Makefile grammar.c grammar.h lexer.h ndtypes.h parsefuncs.h seq.h
125
+ $(CC) $(NDT_CFLAGS) -c grammar.c
126
+
127
+ .objs/grammar.o:\
128
+ Makefile grammar.c grammar.h lexer.h ndtypes.h parsefuncs.h seq.h
129
+ $(CC) $(NDT_CFLAGS_SHARED) -c grammar.c -o .objs/grammar.o
130
+
131
+ lexer.o:\
132
+ Makefile lexer.c grammar.h lexer.h parsefuncs.h
133
+ $(CC) $(NDT_CFLAGS) -c lexer.c
134
+
135
+ .objs/lexer.o:\
136
+ Makefile lexer.c grammar.h lexer.h parsefuncs.h
137
+ $(CC) $(NDT_CFLAGS_SHARED) -c lexer.c -o .objs/lexer.o
138
+
139
+ match.o:\
140
+ Makefile match.c ndtypes.h symtable.h
141
+ $(CC) $(NDT_CFLAGS) -c match.c
142
+
143
+ .objs/match.o:\
144
+ Makefile match.c ndtypes.h symtable.h
145
+ $(CC) $(NDT_CFLAGS_SHARED) -c match.c -o .objs/match.o
146
+
147
+ ndtypes.o:\
148
+ Makefile ndtypes.c ndtypes.h
149
+ $(CC) $(NDT_CFLAGS) -c ndtypes.c
150
+
151
+ .objs/ndtypes.o:\
152
+ Makefile ndtypes.c ndtypes.h
153
+ $(CC) $(NDT_CFLAGS_SHARED) -c ndtypes.c -o .objs/ndtypes.o
154
+
155
+ parsefuncs.o:\
156
+ Makefile parsefuncs.c ndtypes.h parsefuncs.h seq.h
157
+ $(CC) $(NDT_CFLAGS) -c parsefuncs.c
158
+
159
+ .objs/parsefuncs.o:\
160
+ Makefile parsefuncs.c ndtypes.h parsefuncs.h seq.h
161
+ $(CC) $(NDT_CFLAGS_SHARED) -c parsefuncs.c -o .objs/parsefuncs.o
162
+
163
+ parser.o:\
164
+ Makefile parser.c grammar.h lexer.h ndtypes.h seq.h
165
+ $(CC) $(NDT_CFLAGS) -c parser.c
166
+
167
+ .objs/parser.o:\
168
+ Makefile parser.c grammar.h lexer.h ndtypes.h seq.h
169
+ $(CC) $(NDT_CFLAGS_SHARED) -c parser.c -o .objs/parser.o
170
+
171
+ seq.o:\
172
+ Makefile seq.c ndtypes.h seq.h
173
+ $(CC) $(NDT_CFLAGS) -c seq.c
174
+
175
+ .objs/seq.o:\
176
+ Makefile seq.c ndtypes.h seq.h
177
+ $(CC) $(NDT_CFLAGS_SHARED) -c seq.c -o .objs/seq.o
178
+
179
+ substitute.o:\
180
+ Makefile substitute.c ndtypes.h substitute.h symtable.h
181
+ $(CC) $(NDT_CFLAGS) -c substitute.c
182
+
183
+ .objs/substitute.o:\
184
+ Makefile substitute.c ndtypes.h substitute.h symtable.h
185
+ $(CC) $(NDT_CFLAGS_SHARED) -c substitute.c -o .objs/substitute.o
186
+
187
+ symtable.o:\
188
+ Makefile symtable.c ndtypes.h symtable.h
189
+ $(CC) $(NDT_CFLAGS) -c symtable.c
190
+
191
+ .objs/symtable.o:\
192
+ Makefile symtable.c ndtypes.h symtable.h
193
+ $(CC) $(NDT_CFLAGS_SHARED) -c symtable.c -o .objs/symtable.o
194
+
195
+ util.o:\
196
+ Makefile util.c ndtypes.h
197
+ $(CC) $(NDT_CFLAGS) -c util.c
198
+
199
+ .objs/util.o:\
200
+ Makefile util.c ndtypes.h
201
+ $(CC) $(NDT_CFLAGS_SHARED) -c util.c -o .objs/util.o
202
+
203
+ values.o:\
204
+ Makefile values.c ndtypes.h
205
+ $(CC) $(NDT_CFLAGS) -c values.c
206
+
207
+ .objs/values.o:\
208
+ Makefile values.c ndtypes.h
209
+ $(CC) $(NDT_CFLAGS_SHARED) -c values.c -o .objs/values.o
210
+
211
+
212
+ # Without these, GNU make automatically builds the parser.
213
+ %.c: %.y
214
+ %.c: %.l
215
+
216
+ parser: FORCE
217
+ bison -Wall -o grammar.c -pndt_yy --defines=grammar.h grammar.y
218
+ flex -o lexer.c -Pndt_yy --header-file=lexer.h lexer.l
219
+
220
+
221
+ # compat directory
222
+ $(COMPAT_OBJS) $(COMPAT_SHARED_OBJS):\
223
+ Makefile compat/Makefile compat/bpgrammar.y compat/bplexer.l compat/import.c \
224
+ ndtypes.h seq.h
225
+ cd compat && make
226
+
227
+ # serialize directory
228
+ $(SERIALIZE_OBJS) $(SERIALIZE_SHARED_OBJS):\
229
+ Makefile serialize/Makefile serialize/serialize.c ndtypes.h
230
+ cd serialize && make
231
+
232
+
233
+ # Coverage
234
+ coverage:\
235
+ Makefile clean $(LIBSTATIC) $(LIBSHARED)
236
+
237
+
238
+ # Benchmark
239
+ bench:\
240
+ Makefile tools/bench.c ndtypes.h $(LIBSTATIC)
241
+ $(CC) -I. $(NDT_CFLAGS) -o bench tools/bench.c $(LIBSTATIC)
242
+
243
+
244
+ # Print the AST
245
+ print_ast:\
246
+ Makefile tools/print_ast.c ndtypes.h $(LIBSTATIC)
247
+ $(CC) -I. $(NDT_CFLAGS) -o print_ast tools/print_ast.c $(LIBSTATIC)
248
+
249
+
250
+ # Indent a file that contains a datashape type
251
+ indent:\
252
+ Makefile tools/indent.c ndtypes.h $(LIBSTATIC)
253
+ $(CC) -I. $(NDT_CFLAGS) -o indent tools/indent.c $(LIBSTATIC)
254
+
255
+
256
+ FORCE:
257
+
258
+ clean: FORCE
259
+ rm -f *.o *.so *.gch *.gcda *.gcno *.gcov *.dyn *.dpi *.lock
260
+ rm -f bench indent print_ast $(LIBSTATIC) $(LIBSHARED) $(LIBSONAME) $(LIBNAME)
261
+ cd .objs && rm -f *.o *.so *.gch *.gcda *.gcno *.gcov *.dyn *.dpi *.lock
262
+ cd compat && make clean
263
+ cd serialize && make clean
264
+
265
+ distclean: clean
266
+ rm -f Makefile ndtypes.h
267
+ cd compat && make distclean
268
+ cd serialize && make distclean
269
+
270
+
271
+
@@ -0,0 +1,269 @@
1
+
2
+ # ======================================================================
3
+ # Visual C (nmake) Makefile for libndtypes
4
+ # ======================================================================
5
+
6
+ LIBSTATIC = libndtypes-0.2.0dev3.lib
7
+ LIBIMPORT = libndtypes-0.2.0dev3.dll.lib
8
+ LIBSHARED = libndtypes-0.2.0dev3.dll
9
+
10
+ OPT = /MT /Ox /GS /EHsc
11
+ OPT_SHARED = /DNDT_EXPORT /MD /Ox /GS /EHsc /Fo.objs^\
12
+
13
+ COMMON_CFLAGS = /nologo /W4 /wd4200 /wd4201 /wd4204
14
+ COMMON_CFLAGS_FOR_GENERATED = /nologo /W4 /wd4200 /wd4201 /wd4244 /wd4267 /wd4702 /wd4127 /DYY_NO_UNISTD_H=1 /D__STDC_VERSION__=199901L
15
+ COMMON_CFLAGS_FOR_PARSER = /nologo /W4 /wd4200 /wd4201 /wd4090 /nologo /DYY_NO_UNISTD_H=1
16
+
17
+ CFLAGS = $(COMMON_CFLAGS) $(OPT)
18
+ CFLAGS_SHARED = $(COMMON_CFLAGS) $(OPT_SHARED)
19
+
20
+ CFLAGS_FOR_GENERATED = $(COMMON_CFLAGS_FOR_GENERATED) $(OPT)
21
+ CFLAGS_FOR_GENERATED_SHARED = $(COMMON_CFLAGS_FOR_GENERATED) $(OPT_SHARED)
22
+
23
+ CFLAGS_FOR_PARSER = $(COMMON_CFLAGS_FOR_PARSER) $(OPT)
24
+ CFLAGS_FOR_PARSER_SHARED = $(COMMON_CFLAGS_FOR_PARSER) $(OPT_SHARED)
25
+
26
+
27
+ default: $(LIBSTATIC) $(LIBSHARED)
28
+ copy /y ndtypes.h ..\python\ndtypes
29
+ copy /y $(LIBSTATIC) ..\python\ndtypes
30
+ copy /y $(LIBIMPORT) ..\python\ndtypes
31
+ copy /y $(LIBSHARED) ..\python\ndtypes
32
+
33
+
34
+ OBJS = alloc.obj attr.obj context.obj copy.obj equal.obj encodings.obj \
35
+ grammar.obj io.obj lexer.obj match.obj ndtypes.obj parsefuncs.obj \
36
+ parser.obj seq.obj substitute.obj symtable.obj util.obj values.obj
37
+
38
+ SHARED_OBJS = .objs\alloc.obj .objs\attr.obj .objs\context.obj .objs\copy.obj \
39
+ .objs\equal.obj .objs\encodings.obj .objs\grammar.obj .objs\io.obj \
40
+ .objs\lexer.obj .objs\match.obj .objs\ndtypes.obj .objs\parsefuncs.obj \
41
+ .objs\parser.obj .objs\seq.obj .objs\substitute.obj .objs\symtable.obj \
42
+ .objs\util.obj .objs\values.obj
43
+
44
+
45
+ COMPAT_OBJS = compat\bpgrammar.obj compat\bplexer.obj compat\import.obj compat\export.obj
46
+
47
+ COMPAT_SHARED_OBJS = compat\.objs\bpgrammar.obj compat\.objs\bplexer.obj \
48
+ compat\.objs\import.obj compat\.objs\export.obj
49
+
50
+ SERIALIZE_OBJS = serialize\serialize.obj serialize\deserialize.obj
51
+
52
+ SERIALIZE_SHARED_OBJS = serialize\.objs\serialize.obj serialize\.objs\deserialize.obj
53
+
54
+
55
+ $(LIBSTATIC):\
56
+ Makefile $(OBJS) $(COMPAT_OBJS) $(SERIALIZE_OBJS)
57
+ -@if exist $@ del $(LIBSTATIC)
58
+ lib /nologo /out:$(LIBSTATIC) $(OBJS) $(COMPAT_OBJS) $(SERIALIZE_OBJS)
59
+
60
+ $(LIBSHARED):\
61
+ Makefile $(SHARED_OBJS) $(COMPAT_SHARED_OBJS) $(SERIALIZE_SHARED_OBJS)
62
+ -@if exist $@ del $(LIBSHARED)
63
+ link /nologo /DLL /MANIFEST /out:$(LIBSHARED) /implib:$(LIBIMPORT) \
64
+ $(SHARED_OBJS) $(COMPAT_SHARED_OBJS) $(SERIALIZE_SHARED_OBJS)
65
+ mt /nologo -manifest $(LIBSHARED).manifest -outputresource:$(LIBSHARED);2
66
+
67
+ alloc.obj:\
68
+ Makefile alloc.c ndtypes.h
69
+ $(CC) $(CFLAGS) -c alloc.c
70
+
71
+ .objs\alloc.obj:\
72
+ Makefile alloc.c ndtypes.h
73
+ $(CC) $(CFLAGS_SHARED) -c alloc.c
74
+
75
+ attr.obj:\
76
+ Makefile attr.c attr.h ndtypes.h
77
+ $(CC) $(CFLAGS) -c attr.c
78
+
79
+ .objs\attr.obj:\
80
+ Makefile attr.c attr.h ndtypes.h
81
+ $(CC) $(CFLAGS_SHARED) -c attr.c
82
+
83
+ context.obj:\
84
+ Makefile context.c ndtypes.h
85
+ $(CC) $(CFLAGS) -c context.c
86
+
87
+ .objs\context.obj:\
88
+ Makefile context.c ndtypes.h
89
+ $(CC) $(CFLAGS_SHARED) -c context.c
90
+
91
+ copy.obj:\
92
+ Makefile copy.c ndtypes.h
93
+ $(CC) $(CFLAGS) -c copy.c
94
+
95
+ .objs\copy.obj:\
96
+ Makefile copy.c ndtypes.h
97
+ $(CC) $(CFLAGS_SHARED) -c copy.c
98
+
99
+ encodings.obj:\
100
+ Makefile encodings.c ndtypes.h
101
+ $(CC) $(CFLAGS) -c encodings.c
102
+
103
+ .objs\encodings.obj:\
104
+ Makefile encodings.c ndtypes.h
105
+ $(CC) $(CFLAGS_SHARED) -c encodings.c
106
+
107
+ io.obj:\
108
+ Makefile io.c ndtypes.h
109
+ $(CC) $(CFLAGS) -c io.c
110
+
111
+ .objs\io.obj:\
112
+ Makefile io.c ndtypes.h
113
+ $(CC) $(CFLAGS_SHARED) -c io.c
114
+
115
+ equal.obj:\
116
+ Makefile equal.c ndtypes.h
117
+ $(CC) $(CFLAGS) -c equal.c
118
+
119
+ .objs\equal.obj:\
120
+ Makefile equal.c ndtypes.h
121
+ $(CC) $(CFLAGS_SHARED) -c equal.c
122
+
123
+ grammar.obj:\
124
+ Makefile grammar.c grammar.h lexer.h ndtypes.h parsefuncs.h seq.h
125
+ $(CC) $(CFLAGS_FOR_GENERATED) -c grammar.c
126
+
127
+ .objs\grammar.obj:\
128
+ Makefile grammar.c grammar.h lexer.h ndtypes.h parsefuncs.h seq.h
129
+ $(CC) $(CFLAGS_FOR_GENERATED_SHARED) -c grammar.c
130
+
131
+ lexer.obj:\
132
+ Makefile lexer.c grammar.h lexer.h parsefuncs.h
133
+ $(CC) $(CFLAGS_FOR_GENERATED) -c lexer.c
134
+
135
+ .objs\lexer.obj:\
136
+ Makefile lexer.c grammar.h lexer.h parsefuncs.h
137
+ $(CC) $(CFLAGS_FOR_GENERATED_SHARED) -c lexer.c
138
+
139
+ match.obj:\
140
+ Makefile match.c ndtypes.h symtable.h
141
+ $(CC) $(CFLAGS) -c match.c
142
+
143
+ .objs\match.obj:\
144
+ Makefile match.c ndtypes.h symtable.h
145
+ $(CC) $(CFLAGS_SHARED) -c match.c
146
+
147
+ ndtypes.obj:\
148
+ Makefile ndtypes.c ndtypes.h
149
+ $(CC) $(CFLAGS) -c ndtypes.c
150
+
151
+ .objs\ndtypes.obj:\
152
+ Makefile ndtypes.c ndtypes.h
153
+ $(CC) $(CFLAGS_SHARED) -c ndtypes.c
154
+
155
+ parsefuncs.obj:\
156
+ Makefile parsefuncs.c ndtypes.h parsefuncs.h seq.h
157
+ $(CC) $(CFLAGS) -c parsefuncs.c
158
+
159
+ .objs\parsefuncs.obj:\
160
+ Makefile parsefuncs.c ndtypes.h parsefuncs.h seq.h
161
+ $(CC) $(CFLAGS_SHARED) -c parsefuncs.c
162
+
163
+ parser.obj:\
164
+ Makefile parser.c grammar.h lexer.h ndtypes.h seq.h
165
+ $(CC) $(CFLAGS_FOR_PARSER) -c parser.c
166
+
167
+ .objs\parser.obj:\
168
+ Makefile parser.c grammar.h lexer.h ndtypes.h seq.h
169
+ $(CC) $(CFLAGS_FOR_PARSER_SHARED) -c parser.c
170
+
171
+ seq.obj:\
172
+ Makefile seq.c ndtypes.h seq.h
173
+ $(CC) $(CFLAGS) -c seq.c
174
+
175
+ .objs\seq.obj:\
176
+ Makefile seq.c ndtypes.h seq.h
177
+ $(CC) $(CFLAGS_SHARED) -c seq.c
178
+
179
+ substitute.obj:\
180
+ Makefile substitute.c ndtypes.h substitute.h symtable.h
181
+ $(CC) $(CFLAGS) -c substitute.c
182
+
183
+ .objs\substitute.obj:\
184
+ Makefile substitute.c ndtypes.h substitute.h symtable.h
185
+ $(CC) $(CFLAGS_SHARED) -c substitute.c
186
+
187
+ symtable.obj:\
188
+ Makefile symtable.c ndtypes.h symtable.h
189
+ $(CC) $(CFLAGS) -c symtable.c
190
+
191
+ .objs\symtable.obj:\
192
+ Makefile symtable.c ndtypes.h symtable.h
193
+ $(CC) $(CFLAGS_SHARED) -c symtable.c
194
+
195
+ util.obj:\
196
+ Makefile util.c ndtypes.h
197
+ $(CC) $(CFLAGS) -c util.c
198
+
199
+ .objs\util.obj:\
200
+ Makefile util.c ndtypes.h
201
+ $(CC) $(CFLAGS_SHARED) -c util.c
202
+
203
+ values.obj:\
204
+ Makefile values.c ndtypes.h
205
+ $(CC) $(CFLAGS) -c values.c
206
+
207
+ .objs\values.obj:\
208
+ Makefile values.c ndtypes.h
209
+ $(CC) $(CFLAGS_SHARED) -c values.c
210
+
211
+
212
+ # compat directory
213
+ $(COMPAT_OBJS) $(COMPAT_SHARED_OBJS):\
214
+ Makefile compat\Makefile compat\bpgrammar.y compat\bplexer.l compat\import.c \
215
+ ndtypes.h seq.h
216
+ cd compat && nmake
217
+
218
+ # serialize directory
219
+ $(SERIALIZE_OBJS) $(SERIALIZE_SHARED_OBJS):\
220
+ Makefile serialize\Makefile serialize\serialize.c serialize\deserialize.c \
221
+ ndtypes.h
222
+ cd serialize && nmake
223
+
224
+
225
+ check:\
226
+ Makefile default
227
+ cd tests && copy /y Makefile.vc Makefile && nmake /nologo
228
+ .\tests\runtest.exe
229
+ .\tests\runtest_shared.exe
230
+
231
+
232
+ # Benchmark
233
+ bench:\
234
+ Makefile tools\bench.c ndtypes.h $(LIBSTATIC)
235
+ $(CC) $(CFLAGS) /Febench.exe tools\bench.c $(LIBSTATIC)
236
+
237
+
238
+ # Print the AST
239
+ print_ast:\
240
+ Makefile tools\print_ast.c ndtypes.h $(LIBSTATIC)
241
+ $(CC) $(CFLAGS) -o print_ast tools\print_ast.c $(LIBSTATIC)
242
+
243
+
244
+ # Parse a file that contains a datashape type
245
+ indent:\
246
+ Makefile indent.c ndtypes.h $(LIBSTATIC)
247
+ $(CC) $(CFLAGS) /Feindent tools\indent.c $(LIBSTATIC)
248
+
249
+
250
+ FORCE:
251
+
252
+ clean: FORCE
253
+ del /q /f *.exe *.obj *.lib *.dll *.exp *.manifest 2>NUL
254
+ cd .objs && del /q /f *.obj 2>NUL
255
+ if exist "..\build\" rd /q /s "..\build\"
256
+ if exist "..\dist\" rd /q /s "..\dist\"
257
+ if exist "..\MANIFEST" del "..\MANIFEST"
258
+ if exist "..\record.txt" del "..\record.txt"
259
+ cd ..\python\ndtypes && del *.lib *.dll *.pyd ndtypes.h 2>NUL
260
+ cd compat && nmake clean
261
+ cd serialize && nmake clean
262
+
263
+ distclean: clean
264
+ cd compat && nmake distclean
265
+ cd serialize && nmake distclean
266
+ del Makefile 2>NUL
267
+ del ndtypes.h 2>NUL
268
+
269
+