-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathupdate-all.sh
executable file
·58 lines (41 loc) · 1.48 KB
/
update-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
#!/bin/bash
#
# @file update-all.sh
# update all shttpd binary files for end users.
#
# @author: [email protected]
#
# @create: 2020-07-05
# @update: 2020-07-05
########################################################################
_file=$(readlink -f $0)
_cdir=$(dirname $_file)
_name=$(basename $_file)
_ver=1.0.0
# Treat unset variables as an error (set -u / +u)
set -o nounset
# Treat any error as exit (set -e / +e)
set -o errexit
################################################################
bindir=$_cdir/libshttpd
rm -rf $bindir
mkdir -p $bindir/bin/{x64,Win32}
mkdir -p $bindir/include/shttpd
mkdir -p $bindir/lib/{x64,Win32}
libtarget=$_cdir/msvc/libshttpd/target
binexample=$_cdir/msvc/example/target
binshttpd=$_cdir/msvc/shttpd/target
echo "[1] update libshttpd lib: $libtarget => $bindir/lib"
cp -r $libtarget/x64/Debug $bindir/lib/x64/
cp -r $libtarget/x64/Release/ $bindir/lib/x64/
cp -r $libtarget/Win32/Debug $bindir/lib/Win32/
cp -r $libtarget/Win32/Release/ $bindir/lib/Win32/
echo "[2] update example bin: $binexample => $bindir/bin"
cp $binexample/x64/Release/example.exe $bindir/bin/x64/
cp $binexample/Win32/Release/example.exe $bindir/bin/Win32/
echo "[3] update shttpd bin: $binshttpd => $bindir"
cp $binshttpd/x64/Release/shttpd.exe $bindir/bin/x64/
cp $binshttpd/Win32/Release/shttpd.exe $bindir/bin/Win32/
echo "[4] update libshttpd include: $_cdir/src => $bindir/include"
cp $_cdir/src/shttpd.h $bindir/include/shttpd/
echo "Update all files success: $bindir"