-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-erlang.sh
More file actions
executable file
·56 lines (42 loc) · 739 Bytes
/
build-erlang.sh
File metadata and controls
executable file
·56 lines (42 loc) · 739 Bytes
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
#!/bin/bash
#
# I Love Iesus s2
#
clear
# Validation.
if [ "$#" -ne 1 ]; then
echo "Use: ./build-erlang.sh \"2 - basic arithmetic\""
exit 2
fi
if [ -d "$1" ]
then
echo "ErLang source: \"$1\""
else
echo "Directory not found: \"$1\""
exit 2
fi
# Build modules.
echo "Build modules..."
cd "0 - utils"
rm -rf *.beam
erl -compile utils.erl
erl -compile division.erl
cd "../1 - project/"
rm -rf *
cd "../0 - utils/"
mv *.beam "../1 - project/"
cp *.erl "../1 - project/"
cd ..
# Copy app files.
cd "$1"
cp -R * "../1 - project/"
cd ..
# Build app.
echo "Running..."
echo ""
cd "1 - project"
rm -rf *.ex
erl -compile app.erl
# erl -noshell -s app app -s init stop
erl -noshell -s app ihs -s init stop
rm -rf *