forked from ryanfleury/metadesk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·58 lines (50 loc) · 1.62 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
#!/bin/bash
CC=clang
# NOTE(mal): Silent pushd/popd
pushd () {
command pushd "$@" > /dev/null
}
popd () {
command popd "$@" > /dev/null
}
echo ~~~ Metadesk Build ~~~
# TODO(mal): Review these warnings
accepted_clang_warnings="-Wno-deprecated-declarations -Wno-pointer-sign -Wno-writable-strings -Wno-unknown-warning-option"
compile_flags="-I../source/ $accepted_clang_warnings"
mkdir -p build
pushd build
echo
echo ~~~ Build All Samples ~~~
$CC $compile_flags ../samples/old_style_custom_layer.c -o old_style_custom_layer
$CC $compile_flags ../samples/static_site_generator/static_site_generator.c -o static_site_generator
$CC $compile_flags ../samples/output_parse/output_parse.c -o output_parse
$CC $compile_flags ../samples/c_code_generation.c -o c_code_generation
echo
echo ~~~ Build All Tests ~~~
$CC $compile_flags ../tests/sanity_tests.c -o sanity_tests
$CC $compile_flags ../tests/unicode_test.c -o unicode_test
clang++ $compile_flags ../tests/cpp_build_test.cpp
$CC $compile_flags ../tests/grammar.c -o grammar
popd
echo
echo ~~~ Running Sanity Tests ~~~
pushd build
./sanity_tests
popd
echo
echo ~~~ Running Static Site Generator Sample ~~~
mkdir -p samples/static_site_generator/example_site/generated
pushd samples/static_site_generator/example_site/generated
../../../../build/static_site_generator --siteinfo ../site_info.md --pagedir ../
popd
echo
echo ~~~ Running Output Parse Sample ~~~
mkdir -p samples/output_parse/examples/output
pushd samples/output_parse/examples/output
../../../../build/output_parse ../example.md ../example2.md
popd
echo
echo ~~~ Running C Code Generation Sample ~~~
pushd build
./c_code_generation
popd