-
Notifications
You must be signed in to change notification settings - Fork 1
/
Bootstrap.sh
executable file
·91 lines (83 loc) · 1.75 KB
/
Bootstrap.sh
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
#!/bin/sh
# Bootstrap utility for Ham
CXX=${CXX-g++}
LD=${LD-$CXX}
CXXFLAGS="-std=c++0x $CXXFLAGS"
run_command()
{
echo "$1" && $1
if [ $? -ne 0 ]; then exit 1; fi
}
compile()
{
SOURCES=$1
LOCAL_CXXFLAGS="$CXXFLAGS $2"
LINKFLAGS=$3
LINKCMD="$LD $LINKFLAGS"
for file in $SOURCES; do
LINKCMD="$LINKCMD generated/$(basename $file).o"
outfile=generated/$(basename $file).o
if [ ! -f $outfile ] || [ src/$file -nt $outfile ]; then
run_command "$CXX src/$file -c -o $outfile $LOCAL_CXXFLAGS"
fi
done
run_command "$LINKCMD"
}
# Create build directory
mkdir -p generated
# Build ham
HAM_SRCS="code/ActionsDefinition.cpp
code/Assignment.cpp
behavior/Behavior.cpp
code/BinaryExpression.cpp
code/Block.cpp
code/BuiltInRules.cpp
code/Case.cpp
code/Constant.cpp
code/DumpContext.cpp
code/EvaluationContext.cpp
code/If.cpp
code/Include.cpp
code/Jambase.cpp
code/For.cpp
code/FunctionCall.cpp
code/InListExpression.cpp
code/Jump.cpp
code/Leaf.cpp
code/List.cpp
code/LocalVariableDeclaration.cpp
code/Node.cpp
code/NotExpression.cpp
code/OnExpression.cpp
code/RuleDefinition.cpp
code/RuleInstructions.cpp
code/UserRuleInstructions.cpp
code/Switch.cpp
code/While.cpp
data/FileStatus.cpp
data/Path.cpp
data/RegExp.cpp
data/RuleActions.cpp
data/String.cpp
data/StringList.cpp
data/StringListOperations.cpp
data/Target.cpp
data/TargetBinder.cpp
data/TargetPool.cpp
data/Time.cpp
data/VariableScope.cpp
make/Command.cpp
make/MakeTarget.cpp
make/Options.cpp
make/Processor.cpp
make/TargetBuilder.cpp
make/TargetBuildInfo.cpp
parser/Parser.cpp
platform/unix/PlatformProcessDelegate.cpp
process/Process.cpp
util/Constants.cpp
util/OptionIterator.cpp
util/Referenceable.cpp
ham.cpp
"
compile "$HAM_SRCS" "-iquotesrc" "-o generated/ham"