(MOD) Added more steps for project building.
This commit is contained in:
47
preinstall
Executable file
47
preinstall
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "`whoami`" != "root" ]; then
|
||||
echo "The script require root privilege to execute properly."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# echo "Please ensure the current work directory is the home directory to the project Compound!
|
||||
# Press enter key to continue..."
|
||||
# read
|
||||
|
||||
SRC="$PWD"
|
||||
DST=/usr/include/Compound
|
||||
PROJ=("Array" "Paper" "Pen" "Render" "Status" "Var" "MemMan" "Stack" "Utils"\
|
||||
"String" "Object")
|
||||
|
||||
# Create directory.
|
||||
if [ ! -d "$DST" ]; then
|
||||
mkdir -pv "$DST"
|
||||
fi
|
||||
|
||||
# Install project-like headers.
|
||||
PROJLEN=${#PROJ[*]}
|
||||
echo "======== $PROJLEN projects in total ========"
|
||||
|
||||
idx=0
|
||||
while :; do
|
||||
if [[ $idx -eq $PROJLEN || $idx -gt $PROJLEN ]]; then
|
||||
break;
|
||||
fi
|
||||
|
||||
p="${PROJ[$idx]}"
|
||||
|
||||
cd "$p"
|
||||
echo "`date` >>> Installing $p"
|
||||
cp -v include/*.h "$DST"
|
||||
cd "$SRC"
|
||||
((idx++))
|
||||
echo
|
||||
done
|
||||
|
||||
# Install individual headers.
|
||||
cp -v "common.h" "const.h" "platform.h"\
|
||||
"name.h" "namescope.h" "type.h" "catlog.h"\
|
||||
"attr.h" "registry.h" "class.h" "function.h" "$DST"
|
||||
|
||||
printf "\nDone\n"
|
Reference in New Issue
Block a user