-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (54 loc) · 1.49 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.POSIX:
CRYSTAL = /usr/local/bin/crystal
CRYSTAL_SRC = /usr/local/Cellar/crystal/0.27.2/src/
CRYSTAL_LIB = /opt/brew/lib
CRFLAGS = --release
CFLAGS := \
'-DNODE_GYP_MODULE_NAME=binding' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-D_DARWIN_USE_64_BIT_INODE=1' \
'-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \
'-DBUILDING_NODE_EXTENSION' \
-Os \
-gdwarf-2 \
-mmacosx-version-min=10.7 \
-arch x86_64 \
-Wall \
-Wendif-labels \
-W \
-Wno-unused-parameter \
-fno-strict-aliasing \
-MMD
CCFLAGS := \
-shared \
-undefined \
dynamic_lookup \
-Wl,-no_pie \
-Wl,-search_paths_first \
-mmacosx-version-min=10.7 \
-arch x86_64 \
-stdlib=libc++ \
-init _crystal_library_init
INCS := \
-I$(HOME)/.node-gyp/11.14.0/include/node \
-I$(HOME)/.node-gyp/11.14.0/src \
-I$(HOME)/.node-gyp/11.14.0/deps/openssl/config \
-I$(HOME)/.node-gyp/11.14.0/deps/openssl/openssl/include \
-I$(HOME)/.node-gyp/11.14.0/deps/uv/include \
-I$(HOME)/.node-gyp/11.14.0/deps/zlib \
-I$(HOME)/.node-gyp/11.14.0/deps/v8/include
PRELUDE=./crystal/prelude.cr
CRYSTAL_PATH = src:$(CRYSTAL_SRC)
LIBS = $(CRYSTAL_SRC)/ext/libcrystal.a -lgc -ldl -levent -lpcre -lpthread -liconv -ljack
LDFLAGS = $(LIBS)
run: clean libjack2.o
c++ $(CCFLAGS) -o build/libjack2.node build/libjack2.o $(LDFLAGS)
node js/index.js
libjack2.o:
$(CRYSTAL) build $(CRFLAGS) --cross-compile --prelude $(PRELUDE) -o build/libjack2 src/libjack2.cr
clean: phony
rm -f libjack2.o *_test bc_flags
phony: