-
Notifications
You must be signed in to change notification settings - Fork 39
/
rules.txt
83 lines (78 loc) · 2.59 KB
/
rules.txt
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
env("TOPDIR","=",path.dirname($("BUILD_FILE")));
env("BUILD","?=",path.basename(process.cwd()).split('-')[0]);
var BUILD=$("BUILD");
if(BUILD=="w32"){
env("CROSS_COMPILE=i686-w64-mingw32-");
env("CFLAGS+=-D_UNICODE -DUNICODE -march=i686");
env("LDFLAGS+=-static-libgcc");
env("EXE=.exe");
env("DESTDIR=$(TOPDIR)/winim/yong");
env("CC=$(CROSS_COMPILE)gcc");
env("CXX=$(CROSS_COMPILE)g++");
}else if(BUILD=="l32"){
env("LDFLAGS+=-Wl,--hash-style=sysv -m32");
env("EXE=");
env("DESTDIR=.");
//env("CC=$(CROSS_COMPILE)gcc -m32 -march=i686");
//env("CXX=$(CROSS_COMPILE)g++ -m32");
env("CC=clang -m32");
env("CXX=clang++ -m32");
env("PICFLAGS=-fPIC");
if(os.platform()=='linux')
env("CFLAGS+=-D_GNU_SOURCE");
process.env.PKG_CONFIG_PATH="/usr/lib/pkgconfig";
}else if(BUILD=="w64"){
env("CROSS_COMPILE=x86_64-w64-mingw32-");
env("CFLAGS+=-D_UNICODE -DUNICODE -Wno-return-local-addr");
env("LDFLAGS+=-static-libgcc");
env("EXE=.exe");
env("DESTDIR=$(TOPDIR)/winim/yong/w64");
env("CC=$(CROSS_COMPILE)gcc");
env("CXX=$(CROSS_COMPILE)g++");
}else if(BUILD=="l64"){
env("LDFLAGS+=-Wl,--hash-style=sysv");
env("EXE=");
env("DESTDIR=.");
//env("CC=$(CROSS_COMPILE)gcc");
//env("CXX=$(CROSS_COMPILE)g++");
env("CC=clang -m64");
env("CXX=clang++ -m64");
env("PICFLAGS=-fPIC");
if(os.platform()=='linux')
env("CFLAGS+=-D_GNU_SOURCE");
process.env.PKG_CONFIG_PATH="/usr/lib64/pkgconfig";
}else if(BUILD=="js"){
env("LDFLAGS+=-m32");
env("EXE=.bin");
env("DESTDIR=.");
env("CROSS_COMPILE=/home/dgod/git/emsdk/upstream/emscripten/");
env("LDFLAGS+=-Wno-emcc");
env("CC:=$(CROSS_COMPILE)emcc");
env("CFLAGS+=-Wno-invalid-source-encoding");
env('CFLAGS+=-sSUPPORT_LONGJMP=wasm');
env('LDFLAGS+=-sSUPPORT_LONGJMP=wasm');
}else if(BUILD=="loongson"){
env("CFLAGS+=-march=mips64r2 -mabi=64");
env("EXE=");
env("DESTDIR=.");
env('CROSS_COMPILE=mips64el-unknown-linux-gnu-');
env("CC=$(CROSS_COMPILE)gcc");
env("AR=ar cr");
}
env("VPATH+=$(TOPDIR)/common");
env("AR?=$(CROSS_COMPILE)ar cr");
env("RANLIB:=$(CROSS_COMPILE)ranlib");
env("WINDRES:=$(CROSS_COMPILE)windres");
env("STRIP=$(CROSS_COMPILE)strip");
env("DLLTOOL:=$(CROSS_COMPILE)dlltool");
env("CFLAGS+=-Wall -g -O2 -fno-plt -fno-strict-aliasing -Wno-format-truncation -fms-extensions -pipe -ffast-math -I$(TOPDIR)/include -I$(TOPDIR)/common");
if($('CC').includes('clang')){
env('CFLAGS+=-Wno-invalid-source-encoding');
env('CFLAGS+= -Wno-microsoft-anon-tag');
}
if(BUILD=='js')
env("CFLAGS+=-Wno-microsoft-anon-tag");
env("LLIB_PATH:=$(TOPDIR)/llib");
env("LLIB_CFLAGS:=-I$(LLIB_PATH)");
env("LLIB_LDFLAGS:=-L$(LLIB_PATH)/$(BUILD)");
env("LLIB_LDADD:=-ll");