-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildcsrc
executable file
·42 lines (35 loc) · 1 KB
/
buildcsrc
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
#!/bin/bash
src="src"
csrc="../lib"
inc="../include"
cd $src
opts=("c")
#opts+=("-c" "--nimcache:$csrc" "--genScript" "--header")
opts+=("--noLinking" "--nimcache:$csrc" "--genScript")
opts+=("--noMain")
opts+=("--listCmd")
opts+=("-d:danger")
#opts+=("--app:staticlib")
opts+=("--app:lib")
opts+=("--threads:on")
#opts="$opts --app:lib"
#opts+=("--gcc.options.always:-g -Wall")
#opts="$opts --gcc.options.always:$gccopts"
#opts="$opts --gcc.options.always:-Wall -Wno-unused-but-set-variable"
#opts="$opts -d:nimLinkerWeakSymbols"
#opts+=("--os:any" "--gc:arc" "-d:useMalloc")
opts+=("--gc:arc" "-d:useMalloc")
#opts+=("-d:useMalloc")
#opts+=("--gc:markAndSweep")
echo nim "${opts[@]}" qioc.nim
nim "${opts[@]}" qioc.nim
if [ ! -e $inc ]; then
mkdir $inc
fi
mv qio.h $inc
nim=`cat $csrc/compile_libqioc.sh |tr ' ' '\n' |grep '^-I' |head -n1 |sed 's/-I//'`
echo $nim
cp -a $nim/nimbase.h $csrc
#objs=`cat $csrc/compile_libqioc.sh |tr ' ' '\n' |grep '\.c$' |sed 's/\.c$/.o/'`
#echo $objs
python3 ../getobjs.py $csrc