bson 0.1.8 → 0.2.2

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.
Files changed (55) hide show
  1. package/README.md +45 -1
  2. package/browser_build/bson.js +205 -176
  3. package/build/Release/bson.exp +0 -0
  4. package/build/Release/bson.lib +0 -0
  5. package/build/Release/bson.node +0 -0
  6. package/build/Release/bson.pdb +0 -0
  7. package/build/Release/obj/bson/bson.lastbuildstate +2 -0
  8. package/build/Release/obj/bson/bson.node.intermediate.manifest +10 -0
  9. package/build/Release/obj/bson/bson.obj +0 -0
  10. package/build/Release/obj/bson/bson.vcxprojResolveAssemblyReference.cache +0 -0
  11. package/build/Release/obj/bson/bson.write.1.tlog +3 -0
  12. package/build/Release/obj/bson/cl.command.1.tlog +0 -0
  13. package/build/Release/obj/bson/cl.read.1.tlog +0 -0
  14. package/build/Release/obj/bson/cl.write.1.tlog +0 -0
  15. package/build/Release/obj/bson/link.command.1.tlog +0 -0
  16. package/build/Release/obj/bson/link.read.1.tlog +0 -0
  17. package/build/Release/obj/bson/link.write.1.tlog +0 -0
  18. package/build/Release/obj/bson/mt.command.1.tlog +0 -0
  19. package/build/Release/obj/bson/mt.read.1.tlog +0 -0
  20. package/build/Release/obj/bson/mt.write.1.tlog +0 -0
  21. package/build/Release/obj/bson/vcwindows7.1sdk.pdb +0 -0
  22. package/build/binding.sln +21 -0
  23. package/build/bson.vcxproj +127 -0
  24. package/build/bson.vcxproj.filters +19 -0
  25. package/build/config.gypi +17 -8
  26. package/ext/bson.cc +68 -29
  27. package/ext/bson.h +9 -5
  28. package/ext/win32/ia32/bson.node +0 -0
  29. package/ext/win32/x64/bson.node +0 -0
  30. package/lib/bson/bson.js +192 -172
  31. package/lib/bson/objectid.js +4 -4
  32. package/package.json +2 -2
  33. package/benchmarks/benchmarks.js +0 -130
  34. package/build/Makefile +0 -355
  35. package/build/Release/.deps/Release/bson.node.d +0 -1
  36. package/build/Release/.deps/Release/obj.target/bson/ext/bson.o.d +0 -34
  37. package/build/Release/linker.lock +0 -0
  38. package/build/Release/obj.target/bson/ext/bson.o +0 -0
  39. package/build/binding.Makefile +0 -6
  40. package/build/bson.target.mk +0 -154
  41. package/build/gyp-mac-tool +0 -211
  42. package/test/browser/browser_example.htm +0 -19
  43. package/test/browser/bson_test.js +0 -260
  44. package/test/browser/nodeunit.js +0 -2034
  45. package/test/browser/suite2.js +0 -13
  46. package/test/browser/suite3.js +0 -7
  47. package/test/browser/test.html +0 -30
  48. package/test/node/bson_array_test.js +0 -240
  49. package/test/node/bson_parser_comparision_test.js +0 -493
  50. package/test/node/bson_test.js +0 -1694
  51. package/test/node/bson_typed_array_test.js +0 -392
  52. package/test/node/data/test_gs_weird_bug.png +0 -0
  53. package/test/node/test_full_bson.js +0 -315
  54. package/test/node/to_bson_test.js +0 -109
  55. package/test/node/tools/utils.js +0 -80
@@ -41,7 +41,7 @@ var ObjectID = function ObjectID(id, _hex) {
41
41
  this.id = id;
42
42
  } else if(checkForHexRegExp.test(id)) {
43
43
  return ObjectID.createFromHexString(id);
44
- } else if(!checkForHexRegExp.test(id)) {
44
+ } else {
45
45
  throw new Error("Value passed in is not a valid 24 character hex string");
46
46
  }
47
47
 
@@ -165,9 +165,9 @@ ObjectID.prototype.equals = function equals (otherID) {
165
165
  }
166
166
 
167
167
  /**
168
- * Returns the generation time in seconds that this ID was generated.
168
+ * Returns the generation date (accurate up to the second) that this ID was generated.
169
169
  *
170
- * @return {Number} return number of seconds in the timestamp part of the 12 byte id.
170
+ * @return {Date} the generation date
171
171
  * @api public
172
172
  */
173
173
  ObjectID.prototype.getTimestamp = function() {
@@ -250,4 +250,4 @@ Object.defineProperty(ObjectID.prototype, "generationTime", {
250
250
  * Expose.
251
251
  */
252
252
  exports.ObjectID = ObjectID;
253
- exports.ObjectId = ObjectID;
253
+ exports.ObjectId = ObjectID;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  { "name" : "bson"
2
2
  , "description" : "A bson parser for node.js and the browser"
3
3
  , "keywords" : ["mongodb", "bson", "parser"]
4
- , "version" : "0.1.8"
4
+ , "version" : "0.2.2"
5
5
  , "author" : "Christian Amor Kvalheim <christkv@gmail.com>"
6
6
  , "contributors" : []
7
7
 
@@ -12,7 +12,7 @@
12
12
  , "devDependencies": {
13
13
  "nodeunit": "0.7.3"
14
14
  , "gleak": "0.2.3"
15
- , "one": "latest"
15
+ , "one": "2.X.X"
16
16
  }
17
17
  , "config": { "native" : false }
18
18
  , "main": "./lib/bson/index"
@@ -1,130 +0,0 @@
1
- // var BSON = require('../../lib/mongodb').BSONNative.BSON,
2
- // ObjectID = require('../../lib/mongodb').BSONNative.ObjectID,
3
- // Code = require('../../lib/mongodb').BSONNative.Code,
4
- // Long = require('../../lib/mongodb').BSONNative.Long,
5
- // Binary = require('../../lib/mongodb').BSONNative.Binary,
6
- // debug = require('util').debug,
7
- // inspect = require('util').inspect,
8
- //
9
- // Long = require('../../lib/mongodb').Long,
10
- // ObjectID = require('../../lib/mongodb').ObjectID,
11
- // Binary = require('../../lib/mongodb').Binary,
12
- // Code = require('../../lib/mongodb').Code,
13
- // DBRef = require('../../lib/mongodb').DBRef,
14
- // Symbol = require('../../lib/mongodb').Symbol,
15
- // Double = require('../../lib/mongodb').Double,
16
- // MaxKey = require('../../lib/mongodb').MaxKey,
17
- // MinKey = require('../../lib/mongodb').MinKey,
18
- // Timestamp = require('../../lib/mongodb').Timestamp;
19
-
20
-
21
- // var BSON = require('../../lib/mongodb').BSONPure.BSON,
22
- // ObjectID = require('../../lib/mongodb').BSONPure.ObjectID,
23
- // Code = require('../../lib/mongodb').BSONPure.Code,
24
- // Long = require('../../lib/mongodb').BSONPure.Long,
25
- // Binary = require('../../lib/mongodb').BSONPure.Binary;
26
-
27
- var BSON = require('../lib/bson').BSONNative.BSON,
28
- Long = require('../lib/bson').Long,
29
- ObjectID = require('../lib/bson').ObjectID,
30
- Binary = require('../lib/bson').Binary,
31
- Code = require('../lib/bson').Code,
32
- DBRef = require('../lib/bson').DBRef,
33
- Symbol = require('../lib/bson').Symbol,
34
- Double = require('../lib/bson').Double,
35
- MaxKey = require('../lib/bson').MaxKey,
36
- MinKey = require('../lib/bson').MinKey,
37
- Timestamp = require('../lib/bson').Timestamp;
38
-
39
- // console.dir(require('../lib/bson'))
40
-
41
- var COUNT = 1000;
42
- var COUNT = 100;
43
-
44
- var object = {
45
- string: "Strings are great",
46
- decimal: 3.14159265,
47
- bool: true,
48
- integer: 5,
49
- date: new Date(),
50
- double: new Double(1.4),
51
- id: new ObjectID(),
52
- min: new MinKey(),
53
- max: new MaxKey(),
54
- symbol: new Symbol('hello'),
55
- long: Long.fromNumber(100),
56
- bin: new Binary(new Buffer(100)),
57
-
58
- subObject: {
59
- moreText: "Bacon ipsum dolor sit amet cow pork belly rump ribeye pastrami andouille. Tail hamburger pork belly, drumstick flank salami t-bone sirloin pork chop ribeye ham chuck pork loin shankle. Ham fatback pork swine, sirloin shankle short loin andouille shank sausage meatloaf drumstick. Pig chicken cow bresaola, pork loin jerky meatball tenderloin brisket strip steak jowl spare ribs. Biltong sirloin pork belly boudin, bacon pastrami rump chicken. Jowl rump fatback, biltong bacon t-bone turkey. Turkey pork loin boudin, tenderloin jerky beef ribs pastrami spare ribs biltong pork chop beef.",
60
- longKeylongKeylongKeylongKeylongKeylongKey: "Pork belly boudin shoulder ribeye pork chop brisket biltong short ribs. Salami beef pork belly, t-bone sirloin meatloaf tail jowl spare ribs. Sirloin biltong bresaola cow turkey. Biltong fatback meatball, bresaola tail shankle turkey pancetta ham ribeye flank bacon jerky pork chop. Boudin sirloin shoulder, salami swine flank jerky t-bone pork chop pork beef tongue. Bresaola ribeye jerky andouille. Ribeye ground round sausage biltong beef ribs chuck, shank hamburger chicken short ribs spare ribs tenderloin meatloaf pork loin."
61
- },
62
-
63
- subArray: [1,2,3,4,5,6,7,8,9,10],
64
- anotherString: "another string",
65
- code: new Code("function() {}", {i:1})
66
- }
67
-
68
- // Number of objects
69
- var numberOfObjects = 10000;
70
- var bson = new BSON([Long, ObjectID, Binary, Code, DBRef, Symbol, Double, Timestamp, MaxKey, MinKey]);
71
- console.log("---------------------- 1")
72
- var s = new Date()
73
- // Object serialized
74
- for(var i = 0; i < numberOfObjects; i++) {
75
- objectBSON = bson.serialize(object, null, true)
76
- }
77
- console.log("====================== " + (new Date().getTime() - s.getTime()) + " :: " + ((new Date().getTime() - s.getTime()))/numberOfObjects)
78
-
79
- console.log("---------------------- 2")
80
- var s = new Date()
81
- // Object serialized
82
- for(var i = 0; i < numberOfObjects; i++) {
83
- bson.deserialize(objectBSON);
84
- }
85
- console.log("====================== " + (new Date().getTime() - s.getTime()) + " :: " + ((new Date().getTime() - s.getTime()))/numberOfObjects)
86
-
87
- // // Buffer With copies of the objectBSON
88
- // var data = new Buffer(objectBSON.length * numberOfObjects);
89
- // var index = 0;
90
- //
91
- // // Copy the buffer 1000 times to create a strea m of objects
92
- // for(var i = 0; i < numberOfObjects; i++) {
93
- // // Copy data
94
- // objectBSON.copy(data, index);
95
- // // Adjust index
96
- // index = index + objectBSON.length;
97
- // }
98
- //
99
- // // console.log("-----------------------------------------------------------------------------------")
100
- // // console.dir(objectBSON)
101
- //
102
- // var x, start, end, j
103
- // var objectBSON, objectJSON
104
- //
105
- // // Allocate the return array (avoid concatinating everything)
106
- // var results = new Array(numberOfObjects);
107
- //
108
- // console.log(COUNT + "x (objectBSON = BSON.serialize(object))")
109
- // start = new Date
110
- //
111
- // // var objects = BSON.deserializeStream(data, 0, numberOfObjects);
112
- // // console.log("----------------------------------------------------------------------------------- 0")
113
- // // var objects = BSON.deserialize(data);
114
- // // console.log("----------------------------------------------------------------------------------- 1")
115
- // // console.dir(objects)
116
- //
117
- // for (j=COUNT; --j>=0; ) {
118
- // var nextIndex = BSON.deserializeStream(data, 0, numberOfObjects, results, 0);
119
- // }
120
- //
121
- // end = new Date
122
- // var opsprsecond = COUNT / ((end - start)/1000);
123
- // console.log("bson size (bytes): ", objectBSON.length);
124
- // console.log("time = ", end - start, "ms -", COUNT / ((end - start)/1000), " ops/sec");
125
- // console.log("MB/s = " + ((opsprsecond*objectBSON.length)/1024));
126
- //
127
- // // console.dir(nextIndex)
128
- // // console.dir(results)
129
-
130
-
package/build/Makefile DELETED
@@ -1,355 +0,0 @@
1
- # We borrow heavily from the kernel build setup, though we are simpler since
2
- # we don't have Kconfig tweaking settings on us.
3
-
4
- # The implicit make rules have it looking for RCS files, among other things.
5
- # We instead explicitly write all the rules we care about.
6
- # It's even quicker (saves ~200ms) to pass -r on the command line.
7
- MAKEFLAGS=-r
8
-
9
- # The source directory tree.
10
- srcdir := ..
11
- abs_srcdir := $(abspath $(srcdir))
12
-
13
- # The name of the builddir.
14
- builddir_name ?= .
15
-
16
- # The V=1 flag on command line makes us verbosely print command lines.
17
- ifdef V
18
- quiet=
19
- else
20
- quiet=quiet_
21
- endif
22
-
23
- # Specify BUILDTYPE=Release on the command line for a release build.
24
- BUILDTYPE ?= Release
25
-
26
- # Directory all our build output goes into.
27
- # Note that this must be two directories beneath src/ for unit tests to pass,
28
- # as they reach into the src/ directory for data with relative paths.
29
- builddir ?= $(builddir_name)/$(BUILDTYPE)
30
- abs_builddir := $(abspath $(builddir))
31
- depsdir := $(builddir)/.deps
32
-
33
- # Object output directory.
34
- obj := $(builddir)/obj
35
- abs_obj := $(abspath $(obj))
36
-
37
- # We build up a list of every single one of the targets so we can slurp in the
38
- # generated dependency rule Makefiles in one pass.
39
- all_deps :=
40
-
41
-
42
-
43
- # C++ apps need to be linked with g++.
44
- #
45
- # Note: flock is used to seralize linking. Linking is a memory-intensive
46
- # process so running parallel links can often lead to thrashing. To disable
47
- # the serialization, override LINK via an envrionment variable as follows:
48
- #
49
- # export LINK=g++
50
- #
51
- # This will allow make to invoke N linker processes as specified in -jN.
52
- LINK ?= ./gyp-mac-tool flock $(builddir)/linker.lock $(CXX)
53
-
54
- CC.target ?= $(CC)
55
- CFLAGS.target ?= $(CFLAGS)
56
- CXX.target ?= $(CXX)
57
- CXXFLAGS.target ?= $(CXXFLAGS)
58
- LINK.target ?= $(LINK)
59
- LDFLAGS.target ?= $(LDFLAGS)
60
- AR.target ?= $(AR)
61
-
62
- # TODO(evan): move all cross-compilation logic to gyp-time so we don't need
63
- # to replicate this environment fallback in make as well.
64
- CC.host ?= gcc
65
- CFLAGS.host ?=
66
- CXX.host ?= g++
67
- CXXFLAGS.host ?=
68
- LINK.host ?= g++
69
- LDFLAGS.host ?=
70
- AR.host ?= ar
71
-
72
- # Define a dir function that can handle spaces.
73
- # http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions
74
- # "leading spaces cannot appear in the text of the first argument as written.
75
- # These characters can be put into the argument value by variable substitution."
76
- empty :=
77
- space := $(empty) $(empty)
78
-
79
- # http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces
80
- replace_spaces = $(subst $(space),?,$1)
81
- unreplace_spaces = $(subst ?,$(space),$1)
82
- dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1)))
83
-
84
- # Flags to make gcc output dependency info. Note that you need to be
85
- # careful here to use the flags that ccache and distcc can understand.
86
- # We write to a dep file on the side first and then rename at the end
87
- # so we can't end up with a broken dep file.
88
- depfile = $(depsdir)/$(call replace_spaces,$@).d
89
- DEPFLAGS = -MMD -MF $(depfile).raw
90
-
91
- # We have to fixup the deps output in a few ways.
92
- # (1) the file output should mention the proper .o file.
93
- # ccache or distcc lose the path to the target, so we convert a rule of
94
- # the form:
95
- # foobar.o: DEP1 DEP2
96
- # into
97
- # path/to/foobar.o: DEP1 DEP2
98
- # (2) we want missing files not to cause us to fail to build.
99
- # We want to rewrite
100
- # foobar.o: DEP1 DEP2 \
101
- # DEP3
102
- # to
103
- # DEP1:
104
- # DEP2:
105
- # DEP3:
106
- # so if the files are missing, they're just considered phony rules.
107
- # We have to do some pretty insane escaping to get those backslashes
108
- # and dollar signs past make, the shell, and sed at the same time.
109
- # Doesn't work with spaces, but that's fine: .d files have spaces in
110
- # their names replaced with other characters.
111
- define fixup_dep
112
- # The depfile may not exist if the input file didn't have any #includes.
113
- touch $(depfile).raw
114
- # Fixup path as in (1).
115
- sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile)
116
- # Add extra rules as in (2).
117
- # We remove slashes and replace spaces with new lines;
118
- # remove blank lines;
119
- # delete the first line and append a colon to the remaining lines.
120
- sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\
121
- grep -v '^$$' |\
122
- sed -e 1d -e 's|$$|:|' \
123
- >> $(depfile)
124
- rm $(depfile).raw
125
- endef
126
-
127
- # Command definitions:
128
- # - cmd_foo is the actual command to run;
129
- # - quiet_cmd_foo is the brief-output summary of the command.
130
-
131
- quiet_cmd_cc = CC($(TOOLSET)) $@
132
- cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $<
133
-
134
- quiet_cmd_cxx = CXX($(TOOLSET)) $@
135
- cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<
136
-
137
- quiet_cmd_objc = CXX($(TOOLSET)) $@
138
- cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<
139
-
140
- quiet_cmd_objcxx = CXX($(TOOLSET)) $@
141
- cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<
142
-
143
- # Commands for precompiled header files.
144
- quiet_cmd_pch_c = CXX($(TOOLSET)) $@
145
- cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<
146
- quiet_cmd_pch_cc = CXX($(TOOLSET)) $@
147
- cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<
148
- quiet_cmd_pch_m = CXX($(TOOLSET)) $@
149
- cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<
150
- quiet_cmd_pch_mm = CXX($(TOOLSET)) $@
151
- cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<
152
-
153
- # gyp-mac-tool is written next to the root Makefile by gyp.
154
- # Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd
155
- # already.
156
- quiet_cmd_mac_tool = MACTOOL $(4) $<
157
- cmd_mac_tool = ./gyp-mac-tool $(4) $< "$@"
158
-
159
- quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@
160
- cmd_mac_package_framework = ./gyp-mac-tool package-framework "$@" $(4)
161
-
162
- quiet_cmd_infoplist = INFOPLIST $@
163
- cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@"
164
-
165
- quiet_cmd_touch = TOUCH $@
166
- cmd_touch = touch $@
167
-
168
- quiet_cmd_copy = COPY $@
169
- # send stderr to /dev/null to ignore messages when linking directories.
170
- cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp -af "$<" "$@")
171
-
172
- quiet_cmd_alink = LIBTOOL-STATIC $@
173
- cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)
174
-
175
- quiet_cmd_link = LINK($(TOOLSET)) $@
176
- cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)
177
-
178
- # TODO(thakis): Find out and document the difference between shared_library and
179
- # loadable_module on mac.
180
- quiet_cmd_solink = SOLINK($(TOOLSET)) $@
181
- cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)
182
-
183
- # TODO(thakis): The solink_module rule is likely wrong. Xcode seems to pass
184
- # -bundle -single_module here (for osmesa.so).
185
- quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
186
- cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
187
-
188
-
189
- # Define an escape_quotes function to escape single quotes.
190
- # This allows us to handle quotes properly as long as we always use
191
- # use single quotes and escape_quotes.
192
- escape_quotes = $(subst ','\'',$(1))
193
- # This comment is here just to include a ' to unconfuse syntax highlighting.
194
- # Define an escape_vars function to escape '$' variable syntax.
195
- # This allows us to read/write command lines with shell variables (e.g.
196
- # $LD_LIBRARY_PATH), without triggering make substitution.
197
- escape_vars = $(subst $$,$$$$,$(1))
198
- # Helper that expands to a shell command to echo a string exactly as it is in
199
- # make. This uses printf instead of echo because printf's behaviour with respect
200
- # to escape sequences is more portable than echo's across different shells
201
- # (e.g., dash, bash).
202
- exact_echo = printf '%s\n' '$(call escape_quotes,$(1))'
203
-
204
- # Helper to compare the command we're about to run against the command
205
- # we logged the last time we ran the command. Produces an empty
206
- # string (false) when the commands match.
207
- # Tricky point: Make has no string-equality test function.
208
- # The kernel uses the following, but it seems like it would have false
209
- # positives, where one string reordered its arguments.
210
- # arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \
211
- # $(filter-out $(cmd_$@), $(cmd_$(1))))
212
- # We instead substitute each for the empty string into the other, and
213
- # say they're equal if both substitutions produce the empty string.
214
- # .d files contain ? instead of spaces, take that into account.
215
- command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\
216
- $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1))))
217
-
218
- # Helper that is non-empty when a prerequisite changes.
219
- # Normally make does this implicitly, but we force rules to always run
220
- # so we can check their command lines.
221
- # $? -- new prerequisites
222
- # $| -- order-only dependencies
223
- prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?))
224
-
225
- # Helper that executes all postbuilds, and deletes the output file when done
226
- # if any of the postbuilds failed.
227
- define do_postbuilds
228
- @E=0;\
229
- for p in $(POSTBUILDS); do\
230
- eval $$p;\
231
- F=$$?;\
232
- if [ $$F -ne 0 ]; then\
233
- E=$$F;\
234
- fi;\
235
- done;\
236
- if [ $$E -ne 0 ]; then\
237
- rm -rf "$@";\
238
- exit $$E;\
239
- fi
240
- endef
241
-
242
- # do_cmd: run a command via the above cmd_foo names, if necessary.
243
- # Should always run for a given target to handle command-line changes.
244
- # Second argument, if non-zero, makes it do asm/C/C++ dependency munging.
245
- # Third argument, if non-zero, makes it do POSTBUILDS processing.
246
- # Note: We intentionally do NOT call dirx for depfile, since it contains ? for
247
- # spaces already and dirx strips the ? characters.
248
- define do_cmd
249
- $(if $(or $(command_changed),$(prereq_changed)),
250
- @$(call exact_echo, $($(quiet)cmd_$(1)))
251
- @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))"
252
- $(if $(findstring flock,$(word 2,$(cmd_$1))),
253
- @$(cmd_$(1))
254
- @echo " $(quiet_cmd_$(1)): Finished",
255
- @$(cmd_$(1))
256
- )
257
- @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile)
258
- @$(if $(2),$(fixup_dep))
259
- $(if $(and $(3), $(POSTBUILDS)),
260
- $(call do_postbuilds)
261
- )
262
- )
263
- endef
264
-
265
- # Declare the "all" target first so it is the default,
266
- # even though we don't have the deps yet.
267
- .PHONY: all
268
- all:
269
-
270
- # make looks for ways to re-generate included makefiles, but in our case, we
271
- # don't have a direct way. Explicitly telling make that it has nothing to do
272
- # for them makes it go faster.
273
- %.d: ;
274
-
275
- # Use FORCE_DO_CMD to force a target to run. Should be coupled with
276
- # do_cmd.
277
- .PHONY: FORCE_DO_CMD
278
- FORCE_DO_CMD:
279
-
280
- TOOLSET := target
281
- # Suffix rules, putting all outputs into $(obj).
282
- $(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD
283
- @$(call do_cmd,cc,1)
284
- $(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
285
- @$(call do_cmd,cxx,1)
286
- $(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD
287
- @$(call do_cmd,cxx,1)
288
- $(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD
289
- @$(call do_cmd,cxx,1)
290
- $(obj).$(TOOLSET)/%.o: $(srcdir)/%.m FORCE_DO_CMD
291
- @$(call do_cmd,objc,1)
292
- $(obj).$(TOOLSET)/%.o: $(srcdir)/%.mm FORCE_DO_CMD
293
- @$(call do_cmd,objcxx,1)
294
- $(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD
295
- @$(call do_cmd,cc,1)
296
- $(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD
297
- @$(call do_cmd,cc,1)
298
-
299
- # Try building from generated source, too.
300
- $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD
301
- @$(call do_cmd,cc,1)
302
- $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
303
- @$(call do_cmd,cxx,1)
304
- $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD
305
- @$(call do_cmd,cxx,1)
306
- $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD
307
- @$(call do_cmd,cxx,1)
308
- $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.m FORCE_DO_CMD
309
- @$(call do_cmd,objc,1)
310
- $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.mm FORCE_DO_CMD
311
- @$(call do_cmd,objcxx,1)
312
- $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD
313
- @$(call do_cmd,cc,1)
314
- $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD
315
- @$(call do_cmd,cc,1)
316
-
317
- $(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD
318
- @$(call do_cmd,cc,1)
319
- $(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD
320
- @$(call do_cmd,cxx,1)
321
- $(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD
322
- @$(call do_cmd,cxx,1)
323
- $(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD
324
- @$(call do_cmd,cxx,1)
325
- $(obj).$(TOOLSET)/%.o: $(obj)/%.m FORCE_DO_CMD
326
- @$(call do_cmd,objc,1)
327
- $(obj).$(TOOLSET)/%.o: $(obj)/%.mm FORCE_DO_CMD
328
- @$(call do_cmd,objcxx,1)
329
- $(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD
330
- @$(call do_cmd,cc,1)
331
- $(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD
332
- @$(call do_cmd,cc,1)
333
-
334
-
335
- ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
336
- $(findstring $(join ^,$(prefix)),\
337
- $(join ^,bson.target.mk)))),)
338
- include bson.target.mk
339
- endif
340
-
341
- quiet_cmd_regen_makefile = ACTION Regenerating $@
342
- cmd_regen_makefile = /usr/local/lib/node_modules/node-gyp/gyp/gyp -fmake --ignore-environment "--toplevel-dir=." -I/Users/ck/coding/projects/js-bson/build/config.gypi -I/usr/local/lib/node_modules/node-gyp/addon.gypi -I/Users/ck/.node-gyp/0.8.19/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/ck/.node-gyp/0.8.19" "-Dmodule_root_dir=/Users/ck/coding/projects/js-bson" binding.gyp
343
- Makefile: $(srcdir)/../../../.node-gyp/0.8.19/common.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../usr/local/lib/node_modules/node-gyp/addon.gypi
344
- $(call do_cmd,regen_makefile)
345
-
346
- # "all" is a concatenation of the "all" targets from all the included
347
- # sub-makefiles. This is just here to clarify.
348
- all:
349
-
350
- # Add in dependency-tracking rules. $(all_deps) is the list of every single
351
- # target in our tree. Only consider the ones with .d (dependency) info:
352
- d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d))
353
- ifneq ($(d_files),)
354
- include $(d_files)
355
- endif
@@ -1 +0,0 @@
1
- cmd_Release/bson.node := ./gyp-mac-tool flock ./Release/linker.lock c++ -shared -Wl,-search_paths_first -mmacosx-version-min=10.5 -arch x86_64 -L./Release -install_name @rpath/bson.node -o Release/bson.node Release/obj.target/bson/ext/bson.o -undefined dynamic_lookup
@@ -1,34 +0,0 @@
1
- cmd_Release/obj.target/bson/ext/bson.o := c++ '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/ck/.node-gyp/0.8.19/src -I/Users/ck/.node-gyp/0.8.19/deps/uv/include -I/Users/ck/.node-gyp/0.8.19/deps/v8/include -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-rtti -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/bson/ext/bson.o.d.raw -c -o Release/obj.target/bson/ext/bson.o ../ext/bson.cc
2
- Release/obj.target/bson/ext/bson.o: ../ext/bson.cc \
3
- /Users/ck/.node-gyp/0.8.19/deps/v8/include/v8.h \
4
- /Users/ck/.node-gyp/0.8.19/deps/v8/include/v8stdint.h \
5
- /Users/ck/.node-gyp/0.8.19/src/node.h \
6
- /Users/ck/.node-gyp/0.8.19/deps/uv/include/uv.h \
7
- /Users/ck/.node-gyp/0.8.19/deps/uv/include/ares.h \
8
- /Users/ck/.node-gyp/0.8.19/deps/uv/include/ares_version.h \
9
- /Users/ck/.node-gyp/0.8.19/deps/uv/include/uv-private/uv-unix.h \
10
- /Users/ck/.node-gyp/0.8.19/deps/uv/include/uv-private/ngx-queue.h \
11
- /Users/ck/.node-gyp/0.8.19/deps/uv/include/uv-private/ev.h \
12
- /Users/ck/.node-gyp/0.8.19/deps/uv/include/uv-private/eio.h \
13
- /Users/ck/.node-gyp/0.8.19/src/node_object_wrap.h \
14
- /Users/ck/.node-gyp/0.8.19/src/ev-emul.h \
15
- /Users/ck/.node-gyp/0.8.19/src/eio-emul.h \
16
- /Users/ck/.node-gyp/0.8.19/src/node_version.h \
17
- /Users/ck/.node-gyp/0.8.19/src/node_buffer.h ../ext/bson.h
18
- ../ext/bson.cc:
19
- /Users/ck/.node-gyp/0.8.19/deps/v8/include/v8.h:
20
- /Users/ck/.node-gyp/0.8.19/deps/v8/include/v8stdint.h:
21
- /Users/ck/.node-gyp/0.8.19/src/node.h:
22
- /Users/ck/.node-gyp/0.8.19/deps/uv/include/uv.h:
23
- /Users/ck/.node-gyp/0.8.19/deps/uv/include/ares.h:
24
- /Users/ck/.node-gyp/0.8.19/deps/uv/include/ares_version.h:
25
- /Users/ck/.node-gyp/0.8.19/deps/uv/include/uv-private/uv-unix.h:
26
- /Users/ck/.node-gyp/0.8.19/deps/uv/include/uv-private/ngx-queue.h:
27
- /Users/ck/.node-gyp/0.8.19/deps/uv/include/uv-private/ev.h:
28
- /Users/ck/.node-gyp/0.8.19/deps/uv/include/uv-private/eio.h:
29
- /Users/ck/.node-gyp/0.8.19/src/node_object_wrap.h:
30
- /Users/ck/.node-gyp/0.8.19/src/ev-emul.h:
31
- /Users/ck/.node-gyp/0.8.19/src/eio-emul.h:
32
- /Users/ck/.node-gyp/0.8.19/src/node_version.h:
33
- /Users/ck/.node-gyp/0.8.19/src/node_buffer.h:
34
- ../ext/bson.h:
File without changes
@@ -1,6 +0,0 @@
1
- # This file is generated by gyp; do not edit.
2
-
3
- export builddir_name ?= build/./.
4
- .PHONY: all
5
- all:
6
- $(MAKE) bson