forked from eriksvedang/cakelisp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.sh
executable file
·42 lines (39 loc) · 1.29 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
#!/bin/sh
CAKELISP_BOOTSTRAP_BIN=bin/cakelisp_bootstrap_v2
CC=g++
LINK=g++
# Note: If you make changes to the bootstrap process, you will need to delete
# $CAKELISP_BOOTSTRAP_BIN so that it is updated
if test -f "$CAKELISP_BOOTSTRAP_BIN"; then
echo "$CAKELISP_BOOTSTRAP_BIN exists. Building using Cakelisp"
$CAKELISP_BOOTSTRAP_BIN Bootstrap.cake || exit $?
echo "Use ./bin/cakelisp to build your files"
else
echo "$CAKELISP_BOOTSTRAP_BIN does not exist. Building bootstrap executable manually"
mkdir -p bin
$CC -c \
src/Tokenizer.cpp \
src/Evaluator.cpp \
src/Utilities.cpp \
src/FileUtilities.cpp \
src/Converters.cpp \
src/Writer.cpp \
src/Generators.cpp \
src/GeneratorHelpers.cpp \
src/RunProcess.cpp \
src/OutputPreambles.cpp \
src/DynamicLoader.cpp \
src/ModuleManager.cpp \
src/Logging.cpp \
src/Build.cpp \
src/Metadata.cpp \
src/Main.cpp \
-DUNIX || exit $?
# Need -ldl for dynamic loading, --export-dynamic to let compile-time functions resolve to
# Cakelisp symbols
$LINK -o $CAKELISP_BOOTSTRAP_BIN *.o -ldl -Wl,--export-dynamic || exit $?
rm *.o
echo "Built $CAKELISP_BOOTSTRAP_BIN successfully. Now building with Cakelisp"
$CAKELISP_BOOTSTRAP_BIN Bootstrap.cake || exit $?
echo "Cakelisp successfully bootstrapped. Use ./bin/cakelisp to build your files"
fi