-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
104 lines (93 loc) · 1.92 KB
/
build.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
92
93
94
95
96
97
98
99
100
101
102
103
104
CFLAGS="-g -Wall -std=c++11"
BASEFILES="fileparse.cpp cmdparse.cpp main.cpp Language.cpp general.cpp"
PARSERFILES="Parser.cpp ParserIO.cpp ParseException.cpp ParseElement.cpp ParseGroup.cpp ParseList.cpp ParseDef.cpp ParseNounGroup.cpp ParseBasicVerb.cpp ParseObject.cpp ParseSubject.cpp ParseObjList.cpp ParseNoun.cpp ParseAdjective.cpp ParseIt.cpp ParseExtVerb.cpp ParseSentenceType.cpp ParseClause.cpp ParseProperties.cpp ParseTest.cpp "
DEFILES="de.cpp de_nouns.cpp de_articles.cpp de_numerals.cpp de_verbs.cpp de_prepos.cpp de_adjectives.cpp de_conjunctions.cpp"
ENFILES="en.cpp en_nouns.cpp en_articles.cpp en_numerals.cpp en_verbs.cpp en_prepos.cpp en_adjectives.cpp en_conjunctions.cpp en_passiveverbs.cpp"
EOFILES="eo.cpp eo_nouns.cpp eo_articles.cpp eo_numerals.cpp eo_verbs.cpp eo_prepos.cpp eo_adjectives.cpp eo_conjunctions.cpp"
FILEPREFIX="../source/"
base()
{
echo
echo "Compiling base..."
echo
for file in $BASEFILES
do
echo $file
g++ $CFLAGS -c "${FILEPREFIX}$file"
done
}
parser()
{
echo
echo "Compiling parser..."
echo
for file in $PARSERFILES
do
echo $file
g++ $CFLAGS -c "${FILEPREFIX}parser/$file"
done
}
eo()
{
echo
echo "Compiling eo..."
echo
for file in $EOFILES
do
echo $file
g++ $CFLAGS -c "${FILEPREFIX}eo/$file"
done
}
en()
{
echo
echo "Compiling en..."
echo
for file in $ENFILES
do
echo $file
g++ $CFLAGS -c "${FILEPREFIX}en/$file"
done
}
de()
{
echo
echo "Compiling de..."
echo
for file in $DEFILES
do
echo $file
g++ $CFLAGS -c "${FILEPREFIX}de/$file"
done
}
clean()
{
echo
echo "Cleaning up..."
echo
rm *.o
}
echo "Creating settings.h file"
cat source/settings.template > source/settings.h
echo "#define DICTIONARY \"$(pwd)/lang/\"" >> source/settings.h
mkdir -p build
cd build
PART=$1
if [[ -z "$PART" ]]
then
base
parser
en
de
eo
else
$PART
fi
if [[ "$PART" != "clean" ]]
then
echo
echo "Linking..."
echo
g++ -o compoglot *.o
cp compoglot ../examples/
fi