-
Notifications
You must be signed in to change notification settings - Fork 41
/
Tupfile
69 lines (43 loc) · 2.29 KB
/
Tupfile
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
66
67
68
69
include_rules
DEPS = newplus/libnewplus.so
RPATH_NEWPLUS=\$ORIGIN/newplus
LINK_FLAGS += -Lnewplus -lnewplus -Wl,-rpath,$(RPATH_NEWPLUS)
NODE_VERSION = 6.9.0
NODE_GYP_FLAGS = -DNODE_GYP_MODULE_NAME=newplus -DUSING_UV_SHARED=1 -DUSING_V8_SHARED=1 -DV8_DEPRECATION_WARNINGS=1 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DBUILDING_NODE_EXTENSION -I$HOME/.node-gyp/$(NODE_VERSION)/include/node -I$HOME/.node-gyp/$(NODE_VERSION)/src -I$HOME/.node-gyp/$(NODE_VERSION)/deps/uv/include -I$HOME/.node-gyp/$(NODE_VERSION)/deps/v8/include
NODE_CXX_FLAGS = $(CXXFLAGS) -fno-exceptions
# =====================================
: foreach *.c |> !cc |> c/%B.o
: foreach *.cpp |> !cxx |> cpp/%B.o
# ===================================== exe linked to shared lib
# c
: c/*.o | $(DEPS) |> !cc_exe |> c_hello
# cpp
: cpp/*.o | $(DEPS) |> !cxx_exe |> cpp_hello
# csharp (use mcs if csc doesn't work)
: hello.cs | $(DEPS) |> csc /out:%o %f |> csharp_hello.exe
# nim
: nimcache/*.o | $(DEPS) |> !cc_exe |> nim_hello
# v
: hello.v | $(DEPS) |> v -prod %f -o %o |> v_hello
# go
: hello.go | $(DEPS) |> go build -o %o %f |> go_hello
# rust
: hello.rs | $(DEPS) |> rustc -C opt-level=2 -C link-args="$(LINK_FLAGS)" -o %o %f |> rust_hello
# dart
: foreach dart/*.cpp |> $(CXX) -c %f -o %o $(CXXFLAGS) -DDART_SHARED_LIB -I/usr/lib/dart -I. |> dart/%B.o
: dart/*.o newplus/_.a |> $(CXX) -o %o -shared $(OPT_FLAG) %f |> dart/libnewplus_extension.so
# d
: hello.d |> dmd -betterC -c %f -odd -O -release |> d/%B.o
: d/*.o | $(DEPS) |> dmd -betterC %f -of%o -L-Lnewplus -L-lnewplus -L-rpath=$(RPATH_NEWPLUS) -O -release |> d_hello
# d ldc2
: hello.d |> ldc2 -betterC -c %f -odd_ldc2 -O -release |> d_ldc2/%B.o
: d_ldc2/*.o | $(DEPS) |> ldc2 -betterC %f -of%o -L-Lnewplus -L-lnewplus -L-rpath=$(RPATH_NEWPLUS) -O -release |> d_ldc2_hello
# haskell
: hello.hs | $(DEPS) |> /opt/ghc/bin/ghc -O2 -Lnewplus -lnewplus -optl-Wl,-rpath,$(RPATH_NEWPLUS) -o ghc_hello %f |> ghc_hello hello.hi hello.o
# node
: foreach node/*.cpp |> $(CXX) -c %f -o %o $(NODE_CXX_FLAGS) $(NODE_GYP_FLAGS) -I. |> node/%B.o
: node/*.o newplus/_.a |> $(CXX) -o %o -shared $(OPT_FLAG) -Wl,-soname=%o %f |> newplus.node
# wren
: foreach wren/*.c |> $(CC) -c %f -o %o $(CFLAGS) -I. -Iwren/include |> wren/%B.o
LINK_FLAGS += -lm
: wren/*.o wren/*.a | $(DEPS) |> !cc_exe |> wren_hello