-
Notifications
You must be signed in to change notification settings - Fork 3
/
build_all.sh
executable file
·87 lines (69 loc) · 1.97 KB
/
build_all.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
#!/bin/bash
#
# Copyright Christopher Kormanyos 2024.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# ./build_all.sh --boost=/mnt/c/boost/boost_1_85_0 --my_cc=g++ --stdcc=c++14
boost=
gcc=g++
for arg in "$@"; do
case $arg in
--boost=*)
boost="${arg#*=}"
shift
;;
--my_cc=*)
my_cc="${arg#*=}"
shift
;;
--stdcc=*)
stdcc="${arg#*=}"
shift
;;
*)
;;
esac
done
echo "boost: $boost"
echo "my_cc: $my_cc"
echo "stdcc: $stdcc"
MY_BOOST_INC=-I$boost
MY_GCC=$my_cc
MY_STD=$stdcc
echo 'make the jpeg-6b library'
cd jpeg
make all
cd ..
echo
echo 'make the libpng-1.6.44.git-2024 library'
cd png/libpng
make all
cd ../..
echo
echo 'make the libzlib-1.3.1.1-2024 library'
cd png/zlib
make all
cd ../..
echo
echo 'verify existence of libs'
ls -la ./png/libpng/libpng-1.6.44.git-2024/obj/libpng16.a ./png/zlib/zlib-1.3.1.1-2024/obj/libz.a ./jpeg/jpeg-6b-2022/obj/libjpeg-6b.a
res_makelibs=$?
echo
echo 'compile test/test_mandelbrot.cpp to test_mandelbrot.o'
$MY_GCC -x c++ -c -finline-functions -march=native -mtune=native -O3 -Wall -Wextra -Wmissing-include-dirs -std=$MY_STD -I. -Ipng/zlib/zlib-1.3.1.1-2024 -Ipng/libpng/libpng-1.6.44.git-2024 -Ijpeg/jpeg-6b-2022 $MY_BOOST_INC -pthread test/test_mandelbrot.cpp -o test_mandelbrot.o
echo
echo 'link test_mandelbrot.o with libraries to create test_mandelbrot.exe'
$MY_GCC -x none -march=native -mtune=native test_mandelbrot.o ./png/libpng/libpng-1.6.44.git-2024/obj/libpng16.a ./png/zlib/zlib-1.3.1.1-2024/obj/libz.a ./jpeg/jpeg-6b-2022/obj/libjpeg-6b.a -lpthread -o test_mandelbrot.exe
echo
echo 'verify existence of test_mandelbrot.exe'
ls -la ./test_mandelbrot.exe
res_maketest=$?
echo
result_total=$((res_makelibs+res_maketest))
echo "res_makelibs : " "$res_makelibs"
echo "res_maketest : " "$res_maketest"
echo "result_total : " "$result_total"
echo
exit $result_total