-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakesurefile
119 lines (86 loc) · 2.17 KB
/
Makesurefile
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@options timing
@define QJS_VERSION="2021-03-27"
@define QJS_HOME="soft/quickjs-$QJS_VERSION"
@goal prepared_for_build
@depends_on quickjs_installed build_folder_created
@goal built_for_prod
@depends_on prepared_for_build
echo "Compiling release build with $($QJS_HOME/qjsc | grep version)..."
cd build
# -fno-json \
# -fno-module-loader \
# -fno-regexp \
# -fno-eval \
../$QJS_HOME/qjsc \
-flto \
-fno-date \
-fno-proxy \
-fno-promise \
-fno-map \
-fno-typedarray \
-fno-string-normalize \
-fno-bigint \
-o jsqry ../jsqry-cli.js
ls -lh jsqry
@goal built_for_test
@depends_on prepared_for_build
echo "Compiling test build with $($QJS_HOME/qjsc | grep version)..."
cd build
../$QJS_HOME/qjsc -o jsqry ../jsqry-cli.js
ls -lh jsqry
@goal build_folder_created
@reached_if [[ -d "build" ]]
mkdir build
@goal soft_folder_created
@reached_if [[ -d "soft" ]]
mkdir soft
@goal tush_installed
@depends_on soft_folder_created
@reached_if [[ -f "soft/tush/bin/tush-check" ]]
echo
echo "Fetching tush..."
echo
cd "soft"
wget /~https://github.com/adolfopa/tush/archive/master.zip -O./tush.zip
unzip ./tush.zip
rm ./tush.zip
mv tush-master tush
@goal quickjs_installed
@depends_on soft_folder_created
@reached_if [[ -f "soft/quickjs-$QJS_VERSION/qjsc" ]]
echo
echo "Fetching QJS..."
echo
cd "soft"
QJS=quickjs-$QJS_VERSION
wget https://bellard.org/quickjs/$QJS.tar.xz
tar xvf ./$QJS.tar.xz
rm ./$QJS.tar.xz
echo
echo "Compile QJSC..."
echo
cd "$QJS"
make qjsc libquickjs.a libquickjs.lto.a
@goal soft_installed
@depends_on tush_installed quickjs_installed
@goal cleaned
@reached_if [[ ! -f "build/jsqry" ]]
rm "build/jsqry"
@goal cleaned_soft
@reached_if [[ ! -d "soft" ]]
rm -r "soft"
@goal cleaned_all
@depends_on cleaned cleaned_soft
@goal built
@depends_on built_for_prod tests_executed
@goal tested
@depends_on built_for_test tests_executed
@goal tests_executed
@depends_on tush_installed
export PATH="$MYDIR/build:$PATH:$MYDIR/soft/tush/bin"
tush-check tests.tush && echo 'TESTS PASSED' || (
echo '!!! TESTS FAILED !!!'
exit 1
)
@goal default
@depends_on built