-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmf_ex.sh
More file actions
executable file
·107 lines (84 loc) · 2.38 KB
/
Copy pathmf_ex.sh
File metadata and controls
executable file
·107 lines (84 loc) · 2.38 KB
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
105
106
107
#!/bin/sh
# Move file for use with mf, read more at https://github.com/greeenlaser/personal-stash/tree/main/mf
set -e
#
# References
#
case "$1" in
--linux)
OUT_NAME=KalaLua-Linux
LIB_NAME=libkalalua
LIB_EXT=a
LIB_ORIGIN=build/release-linux
;;
--windows-gnu)
OUT_NAME=KalaLua-Windows-Gnu
LIB_NAME=kalalua-gnu
LIB_EXT=lib
LIB_ORIGIN=build/release-windows-gnu
;;
--windows)
OUT_NAME=KalaLua-Windows
LIB_NAME=kalalua
LIB_EXT=lib
LIB_ORIGIN=build/release-windows
;;
*)
echo "Error: Argument must be --linux, --windows-gnu or --windows" >&2
exit 1
;;
esac
OUT_VER=1-1-0
OUT_DIR=out/${OUT_NAME}-${OUT_VER}
README=README.md
LICENSE=LICENSE.md
CHANGES=CHANGES.md
INCLUDE=include
DOCS=docs
DIR_ES=../external-shared
IN_KH=${DIR_ES}/KalaHeaders
OUT_KH_NAME=kalaheaders
# Lua
IN_LUA=${DIR_ES}/lua
OUT_LUA_NAME=lua
#
# Core stuff
#
# Always a fresh start
mkdir -p "out"
rm -rf "${OUT_DIR}"
mkdir "${OUT_DIR}"
mkdir "${OUT_DIR}/${OUT_KH_NAME}"
# The base files
mf --f "${README}" --t "${OUT_DIR}/${README}"
mf --f "${LICENSE}" --t "${OUT_DIR}/${LICENSE}"
mf --f "${CHANGES}" --t "${OUT_DIR}/${CHANGES}"
mf --f "${INCLUDE}" --t "${OUT_DIR}"
mf --f "${DOCS}" --t "${OUT_DIR}"
# The binary
if [ ! -f "${LIB_ORIGIN}/${LIB_NAME}.${LIB_EXT}" ]; then
printf 'Error: Binary %s not found\n' "${LIB_ORIGIN}/${LIB_NAME}.${LIB_EXT}" >&2
exit 1
fi
mf --f "${LIB_ORIGIN}/${LIB_NAME}.${LIB_EXT}" --t "${OUT_DIR}/${LIB_NAME}.${LIB_EXT}"
# KalaHeaders
mf --f "${IN_KH}/${README}" --t "${OUT_DIR}/${OUT_KH_NAME}/${README}"
mf --f "${IN_KH}/${LICENSE}" --t "${OUT_DIR}/${OUT_KH_NAME}/${LICENSE}"
mf --f "${IN_KH}/include" --t "${OUT_DIR}/${OUT_KH_NAME}"
# Lua
mkdir "${OUT_DIR}/${OUT_LUA_NAME}"
mf --f "${IN_LUA}/${README}" --t "${OUT_DIR}/${OUT_LUA_NAME}/${README}"
mf --f "${IN_LUA}/${LICENSE}" --t "${OUT_DIR}/${OUT_LUA_NAME}/${LICENSE}"
mf --f "${IN_LUA}/include" --t "${OUT_DIR}/${OUT_LUA_NAME}"
# Lua binary
case "$1" in
--linux)
mf --f "${IN_LUA}/release/liblua.a" --t "${OUT_DIR}/${OUT_LUA_NAME}/liblua.a"
;;
--windows-gnu)
mf --f "${IN_LUA}/release/lua-gnu.lib" --t "${OUT_DIR}/${OUT_LUA_NAME}/lua-gnu.lib"
;;
--windows)
mf --f "${IN_LUA}/release/lua.lib" --t "${OUT_DIR}/${OUT_LUA_NAME}/lua.lib"
;;
esac