wire-vpn 1.0.0 → 1.0.1

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.
@@ -0,0 +1,354 @@
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
+ CC.target ?= $(CC)
44
+ CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS)
45
+ CXX.target ?= $(CXX)
46
+ CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS)
47
+ LINK.target ?= $(LINK)
48
+ LDFLAGS.target ?= $(LDFLAGS)
49
+ AR.target ?= $(AR)
50
+ PLI.target ?= pli
51
+
52
+ # C++ apps need to be linked with g++.
53
+ LINK ?= $(CXX.target)
54
+
55
+ # TODO(evan): move all cross-compilation logic to gyp-time so we don't need
56
+ # to replicate this environment fallback in make as well.
57
+ CC.host ?= gcc
58
+ CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host)
59
+ CXX.host ?= g++
60
+ CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host)
61
+ LINK.host ?= $(CXX.host)
62
+ LDFLAGS.host ?= $(LDFLAGS_host)
63
+ AR.host ?= ar
64
+ PLI.host ?= pli
65
+
66
+ # Define a dir function that can handle spaces.
67
+ # http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions
68
+ # "leading spaces cannot appear in the text of the first argument as written.
69
+ # These characters can be put into the argument value by variable substitution."
70
+ empty :=
71
+ space := $(empty) $(empty)
72
+
73
+ # http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces
74
+ replace_spaces = $(subst $(space),?,$1)
75
+ unreplace_spaces = $(subst ?,$(space),$1)
76
+ dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1)))
77
+
78
+ # Flags to make gcc output dependency info. Note that you need to be
79
+ # careful here to use the flags that ccache and distcc can understand.
80
+ # We write to a dep file on the side first and then rename at the end
81
+ # so we can't end up with a broken dep file.
82
+ depfile = $(depsdir)/$(call replace_spaces,$@).d
83
+ DEPFLAGS = -MMD -MF $(depfile).raw
84
+
85
+ # We have to fixup the deps output in a few ways.
86
+ # (1) the file output should mention the proper .o file.
87
+ # ccache or distcc lose the path to the target, so we convert a rule of
88
+ # the form:
89
+ # foobar.o: DEP1 DEP2
90
+ # into
91
+ # path/to/foobar.o: DEP1 DEP2
92
+ # (2) we want missing files not to cause us to fail to build.
93
+ # We want to rewrite
94
+ # foobar.o: DEP1 DEP2 \
95
+ # DEP3
96
+ # to
97
+ # DEP1:
98
+ # DEP2:
99
+ # DEP3:
100
+ # so if the files are missing, they're just considered phony rules.
101
+ # We have to do some pretty insane escaping to get those backslashes
102
+ # and dollar signs past make, the shell, and sed at the same time.
103
+ # Doesn't work with spaces, but that's fine: .d files have spaces in
104
+ # their names replaced with other characters.
105
+ define fixup_dep
106
+ # The depfile may not exist if the input file didn't have any #includes.
107
+ touch $(depfile).raw
108
+ # Fixup path as in (1).
109
+ sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile)
110
+ # Add extra rules as in (2).
111
+ # We remove slashes and replace spaces with new lines;
112
+ # remove blank lines;
113
+ # delete the first line and append a colon to the remaining lines.
114
+ sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\
115
+ grep -v '^$$' |\
116
+ sed -e 1d -e 's|$$|:|' \
117
+ >> $(depfile)
118
+ rm $(depfile).raw
119
+ endef
120
+
121
+ # Command definitions:
122
+ # - cmd_foo is the actual command to run;
123
+ # - quiet_cmd_foo is the brief-output summary of the command.
124
+
125
+ quiet_cmd_cc = CC($(TOOLSET)) $@
126
+ cmd_cc = $(CC.$(TOOLSET)) -o $@ $< $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c
127
+
128
+ quiet_cmd_cxx = CXX($(TOOLSET)) $@
129
+ cmd_cxx = $(CXX.$(TOOLSET)) -o $@ $< $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c
130
+
131
+ quiet_cmd_touch = TOUCH $@
132
+ cmd_touch = touch $@
133
+
134
+ quiet_cmd_copy = COPY $@
135
+ # send stderr to /dev/null to ignore messages when linking directories.
136
+ cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp -af "$<" "$@")
137
+
138
+ quiet_cmd_symlink = SYMLINK $@
139
+ cmd_symlink = ln -sf "$<" "$@"
140
+
141
+ quiet_cmd_alink = AR($(TOOLSET)) $@
142
+ cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
143
+
144
+ quiet_cmd_alink_thin = AR($(TOOLSET)) $@
145
+ cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
146
+
147
+ # Due to circular dependencies between libraries :(, we wrap the
148
+ # special "figure out circular dependencies" flags around the entire
149
+ # input list during linking.
150
+ quiet_cmd_link = LINK($(TOOLSET)) $@
151
+ cmd_link = $(LINK.$(TOOLSET)) -o $@ $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group
152
+
153
+ # Note: this does not handle spaces in paths
154
+ define xargs
155
+ $(1) $(word 1,$(2))
156
+ $(if $(word 2,$(2)),$(call xargs,$(1),$(wordlist 2,$(words $(2)),$(2))))
157
+ endef
158
+
159
+ define write-to-file
160
+ @: >$(1)
161
+ $(call xargs,@printf "%s\n" >>$(1),$(2))
162
+ endef
163
+
164
+ OBJ_FILE_LIST := ar-file-list
165
+
166
+ define create_archive
167
+ rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)`
168
+ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2)))
169
+ $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST)
170
+ endef
171
+
172
+ define create_thin_archive
173
+ rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)`
174
+ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2)))
175
+ $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST)
176
+ endef
177
+
178
+ # We support two kinds of shared objects (.so):
179
+ # 1) shared_library, which is just bundling together many dependent libraries
180
+ # into a link line.
181
+ # 2) loadable_module, which is generating a module intended for dlopen().
182
+ #
183
+ # They differ only slightly:
184
+ # In the former case, we want to package all dependent code into the .so.
185
+ # In the latter case, we want to package just the API exposed by the
186
+ # outermost module.
187
+ # This means shared_library uses --whole-archive, while loadable_module doesn't.
188
+ # (Note that --whole-archive is incompatible with the --start-group used in
189
+ # normal linking.)
190
+
191
+ # Other shared-object link notes:
192
+ # - Set SONAME to the library filename so our binaries don't reference
193
+ # the local, absolute paths used on the link command-line.
194
+ quiet_cmd_solink = SOLINK($(TOOLSET)) $@
195
+ cmd_solink = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)
196
+
197
+ quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
198
+ cmd_solink_module = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)
199
+
200
+
201
+ # Define an escape_quotes function to escape single quotes.
202
+ # This allows us to handle quotes properly as long as we always use
203
+ # use single quotes and escape_quotes.
204
+ escape_quotes = $(subst ','\'',$(1))
205
+ # This comment is here just to include a ' to unconfuse syntax highlighting.
206
+ # Define an escape_vars function to escape '$' variable syntax.
207
+ # This allows us to read/write command lines with shell variables (e.g.
208
+ # $LD_LIBRARY_PATH), without triggering make substitution.
209
+ escape_vars = $(subst $$,$$$$,$(1))
210
+ # Helper that expands to a shell command to echo a string exactly as it is in
211
+ # make. This uses printf instead of echo because printf's behaviour with respect
212
+ # to escape sequences is more portable than echo's across different shells
213
+ # (e.g., dash, bash).
214
+ exact_echo = printf '%s\n' '$(call escape_quotes,$(1))'
215
+
216
+ # Helper to compare the command we're about to run against the command
217
+ # we logged the last time we ran the command. Produces an empty
218
+ # string (false) when the commands match.
219
+ # Tricky point: Make has no string-equality test function.
220
+ # The kernel uses the following, but it seems like it would have false
221
+ # positives, where one string reordered its arguments.
222
+ # arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \
223
+ # $(filter-out $(cmd_$@), $(cmd_$(1))))
224
+ # We instead substitute each for the empty string into the other, and
225
+ # say they're equal if both substitutions produce the empty string.
226
+ # .d files contain ? instead of spaces, take that into account.
227
+ command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\
228
+ $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1))))
229
+
230
+ # Helper that is non-empty when a prerequisite changes.
231
+ # Normally make does this implicitly, but we force rules to always run
232
+ # so we can check their command lines.
233
+ # $? -- new prerequisites
234
+ # $| -- order-only dependencies
235
+ prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?))
236
+
237
+ # Helper that executes all postbuilds until one fails.
238
+ define do_postbuilds
239
+ @E=0;\
240
+ for p in $(POSTBUILDS); do\
241
+ eval $$p;\
242
+ E=$$?;\
243
+ if [ $$E -ne 0 ]; then\
244
+ break;\
245
+ fi;\
246
+ done;\
247
+ if [ $$E -ne 0 ]; then\
248
+ rm -rf "$@";\
249
+ exit $$E;\
250
+ fi
251
+ endef
252
+
253
+ # do_cmd: run a command via the above cmd_foo names, if necessary.
254
+ # Should always run for a given target to handle command-line changes.
255
+ # Second argument, if non-zero, makes it do asm/C/C++ dependency munging.
256
+ # Third argument, if non-zero, makes it do POSTBUILDS processing.
257
+ # Note: We intentionally do NOT call dirx for depfile, since it contains ? for
258
+ # spaces already and dirx strips the ? characters.
259
+ define do_cmd
260
+ $(if $(or $(command_changed),$(prereq_changed)),
261
+ @$(call exact_echo, $($(quiet)cmd_$(1)))
262
+ @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))"
263
+ $(if $(findstring flock,$(word 1,$(cmd_$1))),
264
+ @$(cmd_$(1))
265
+ @echo " $(quiet_cmd_$(1)): Finished",
266
+ @$(cmd_$(1))
267
+ )
268
+ @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile)
269
+ @$(if $(2),$(fixup_dep))
270
+ $(if $(and $(3), $(POSTBUILDS)),
271
+ $(call do_postbuilds)
272
+ )
273
+ )
274
+ endef
275
+
276
+ # Declare the "all" target first so it is the default,
277
+ # even though we don't have the deps yet.
278
+ .PHONY: all
279
+ all:
280
+
281
+ # make looks for ways to re-generate included makefiles, but in our case, we
282
+ # don't have a direct way. Explicitly telling make that it has nothing to do
283
+ # for them makes it go faster.
284
+ %.d: ;
285
+
286
+ # Use FORCE_DO_CMD to force a target to run. Should be coupled with
287
+ # do_cmd.
288
+ .PHONY: FORCE_DO_CMD
289
+ FORCE_DO_CMD:
290
+
291
+ TOOLSET := target
292
+ # Suffix rules, putting all outputs into $(obj).
293
+ $(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD
294
+ @$(call do_cmd,cc,1)
295
+ $(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
296
+ @$(call do_cmd,cxx,1)
297
+ $(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD
298
+ @$(call do_cmd,cxx,1)
299
+ $(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD
300
+ @$(call do_cmd,cxx,1)
301
+ $(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD
302
+ @$(call do_cmd,cc,1)
303
+ $(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD
304
+ @$(call do_cmd,cc,1)
305
+
306
+ # Try building from generated source, too.
307
+ $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD
308
+ @$(call do_cmd,cc,1)
309
+ $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
310
+ @$(call do_cmd,cxx,1)
311
+ $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD
312
+ @$(call do_cmd,cxx,1)
313
+ $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD
314
+ @$(call do_cmd,cxx,1)
315
+ $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD
316
+ @$(call do_cmd,cc,1)
317
+ $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD
318
+ @$(call do_cmd,cc,1)
319
+
320
+ $(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD
321
+ @$(call do_cmd,cc,1)
322
+ $(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD
323
+ @$(call do_cmd,cxx,1)
324
+ $(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD
325
+ @$(call do_cmd,cxx,1)
326
+ $(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD
327
+ @$(call do_cmd,cxx,1)
328
+ $(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD
329
+ @$(call do_cmd,cc,1)
330
+ $(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD
331
+ @$(call do_cmd,cc,1)
332
+
333
+
334
+ ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
335
+ $(findstring $(join ^,$(prefix)),\
336
+ $(join ^,wirevpn.target.mk)))),)
337
+ include wirevpn.target.mk
338
+ endif
339
+
340
+ quiet_cmd_regen_makefile = ACTION Regenerating $@
341
+ cmd_regen_makefile = cd $(srcdir); /root/vpn/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/root/.cache/node-gyp/20.20.2" "-Dnode_gyp_dir=/root/vpn/node_modules/node-gyp" "-Dnode_lib_file=/root/.cache/node-gyp/20.20.2/<(target_arch)/node.lib" "-Dmodule_root_dir=/root/vpn" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/root/vpn/build/config.gypi -I/root/vpn/node_modules/node-gyp/addon.gypi -I/root/.cache/node-gyp/20.20.2/include/node/common.gypi "--toplevel-dir=." binding.gyp
342
+ Makefile: $(srcdir)/node_modules/node-gyp/addon.gypi $(srcdir)/../.cache/node-gyp/20.20.2/include/node/common.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp
343
+ $(call do_cmd,regen_makefile)
344
+
345
+ # "all" is a concatenation of the "all" targets from all the included
346
+ # sub-makefiles. This is just here to clarify.
347
+ all:
348
+
349
+ # Add in dependency-tracking rules. $(all_deps) is the list of every single
350
+ # target in our tree. Only consider the ones with .d (dependency) info:
351
+ d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d))
352
+ ifneq ($(d_files),)
353
+ include $(d_files)
354
+ endif
@@ -0,0 +1,17 @@
1
+ cmd_Release/obj.target/wirevpn/src/addon/vpn.o := g++ -o Release/obj.target/wirevpn/src/addon/vpn.o ../src/addon/vpn.cc '-DNODE_GYP_MODULE_NAME=wirevpn' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_FILE_OFFSET_BITS=64' '-D_LARGEFILE_SOURCE' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DNAPI_DISABLE_CPP_EXCEPTIONS' '-DBUILDING_NODE_EXTENSION' -I/root/.cache/node-gyp/20.20.2/include/node -I/root/.cache/node-gyp/20.20.2/src -I/root/.cache/node-gyp/20.20.2/deps/openssl/config -I/root/.cache/node-gyp/20.20.2/deps/openssl/openssl/include -I/root/.cache/node-gyp/20.20.2/deps/uv/include -I/root/.cache/node-gyp/20.20.2/deps/zlib -I/root/.cache/node-gyp/20.20.2/deps/v8/include -I/root/vpn/node_modules/node-addon-api -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -std=gnu++17 -MMD -MF ./Release/.deps/Release/obj.target/wirevpn/src/addon/vpn.o.d.raw -c
2
+ Release/obj.target/wirevpn/src/addon/vpn.o: ../src/addon/vpn.cc \
3
+ /root/vpn/node_modules/node-addon-api/napi.h \
4
+ /root/.cache/node-gyp/20.20.2/include/node/node_api.h \
5
+ /root/.cache/node-gyp/20.20.2/include/node/js_native_api.h \
6
+ /root/.cache/node-gyp/20.20.2/include/node/js_native_api_types.h \
7
+ /root/.cache/node-gyp/20.20.2/include/node/node_api_types.h \
8
+ /root/vpn/node_modules/node-addon-api/napi-inl.h \
9
+ /root/vpn/node_modules/node-addon-api/napi-inl.deprecated.h
10
+ ../src/addon/vpn.cc:
11
+ /root/vpn/node_modules/node-addon-api/napi.h:
12
+ /root/.cache/node-gyp/20.20.2/include/node/node_api.h:
13
+ /root/.cache/node-gyp/20.20.2/include/node/js_native_api.h:
14
+ /root/.cache/node-gyp/20.20.2/include/node/js_native_api_types.h:
15
+ /root/.cache/node-gyp/20.20.2/include/node/node_api_types.h:
16
+ /root/vpn/node_modules/node-addon-api/napi-inl.h:
17
+ /root/vpn/node_modules/node-addon-api/napi-inl.deprecated.h:
@@ -0,0 +1 @@
1
+ cmd_Release/obj.target/wirevpn.node := g++ -o Release/obj.target/wirevpn.node -shared -pthread -rdynamic -m64 -Wl,-soname=wirevpn.node -Wl,--start-group Release/obj.target/wirevpn/src/addon/vpn.o -Wl,--end-group -lsodium
@@ -0,0 +1 @@
1
+ cmd_Release/wirevpn.node := ln -f "Release/obj.target/wirevpn.node" "Release/wirevpn.node" 2>/dev/null || (rm -rf "Release/wirevpn.node" && cp -af "Release/obj.target/wirevpn.node" "Release/wirevpn.node")
@@ -0,0 +1,6 @@
1
+ # This file is generated by gyp; do not edit.
2
+
3
+ export builddir_name ?= ./build/.
4
+ .PHONY: all
5
+ all:
6
+ $(MAKE) wirevpn
@@ -0,0 +1,157 @@
1
+ # This file is generated by gyp; do not edit.
2
+
3
+ TOOLSET := target
4
+ TARGET := wirevpn
5
+ DEFS_Debug := \
6
+ '-DNODE_GYP_MODULE_NAME=wirevpn' \
7
+ '-DUSING_UV_SHARED=1' \
8
+ '-DUSING_V8_SHARED=1' \
9
+ '-DV8_DEPRECATION_WARNINGS=1' \
10
+ '-D_GLIBCXX_USE_CXX11_ABI=1' \
11
+ '-D_FILE_OFFSET_BITS=64' \
12
+ '-D_LARGEFILE_SOURCE' \
13
+ '-D__STDC_FORMAT_MACROS' \
14
+ '-DOPENSSL_NO_PINSHARED' \
15
+ '-DOPENSSL_THREADS' \
16
+ '-DNAPI_DISABLE_CPP_EXCEPTIONS' \
17
+ '-DBUILDING_NODE_EXTENSION' \
18
+ '-DDEBUG' \
19
+ '-D_DEBUG'
20
+
21
+ # Flags passed to all source files.
22
+ CFLAGS_Debug := \
23
+ -fPIC \
24
+ -pthread \
25
+ -Wall \
26
+ -Wextra \
27
+ -Wno-unused-parameter \
28
+ -m64 \
29
+ -g \
30
+ -O0
31
+
32
+ # Flags passed to only C files.
33
+ CFLAGS_C_Debug :=
34
+
35
+ # Flags passed to only C++ files.
36
+ CFLAGS_CC_Debug := \
37
+ -fno-rtti \
38
+ -std=gnu++17
39
+
40
+ INCS_Debug := \
41
+ -I/root/.cache/node-gyp/20.20.2/include/node \
42
+ -I/root/.cache/node-gyp/20.20.2/src \
43
+ -I/root/.cache/node-gyp/20.20.2/deps/openssl/config \
44
+ -I/root/.cache/node-gyp/20.20.2/deps/openssl/openssl/include \
45
+ -I/root/.cache/node-gyp/20.20.2/deps/uv/include \
46
+ -I/root/.cache/node-gyp/20.20.2/deps/zlib \
47
+ -I/root/.cache/node-gyp/20.20.2/deps/v8/include \
48
+ -I/root/vpn/node_modules/node-addon-api
49
+
50
+ DEFS_Release := \
51
+ '-DNODE_GYP_MODULE_NAME=wirevpn' \
52
+ '-DUSING_UV_SHARED=1' \
53
+ '-DUSING_V8_SHARED=1' \
54
+ '-DV8_DEPRECATION_WARNINGS=1' \
55
+ '-D_GLIBCXX_USE_CXX11_ABI=1' \
56
+ '-D_FILE_OFFSET_BITS=64' \
57
+ '-D_LARGEFILE_SOURCE' \
58
+ '-D__STDC_FORMAT_MACROS' \
59
+ '-DOPENSSL_NO_PINSHARED' \
60
+ '-DOPENSSL_THREADS' \
61
+ '-DNAPI_DISABLE_CPP_EXCEPTIONS' \
62
+ '-DBUILDING_NODE_EXTENSION'
63
+
64
+ # Flags passed to all source files.
65
+ CFLAGS_Release := \
66
+ -fPIC \
67
+ -pthread \
68
+ -Wall \
69
+ -Wextra \
70
+ -Wno-unused-parameter \
71
+ -m64 \
72
+ -O3 \
73
+ -fno-omit-frame-pointer
74
+
75
+ # Flags passed to only C files.
76
+ CFLAGS_C_Release :=
77
+
78
+ # Flags passed to only C++ files.
79
+ CFLAGS_CC_Release := \
80
+ -fno-rtti \
81
+ -std=gnu++17
82
+
83
+ INCS_Release := \
84
+ -I/root/.cache/node-gyp/20.20.2/include/node \
85
+ -I/root/.cache/node-gyp/20.20.2/src \
86
+ -I/root/.cache/node-gyp/20.20.2/deps/openssl/config \
87
+ -I/root/.cache/node-gyp/20.20.2/deps/openssl/openssl/include \
88
+ -I/root/.cache/node-gyp/20.20.2/deps/uv/include \
89
+ -I/root/.cache/node-gyp/20.20.2/deps/zlib \
90
+ -I/root/.cache/node-gyp/20.20.2/deps/v8/include \
91
+ -I/root/vpn/node_modules/node-addon-api
92
+
93
+ OBJS := \
94
+ $(obj).target/$(TARGET)/src/addon/vpn.o
95
+
96
+ # Add to the list of files we specially track dependencies for.
97
+ all_deps += $(OBJS)
98
+
99
+ # CFLAGS et al overrides must be target-local.
100
+ # See "Target-specific Variable Values" in the GNU Make manual.
101
+ $(OBJS): TOOLSET := $(TOOLSET)
102
+ $(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
103
+ $(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
104
+
105
+ # Suffix rules, putting all outputs into $(obj).
106
+
107
+ $(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
108
+ @$(call do_cmd,cxx,1)
109
+
110
+ # Try building from generated source, too.
111
+
112
+ $(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
113
+ @$(call do_cmd,cxx,1)
114
+
115
+ $(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD
116
+ @$(call do_cmd,cxx,1)
117
+
118
+ # End of this set of suffix rules
119
+ ### Rules for final target.
120
+ LDFLAGS_Debug := \
121
+ -pthread \
122
+ -rdynamic \
123
+ -m64
124
+
125
+ LDFLAGS_Release := \
126
+ -pthread \
127
+ -rdynamic \
128
+ -m64
129
+
130
+ LIBS := \
131
+ -lsodium
132
+
133
+ $(obj).target/wirevpn.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
134
+ $(obj).target/wirevpn.node: LIBS := $(LIBS)
135
+ $(obj).target/wirevpn.node: TOOLSET := $(TOOLSET)
136
+ $(obj).target/wirevpn.node: $(OBJS) FORCE_DO_CMD
137
+ $(call do_cmd,solink_module)
138
+
139
+ all_deps += $(obj).target/wirevpn.node
140
+ # Add target alias
141
+ .PHONY: wirevpn
142
+ wirevpn: $(builddir)/wirevpn.node
143
+
144
+ # Copy this to the executable output path.
145
+ $(builddir)/wirevpn.node: TOOLSET := $(TOOLSET)
146
+ $(builddir)/wirevpn.node: $(obj).target/wirevpn.node FORCE_DO_CMD
147
+ $(call do_cmd,copy)
148
+
149
+ all_deps += $(builddir)/wirevpn.node
150
+ # Short alias for building this executable.
151
+ .PHONY: wirevpn.node
152
+ wirevpn.node: $(obj).target/wirevpn.node $(builddir)/wirevpn.node
153
+
154
+ # Add executable to "all" target.
155
+ .PHONY: all
156
+ all: $(builddir)/wirevpn.node
157
+
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};