-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease-gcc.sh
63 lines (41 loc) · 1.39 KB
/
release-gcc.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
#!/bin/bash
source ./config.sh
OOP_DIRECTORY="$GCC_DIRECTORY"/"$OUTPUT_LIB_FILE_NAME"
cleanupAndPrepareDirectory() {
# Cleaup last release.
rm -f -r "$OOP_DIRECTORY" > /dev/null 2>&1
# Make sure there is an empty directory for the relaese.
mkdir -p "$OOP_DIRECTORY"
}
copyHeaderFilesAndStaticLibrary() {
cp "$OUTPUT_LIB_PATH"/"$OUTPUT_LIB_FILE_NAME.a" "$OOP_DIRECTORY"
cp "$OUTPUT_LIB_PATH"/"$OUTPUT_LIB_FILE_NAME.h" "$OOP_DIRECTORY"
for f in "$OUTPUT_LIB_PATH"/* ; do
if [ -d "$f" ]; then
# "$f" is a directory. Will not run if no directories are available.
directoryName=$(basename "$f")
# Create that directory in "$OOP_DIRECTORY".
mkdir -p "$OOP_DIRECTORY/$directoryName"
# Copy all header files from the directory.
cp "$f"/*.h "$OOP_DIRECTORY"/"$directoryName"
cp "$f"/*.r "$OOP_DIRECTORY"/"$directoryName"
fi
done
}
archiveStaticLibrary() {
local THIS_PATH=`pwd`
cd "$GCC_DIRECTORY"
tar -cf "$GCC_RELEASE_NAME" "$OUTPUT_LIB_FILE_NAME"
cd "$THIS_PATH"
}
# ---------------------------------- Code --------------------------------------
echo releasing gcc...
cleanupAndPrepareDirectory
# Build the static library.
./build-lib.sh
copyHeaderFilesAndStaticLibrary
# # Cleanup the static library build.
# ./cleanup.sh
archiveStaticLibrary
echo done.
exit