Print this page
OS-2552 add node-lockfd (v0.0.2) to platform
OS-2558 smartos-live should run tools from proto.strap, not proto
Split |
Close |
Expand all |
Collapse all |
--- old/src/Makefile
+++ new/src/Makefile
1 1 #
2 2 # Copyright (c) 2012, Joyent, Inc. All rights reserved.
3 3 #
4 4
5 5 include Makefile.defs
6 6
7 7 #
8 8 # ROOT is used only when building and running the below tools.
9 9 #
10 10 ROOT = $(PWD)/..
11 11 JSSTYLE = $(ROOT)/tools/jsstyle/jsstyle
12 12 JSLINT = $(ROOT)/tools/javascriptlint/build/install/jsl
13 13 CSTYLE = $(ROOT)/tools/cstyle
14 14
15 15 #
16 16 # Tool options
17 17 #
18 18 JSSTYLE_OPTS = -o indent=4,strict-indent=1,doxygen,unparenthesized-return=0,continuation-at-front=1,leading-right-paren-ok=1
19 19
20 20 JSSTYLE_OLDSKOOL_OPTS =
21 21
22 22 #
23 23 # Installation configuration. Note that DESTDIR in particular is also
24 24 # assumed to contain various build tools, headers, libraries, and other
25 25 # artifacts of the platform build from which we incorporate runtime
26 26 # dependency information. The default DESTDIR is for standalone builds
27 27 # only (i.e., without the rest of the platform) and is unlikely to work
28 28 # without extra effort; it is overridden when make is invoked in this
29 29 # subdirectory.
30 30 #
31 31 DESTDIR = ../proto
32 32
33 33 #
34 34 # DESTNAME is used for the manifest target. We set it to something
35 35 # obvious here so that if it's not set, the manifest target doesn't do
36 36 # bad things.
37 37 #
38 38 DESTNAME = live.manifest
39 39
40 40 SMARTDCBINDIR = $(DESTDIR)/smartdc/bin
41 41 SMARTDCLIBDIR = $(DESTDIR)/smartdc/lib
42 42
43 43 #
44 44 # Per-target variable definitions go here. See Makefile.defs and the targets
45 45 # below and in Makefile.targ to see what's useful to append to or override.
46 46 # If you need to create your own target anyway, you can either modify
47 47 # variables here or incorporate your changes directly into the target; we
48 48 # prefer modifying the generic variable to the extent that the change fits
49 49 # naturally with an existing one so that we can pick up general changes in
50 50 # Makefile.defs even for custom targets.
51 51 #
52 52 bootparams : LIBS += -ldevinfo
53 53 bootparams : WARN_FLAGS += -Wno-unused
54 54 diskinfo : LIBS += -ldladm -ldiskmgt -lnvpair
55 55 zfs_recv : LIBS += -lsocket
56 56 zfs_send : LIBS += -lsocket
57 57 vmbundle : CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
58 58 sdc-on-tty : CFLAGS += $(OPT_FLAG)
59 59 zoneevent : LIBS += -lnvpair -lsysevent
60 60
61 61 # These files will get run through jsstyle and jslint on 'make check'
62 62 JS_CHECK_TARGETS=\
63 63 filewait.js \
64 64 node_modules/{system,onlyif}.js \
65 65 vm/sbin/*.js \
66 66 vm/node_modules/{qmp,VM,dladm}.js \
67 67 img/lib/*.js \
68 68 img/sbin/imgadm \
69 69 vm/lib/metadata/*.js
70 70
71 71 JS_CHECK_OLDSKOOL_TARGETS = \
72 72 disklayout.js \
73 73 mkzpool.js \
74 74 node_modules/disklayout.js
75 75
76 76 # These files will get run through cstyle on 'make check'
77 77 C_CHECK_TARGETS=\
78 78 qemu-exec.c \
79 79 vmunbundle.c \
80 80 zfs_recv.c \
81 81 zfs_send.c \
82 82 zoneevent.c
83 83
84 84 #
85 85 # Generic flags we apply by default to everything.
86 86 #
87 87 CFLAGS += $(WARN_FLAGS)
88 88 CXXFLAGS = $(CFLAGS)
89 89
90 90 #
91 91 # Node native add-on patterns. For add-ons with a single source file in the
92 92 # root of the add-on tree and no headers of its own, follow the EXPAT.NODE
93 93 # pattern here and below in the targets. More complex examples (source
94 94 # subdirectory, headers, multiple C++ sources) follow; see associated comments
95 95 # if you are looking for a pattern to copy.
96 96 #
97 97 EXPAT_OBJDIR = node-expat/build/Release
98 98 EXPAT.NODE = $(EXPAT_OBJDIR)/node-expat.node
99 99
100 100 $(EXPAT.NODE) : WARN_FLAGS += -Wno-unused
101 101 $(EXPAT.NODE) : CPPFLAGS += $(NODE_CPPFLAGS)
102 102 $(EXPAT.NODE) : CXXFLAGS += $(NODE_CFLAGS)
103 103 $(EXPAT.NODE) : LDFLAGS += $(NODE_LDFLAGS)
104 104 $(EXPAT.NODE) : LIBS += -lexpat
105 105
106 106 #
107 107 # The kstat Node add-on follows the same pattern as EXPAT.NODE.
108 108 #
↓ open down ↓ |
108 lines elided |
↑ open up ↑ |
109 109 KSTAT_OBJDIR = node-kstat/build/Release
110 110 KSTAT.NODE = $(KSTAT_OBJDIR)/kstat.node
111 111
112 112 $(KSTAT.NODE) : WARN_FLAGS += -Wno-unused -Wno-write-strings -Wno-sign-compare
113 113 $(KSTAT.NODE) : CPPFLAGS += $(NODE_CPPFLAGS)
114 114 $(KSTAT.NODE) : CXXFLAGS += $(NODE_CFLAGS)
115 115 $(KSTAT.NODE) : LDFLAGS += $(NODE_LDFLAGS)
116 116 $(KSTAT.NODE) : LIBS += -lkstat
117 117
118 118 #
119 +# The lockfd Node add-on is based on v8plus, which has its own system of
120 +# Makefiles.
121 +#
122 +LOCKFD_BINDING.NODE = node-lockfd/lib/lockfd_binding.node
123 +
124 +LOCKFD_SRC_DIR = $(PWD)/node-lockfd/src
125 +LOCKFD_V8PLUS_DIR = $(PWD)/node-lockfd/node_modules/v8plus
126 +
127 +#
119 128 # The dtrace-provider add-on uses a combination of C, assembly and C++ files in
120 129 # multiple directories.
121 130 #
122 131 DTRACE_PROVIDER_OBJDIR = node-dtrace-provider/build/Release
123 132 DTRACE_PROVIDER_SRCDIR = node-dtrace-provider
124 133 DTRACE_PROVIDER.NODE = $(DTRACE_PROVIDER_OBJDIR)/dtrace-provider.node
125 134
126 135 DTRACE_PROVIDER_SRCS += \
127 136 dtrace_probe.cc \
128 137 dtrace_provider.cc
129 138
130 139 DTRACE_PROVIDER_LIBUSDT_SRCS += \
131 140 libusdt/usdt.c \
132 141 libusdt/usdt_dof_file.c \
133 142 libusdt/usdt_probe.c \
134 143 libusdt/usdt_dof.c \
135 144 libusdt/usdt_dof_sections.c
136 145
137 146 DTRACE_PROVIDER_LIBUSDT_ASM_SRCS += \
138 147 libusdt/usdt_tracepoints_i386.s
139 148
140 149 DTRACE_PROVIDER_HDRS += \
141 150 node-dtrace-provider/dtrace_provider.h \
142 151 node-dtrace-provider/libusdt/usdt_internal.h \
143 152 node-dtrace-provider/libusdt/usdt.h
144 153
145 154 DTRACE_PROVIDER_OBJS += \
146 155 $(DTRACE_PROVIDER_SRCS:%.cc=$(DTRACE_PROVIDER_OBJDIR)/%.o) \
147 156 $(DTRACE_PROVIDER_LIBUSDT_SRCS:%.c=$(DTRACE_PROVIDER_OBJDIR)/%.o) \
148 157 $(DTRACE_PROVIDER_LIBUSDT_ASM_SRCS:%.s=$(DTRACE_PROVIDER_OBJDIR)/%.o)
149 158
150 159 $(DTRACE_PROVIDER.NODE) : WARN_FLAGS += -Wno-unused -Wno-sign-compare
151 160 $(DTRACE_PROVIDER.NODE) : CFLAGS += $(NODE_CFLAGS)
152 161 $(DTRACE_PROVIDER.NODE) : CPPFLAGS += \
153 162 $(NODE_CPPFLAGS) \
154 163 -Inode-dtrace-provider/libusdt
155 164 $(DTRACE_PROVIDER.NODE) : CXXFLAGS += $(NODE_CFLAGS)
156 165 $(DTRACE_PROVIDER.NODE) : LDFLAGS += $(NODE_LDFLAGS)
157 166
158 167 CLEANFILES += $(DTRACE_PROVIDER.NODE) $(DTRACE_PROVIDER_OBJS)
159 168
160 169 #
161 170 # The microtime Node add-on follows the same pattern as EXPAT.NODE.
162 171 #
163 172 MICROTIME_OBJDIR = node-microtime/build/Release
164 173 MICROTIME.NODE = $(MICROTIME_OBJDIR)/microtime.node
165 174
166 175 $(MICROTIME.NODE) : WARN_FLAGS += -Wno-unused -Wno-write-strings -Wno-sign-compare
167 176 $(MICROTIME.NODE) : CPPFLAGS += $(NODE_CPPFLAGS)
168 177 $(MICROTIME.NODE) : CXXFLAGS += $(NODE_CFLAGS)
169 178 $(MICROTIME.NODE) : LDFLAGS += $(NODE_LDFLAGS)
170 179
171 180
172 181 #
173 182 # The sqlite3 add-on uses a combination of C + C++ files in multiple
174 183 # directories, and has multiple header directories as well.
175 184 #
176 185 SQLITE3_OBJDIR = node-sqlite3/build/Release
177 186 SQLITE3_SRCDIR = node-sqlite3/src
178 187 SQLITE3_LIBSRCDIR = node-sqlite3/deps/sqlite3
179 188 SQLITE3_BINDINGS.NODE = $(SQLITE3_OBJDIR)/node_sqlite3.node
180 189
181 190 SQLITE3_SRCS += \
182 191 database.cc \
183 192 node_sqlite3.cc \
184 193 statement.cc
185 194
186 195 SQLITE3_LIBSRCS += sqlite3.c
187 196
188 197 SQLITE3_NODEHDRS += \
189 198 async.h \
190 199 macros.h \
191 200 statement.h \
192 201 threading.h
193 202
194 203 SQLITE3_LIBHDRS += \
195 204 sqlite3.h \
196 205 sqlite3ext.h
197 206
198 207 SQLITE3_OBJS = \
199 208 $(SQLITE3_SRCS:%.cc=$(SQLITE3_OBJDIR)/%.o) \
200 209 $(SQLITE3_LIBSRCS:%.c=$(SQLITE3_OBJDIR)/%.o)
201 210 SQLITE3_HDRS = \
202 211 $(SQLITE3_NODEHDRS:%=$(SQLITE3_SRCDIR)/%) \
203 212 $(SQLITE3_LIBHDRS:%=$(SQLITE3_LIBSRCDIR)/%)
204 213 CLEANFILES += $(SQLITE3_OBJS)
205 214
206 215 SQLITE3_FLAGS = \
207 216 -fdata-sections \
208 217 -ffunction-sections \
209 218 -fno-omit-frame-pointer \
210 219 -fno-strict-aliasing \
211 220 -fno-exceptions
212 221
213 222 $(SQLITE3_BINDINGS.NODE) : WARN_FLAGS = -Wall -Werror
214 223 $(SQLITE3_BINDINGS.NODE) : CPPFLAGS += \
215 224 $(NODE_CPPFLAGS) \
216 225 -I$(SQLITE3_LIBSRCDIR) \
217 226 -D_SQLITE_THREADSAFE=1 \
218 227 -D_SQLITE_ENABLE_FTS3 \
219 228 -D_SQLITE_ENABLE_RTREE \
220 229 -D_LARGEFILE_SOURCE \
221 230 -D_FILE_OFFSET_BITS=64 \
222 231 -D_REENTRANT \
223 232 -D_NDEBUG \
224 233 -D_POSIX_PTHREAD_SEMANTICS
225 234 $(SQLITE3_BINDINGS.NODE) : CFLAGS += \
226 235 $(NODE_CFLAGS) \
227 236 $(SQLITE3_FLAGS)
228 237 $(SQLITE3_BINDINGS.NODE) : LDFLAGS += \
229 238 $(NODE_LDFLAGS) \
230 239 -Wl,-soname=node_sqlite3.node
231 240 $(SQLITE3_BINDINGS.NODE) : LIBS += -lpthread
232 241
233 242 #
234 243 # The libuuid Node add-on follows the same pattern as EXPAT.NODE.
235 244 #
236 245 UUID_OBJDIR = node-libuuid/build/Release
237 246 UUID_SRCDIR = node-libuuid/src
238 247 UUID.NODE = $(UUID_OBJDIR)/uuid.node
239 248
240 249 $(UUID.NODE) : WARN_FLAGS += -Wno-unused -Wno-write-strings -Wno-sign-compare
241 250 $(UUID.NODE) : CPPFLAGS += $(NODE_CPPFLAGS)
242 251 $(UUID.NODE) : CXXFLAGS += $(NODE_CFLAGS)
243 252 $(UUID.NODE) : LDFLAGS += $(NODE_LDFLAGS)
244 253 $(UUID.NODE) : LIBS += -luuid
245 254
246 255 #
247 256 # The zsock add-on places its single source file in a subdirectory.
248 257 #
249 258 ZSOCK_OBJDIR = node-zsock/build/Release
250 259 ZSOCK_SRCDIR = node-zsock/src
251 260 ZSOCK_BINDINGS.NODE = $(ZSOCK_OBJDIR)/zsock_bindings.node
252 261
253 262 $(ZSOCK_BINDINGS.NODE) : WARN_FLAGS = -Wall -Werror
254 263 $(ZSOCK_BINDINGS.NODE) : CPPFLAGS += \
255 264 $(NODE_CPPFLAGS) \
256 265 -D_REENTRANT \
257 266 -D_POSIX_PTHREAD_SEMANTICS \
258 267 -D_XOPEN_SOURCE_EXTENDED=1 \
259 268 -D__EXTENSIONS__ \
260 269 -DSunOS
261 270 $(ZSOCK_BINDINGS.NODE) : CXXFLAGS += \
262 271 $(NODE_CFLAGS) \
263 272 -std=c++98
264 273 $(ZSOCK_BINDINGS.NODE) : LDFLAGS += $(NODE_LDFLAGS)
265 274 $(ZSOCK_BINDINGS.NODE) : LIBS += -lsocket -lnsl -lcontract
266 275
267 276 #
268 277 # The zutil add-on places its multiple source files in a subdirectory, and
269 278 # builds them against some headers that it also supplies and needs to depend on.
270 279 # Because we must build intermediate object files, this requires a
271 280 # different target pattern as well; see below.
272 281 #
273 282 ZUTIL_OBJDIR = node-zutil/build/Release
274 283 ZUTIL_SRCDIR = node-zutil/src
275 284 ZUTIL_BINDINGS.NODE = $(ZUTIL_OBJDIR)/zutil_bindings.node
276 285
277 286 ZUTIL_SRCS += \
278 287 zone.cc \
279 288 zonecfg.cc \
280 289 zutil_bindings.cc
281 290
282 291 ZUTIL_HDRS += \
283 292 zone.h \
284 293 zonecfg.h \
285 294 zutil_common.h
286 295
287 296 ZUTIL_BINDINGS_OBJS = $(ZUTIL_SRCS:%.cc=$(ZUTIL_OBJDIR)/%.o)
288 297 ZUTIL_BINDINGS_HDRS = $(ZUTIL_HDRS:%=$(ZUTIL_SRCDIR)/%)
289 298 CLEANFILES += $(ZUTIL_BINDINGS_OBJS)
290 299
291 300 $(ZUTIL_BINDINGS.NODE) : WARN_FLAGS += -Wno-unused
292 301 $(ZUTIL_BINDINGS.NODE) : CPPFLAGS += $(NODE_CPPFLAGS) -DSunOS
293 302 $(ZUTIL_BINDINGS.NODE) : CXXFLAGS += $(NODE_CFLAGS)
294 303 $(ZUTIL_BINDINGS.NODE) : LDFLAGS += $(NODE_LDFLAGS)
295 304 $(ZUTIL_BINDINGS.NODE) : LIBS += -lzonecfg
296 305
297 306 #
298 307 # List of targets. TARGETS, SMARTDC_TARGETS, and SMARTDC_LIB_TARGETS must
299 308 # include only those files that are safe to remove when the clean target is
300 309 # built.
301 310 #
302 311 TARGETS = \
303 312 bootparams \
304 313 diskinfo \
305 314 disklayout \
306 315 disklist \
↓ open down ↓ |
178 lines elided |
↑ open up ↑ |
307 316 disk_size \
308 317 mkzpool \
309 318 removable_disk \
310 319 vmunbundle \
311 320 zfs_recv \
312 321 zfs_send \
313 322 zoneevent \
314 323 $(EXPAT.NODE) \
315 324 $(DTRACE_PROVIDER.NODE) \
316 325 $(KSTAT.NODE) \
326 + $(LOCKFD_BINDING.NODE) \
317 327 $(MICROTIME.NODE) \
318 328 $(SYSLOG.NODE) \
319 329 $(SQLITE3_BINDINGS.NODE) \
320 330 $(UUID.NODE) \
321 331 $(ZSOCK_BINDINGS.NODE) \
322 332 $(ZUTIL_BINDINGS.NODE)
323 333
324 334 USR_LIB_TARGETS = \
325 335 measure_terminal
326 336
327 337 SMARTDC_TARGETS = \
328 338 qemu-exec
329 339
330 340 SMARTDC_LIB_TARGETS = \
331 341 sdc-on-tty
332 342
333 343 all: $(TARGETS) $(USR_LIB_TARGETS) sysinfo nictagadm $(SMARTDC_TARGETS) \
334 344 $(SMARTDC_LIB_TARGETS)
335 345
336 346 install: all
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
337 347 mkdir -p $(DESTDIR)/usr/bin
338 348 cp -p $(TARGETS) sysinfo nictagadm $(DESTDIR)/usr/bin
339 349 cp -p $(USR_LIB_TARGETS) $(DESTDIR)/usr/lib
340 350 mkdir -p $(DESTDIR)/smartdc/bin
341 351 cp -p $(SMARTDC_TARGETS) $(DESTDIR)/smartdc/bin
342 352 mkdir -p $(DESTDIR)/smartdc/lib
343 353 cp -p $(SMARTDC_LIB_TARGETS) $(DESTDIR)/smartdc/lib
344 354 mkdir -m 0755 -p $(PREFIX_NODE)/node_modules
345 355 cp -Pr node_modules/* $(PREFIX_NODE)/node_modules
346 356 cp $(KSTAT.NODE) $(PREFIX_NODE)/node_modules/
357 + cp node-lockfd/lib/index.js $(PREFIX_NODE)/node_modules/lockfd.js
358 + cp $(LOCKFD_BINDING.NODE) $(PREFIX_NODE)/node_modules/lockfd_binding.node
347 359 cp $(MICROTIME.NODE) $(PREFIX_NODE)/node_modules/
348 360 rm -rf $(DESTDIR)/usr/vm
349 361 cp -PR vm $(DESTDIR)/usr/
350 362 mkdir -m 0755 -p $(DESTDIR)/usr/vm/node_modules
351 363 mkdir -p $(PREFIX_NODE)/node_modules/{zsock,zutil}/build/Release
352 364 mkdir -p $(DESTDIR)/usr/vm/test/tests
353 365 cp -Pr vm/common $(DESTDIR)/usr/vm/test/
354 366 cp -Pr vm/node-tap $(DESTDIR)/usr/vm/test/
355 367 cp -Pr vm/tests $(DESTDIR)/usr/vm/test/
356 368 cp vm/runtest $(DESTDIR)/usr/vm/test/
357 369 cp vm/runtests $(DESTDIR)/usr/vm/test/
358 370 cp -Pr node-zsock/{package.json,lib} \
359 371 $(PREFIX_NODE)/node_modules/zsock
360 372 cp -Pr node-zutil/{package.json,lib} \
361 373 $(PREFIX_NODE)/node_modules/zutil
362 374 cp $(SQLITE3_BINDINGS.NODE) \
363 375 $(PREFIX_NODE)/node_modules
364 376 (sed -e "s|var sqlite3.*;|var sqlite3 = module.exports = exports = require('./node_sqlite3');|" | \
365 377 sed -e "s|var trace = require.*;|var trace = require('./sqlite3_trace')|") \
366 378 < node-sqlite3/lib/sqlite3.js \
367 379 > $(PREFIX_NODE)/node_modules/sqlite3.js
368 380 cp node-sqlite3/lib/trace.js $(PREFIX_NODE)/node_modules/sqlite3_trace.js
369 381 cp $(ZSOCK_BINDINGS.NODE) \
370 382 $(PREFIX_NODE)/node_modules/zsock/build/Release
371 383 cp $(ZUTIL_BINDINGS.NODE) \
372 384 $(PREFIX_NODE)/node_modules/zutil/build/Release
373 385 cp $(EXPAT.NODE) $(PREFIX_NODE)/node_modules/expat_binding.node
374 386 cp $(UUID.NODE) $(PREFIX_NODE)/node_modules/uuid.node
375 387 cp $(DTRACE_PROVIDER.NODE) $(PREFIX_NODE)/node_modules/dtrace-provider.node
376 388 sed -e "s|require('./build.*DTraceProviderBindings')|require('/usr/node/node_modules/dtrace-provider.node')|" \
377 389 < $(DTRACE_PROVIDER_SRCDIR)/dtrace-provider.js \
378 390 > $(PREFIX_NODE)/node_modules/dtrace-provider.js
379 391 sed -e "s|var expat.*;|var expat = require('./expat_binding');|" \
380 392 < node-expat/lib/node-expat.js \
381 393 > $(PREFIX_NODE)/node_modules/node-expat.js
382 394 cp zoneevent $(DESTDIR)/usr/vm/sbin/zoneevent
383 395 cp zfs_send $(DESTDIR)/usr/vm/sbin/zfs_send
384 396 cp zfs_recv $(DESTDIR)/usr/vm/sbin/zfs_recv
385 397 cp vmunbundle $(DESTDIR)/usr/vm/sbin/vmunbundle
386 398 cp filewait.js $(DESTDIR)/usr/vm/sbin/filewait
387 399 mkdir -p $(DESTDIR)/lib/svc/manifest/system
388 400 cp vm/smf/system-vmadmd.xml \
389 401 $(DESTDIR)/lib/svc/manifest/system/system-vmadmd.xml
390 402 cp vm/smf/system-metadata.xml \
391 403 $(DESTDIR)/lib/svc/manifest/system/system-metadata.xml
392 404 mv $(DESTDIR)/usr/vm/sbin/vmadmd.js $(DESTDIR)/usr/vm/sbin/vmadmd
393 405 mv $(DESTDIR)/usr/vm/sbin/vmadm.js $(DESTDIR)/usr/vm/sbin/vmadm
394 406 mv $(DESTDIR)/usr/vm/sbin/add-userscript.js \
395 407 $(DESTDIR)/usr/vm/sbin/add-userscript
396 408 mv $(DESTDIR)/usr/vm/sbin/metadata.js $(DESTDIR)/usr/vm/sbin/metadata
397 409 mkdir -p $(DESTDIR)/usr/share/man/man1
398 410 sed -e "s|require('dtrace-provider')|require('/usr/node/node_modules/dtrace-provider')|" \
399 411 < node-bunyan/lib/bunyan.js \
400 412 > $(PREFIX_NODE)/node_modules/bunyan.js
401 413 cp node-bunyan/docs/bunyan.1 $(DESTDIR)/usr/share/man/man1/bunyan.1
402 414 mkdir -p $(DESTDIR)/usr/bin
403 415 sed -e 's|^#!/usr/bin/env node.*$$|#!/usr/node/bin/node|' \
404 416 < node-bunyan/bin/bunyan \
405 417 > $(DESTDIR)/usr/bin/bunyan
406 418 cp node-panic/lib/panic.js $(PREFIX_NODE)/node_modules/panic.js
407 419 cp node-panic/lib/subr.js $(PREFIX_NODE)/node_modules/subr.js
408 420 rm -rf $(DESTDIR)/usr/img
409 421 mkdir -m 0755 -p $(DESTDIR)/usr/img
410 422 cp img/README.md $(DESTDIR)/usr/img/README.md
411 423 cp img/package.json $(DESTDIR)/usr/img/package.json
412 424 cp -PR img/etc $(DESTDIR)/usr/img/
413 425 cp -PR img/lib $(DESTDIR)/usr/img/
414 426 cp -PR img/man $(DESTDIR)/usr/img/
415 427 cp -PR img/node_modules $(DESTDIR)/usr/img/
416 428 cp -PR img/sbin $(DESTDIR)/usr/img/
417 429 cp -PR img/test $(DESTDIR)/usr/img/
418 430 rm -rf $(DESTDIR)/usr/fw
419 431 mkdir -m 0755 -p $(DESTDIR)/usr/fw
420 432 cp -PR fw/etc $(DESTDIR)/usr/fw/
421 433 cp -PR fw/lib $(DESTDIR)/usr/fw/
422 434 cp -PR fw/node_modules $(DESTDIR)/usr/fw/
423 435 cp -PR fw/sbin $(DESTDIR)/usr/fw/
424 436
425 437 check: $(JSLINT)
426 438 @echo "==> Running cstyle..."
427 439 @# cstyle doesn't echo as it goes so we add an echo to each line below
428 440 @(for file in $(C_CHECK_TARGETS); do \
429 441 echo $(PWD)/$$file; \
430 442 $(CSTYLE) $$file; \
431 443 done)
432 444 @printf "\nC files ok!\n"
433 445 @printf "\n==> Running JavaScriptLint...\n"
434 446 @$(JSLINT) --nologo --conf=$(ROOT)/tools/jsl.node.conf \
435 447 $(JS_CHECK_TARGETS) $(JS_CHECK_OLDSKOOL_TARGETS)
436 448 @printf "\n==> Running jsstyle...\n"
437 449 @# jsstyle doesn't echo as it goes so we add an echo to each line below
438 450 (for file in $(JS_CHECK_TARGETS); do \
439 451 echo $(PWD)/$$file; \
440 452 $(JSSTYLE) $(JSSTYLE_OPTS) $$file; \
441 453 [[ $$? == "0" ]] || exit 1; \
442 454 done)
443 455 (for file in $(JS_CHECK_OLDSKOOL_TARGETS); do \
444 456 echo $(PWD)/$$file; \
445 457 $(JSSTYLE) $(JSSTYLE_OLDSKOOL_OPTS) $$file; \
446 458 [[ $$? == "0" ]] || exit 1; \
447 459 done)
448 460 @printf "\nJS style ok!\n"
449 461
450 462 .PHONY: manifest
451 463 manifest:
452 464 (cat manifest && cd vm && \
453 465 echo "# list of tests is autogenerated by smartos-live/src/Makefile" && \
454 466 find tests/ -type f -exec echo "{}" "0444 root bin" \;) \
↓ open down ↓ |
98 lines elided |
↑ open up ↑ |
455 467 | sed -e "s|^tests/|f usr/vm/test/tests/|" \
456 468 > $(DESTDIR)/$(DESTNAME) \
457 469
458 470 $(JSLINT):
459 471 (cd $(ROOT); $(MAKE) jsl)
460 472
461 473 clean:
462 474 -rm -f $(TARGETS) $(SMARTDC_TARGETS) $(SMARTDC_LIB_TARGETS) *.o \
463 475 $(CLEANFILES)
464 476 -rm -rf node-sqlite3/build
477 + cd $(LOCKFD_SRC_DIR) && $(MAKE) clean
465 478
466 479 include Makefile.targ
467 480
468 481 #
469 482 # Custom rules for building our various real targets follow. Generic rules
470 483 # belong in Makefile.targ.
471 484 #
472 485 disklayout: disklayout.js
473 486 cp disklayout.js disklayout
474 487 chmod 0755 disklayout
475 488
476 489 disklist: disklist.sh
477 490 cp disklist.sh disklist
478 491 chmod 0755 disklist
479 492
480 493 mkzpool: mkzpool.js
481 494 cp mkzpool.js mkzpool
482 495 chmod 0755 mkzpool
483 496
484 497 sysinfo:
485 498 touch sysinfo
486 499
487 500 nictagadm:
488 501 touch nictagadm
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
489 502
490 503 #
491 504 # Node native add-on target patterns. Follow these patterns when adding a new
492 505 # add-on and see the comment and definitions for EXPAT.NODE above as well.
493 506 #
494 507 $(EXPAT.NODE): node-expat/node-expat.cc
495 508 @mkdir -p $(EXPAT_OBJDIR)
496 509 $(GXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
497 510
498 511 #
512 +# node-lockfd is built using the v8plus-based Makefile contained within the
513 +# project. We use LD_OPTIONS, here, to induce the linker to include libc,
514 +# which gcc as configured in proto.strap does not, but which other C compilers
515 +# generally do.
516 +#
517 +$(LOCKFD_BINDING.NODE): FRC
518 + cd $(LOCKFD_SRC_DIR) && \
519 + LD_OPTIONS=-lc \
520 + $(MAKE) \
521 + CC=$(GCC) CXX=$(GXX) \
522 + PREFIX_NODE=$(PREFIX_NODE) \
523 + NODE_EXEC=$(NODE_EXEC) \
524 + V8PLUS=$(LOCKFD_V8PLUS_DIR) \
525 + CTFCONVERT=$(CTFCONVERT) \
526 + CTFMERGE=$(CTFMERGE)
527 +
528 +#
499 529 # The next two are used to build libusdt files into
500 530 # $(DTRACE_PROVIDER_OBJDIR)/libusdt/*.o, instead of building libusdt.a
501 531 #
502 532 $(DTRACE_PROVIDER_OBJDIR)/%.o: $(DTRACE_PROVIDER_SRCDIR)/%.c \
503 533 $(DTRACE_PROVIDER_HDRS)
504 534 @mkdir -p $(DTRACE_PROVIDER_OBJDIR)/libusdt
505 535 $(GCC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
506 536
507 537 $(DTRACE_PROVIDER_OBJDIR)/%.o: $(DTRACE_PROVIDER_SRCDIR)/%.s
508 538 @mkdir -p $(DTRACE_PROVIDER_OBJDIR)/libusdt
509 539 $(GCC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
510 540
511 541 $(DTRACE_PROVIDER_OBJDIR)/%.o: $(DTRACE_PROVIDER_SRCDIR)/%.cc \
512 542 $(DTRACE_PROVIDER_HDRS)
513 543 @mkdir -p $(DTRACE_PROVIDER_OBJDIR)
514 544 $(GXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ -c $<
515 545
516 546 $(DTRACE_PROVIDER.NODE): $(DTRACE_PROVIDER_OBJS)
517 547 @mkdir -p $(DTRACE_PROVIDER_OBJDIR)
518 548 $(GXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $(DTRACE_PROVIDER_OBJS) $(LIBS)
519 549
520 550 $(KSTAT.NODE): node-kstat/kstat.cc
521 551 @mkdir -p $(KSTAT_OBJDIR)
522 552 $(GXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
523 553
524 554 $(MICROTIME.NODE): node-microtime/src/microtime.cc
525 555 @mkdir -p $(MICROTIME_OBJDIR)
526 556 $(GXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
527 557
528 558 $(SQLITE3_OBJDIR)/%.o: $(SQLITE3_SRCDIR)/%.cc $(SQLITE3_HDRS)
529 559 @mkdir -p $(SQLITE3_OBJDIR)
530 560 $(GXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
531 561
532 562 $(SQLITE3_OBJDIR)/%.o: $(SQLITE3_LIBSRCDIR)/%.c $(SQLITE3_HDRS)
533 563 @mkdir -p $(SQLITE3_OBJDIR)
534 564 $(GCC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
535 565
536 566 $(SQLITE3_BINDINGS.NODE): $(SQLITE3_OBJS)
537 567 $(GXX) $(LDFLAGS) -o $@ $(SQLITE3_OBJS) $(LIBS)
538 568
539 569 $(UUID.NODE): $(UUID_SRCDIR)/uuid.cc
540 570 @mkdir -p $(UUID_OBJDIR)
541 571 $(GXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
542 572
543 573 $(ZSOCK_BINDINGS.NODE): $(ZSOCK_SRCDIR)/zsock.cc
544 574 @mkdir -p $(ZSOCK_OBJDIR)
545 575 $(GXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
↓ open down ↓ |
37 lines elided |
↑ open up ↑ |
546 576
547 577 #
548 578 # The zutil add-on requires a slightly more complex 2-phase build.
549 579 #
550 580 $(ZUTIL_OBJDIR)/%.o: $(ZUTIL_SRCDIR)/%.cc $(ZUTIL_BINDINGS_HDRS)
551 581 @mkdir -p $(ZUTIL_OBJDIR)
552 582 $(GXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
553 583
554 584 $(ZUTIL_BINDINGS.NODE): $(ZUTIL_BINDINGS_OBJS)
555 585 $(GXX) $(LDFLAGS) -o $@ $(ZUTIL_BINDINGS_OBJS) $(LIBS)
586 +
587 +FRC:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX