File: install-lldb.sh

package info (click to toggle)
llvm-toolchain-4.0 1%3A4.0.1-10~deb9u2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 493,332 kB
  • sloc: cpp: 2,698,100; ansic: 552,773; asm: 128,821; python: 121,589; objc: 105,054; sh: 21,174; lisp: 6,758; ml: 5,532; perl: 5,311; pascal: 5,245; makefile: 2,083; cs: 1,868; xml: 686; php: 212; csh: 117
file content (59 lines) | stat: -rwxr-xr-x 1,923 bytes parent folder | download | duplicates (15)
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
#!/bin/sh


# This script will install the files from a "Debug" or "Release" build
# directory into the developer folder specified.

NUM_EXPECTED_ARGS=2

PROGRAM=`basename $0`

if [ $# -ne $NUM_EXPECTED_ARGS ]; then
	echo This script will install the files from a 'Debug' or 'Release' build directory into the developer folder specified.
	echo "usage: $PROGRAM <BUILD_DIR> <DEVELOPER_DIR>";
	echo "example: $PROGRAM ./Debug /Developer"
	echo "example: $PROGRAM /build/Release /Xcode4"
	exit 1;
fi

BUILD_DIR=$1
DEVELOPER_DIR=$2

if [ -d $BUILD_DIR ]; then
	if [ -d $DEVELOPER_DIR ]; then
		if [ -e "$BUILD_DIR/debugserver" ]; then
			echo Updating "$DEVELOPER_DIR/usr/bin/debugserver"
			sudo rm -rf "$DEVELOPER_DIR/usr/bin/debugserver"
			sudo cp "$BUILD_DIR/debugserver" "$DEVELOPER_DIR/usr/bin/debugserver"
		fi

		if [ -e "$BUILD_DIR/lldb" ]; then
			echo Updating "$DEVELOPER_DIR/usr/bin/lldb"
			sudo rm -rf "$DEVELOPER_DIR/usr/bin/lldb"
			sudo cp "$BUILD_DIR/lldb" "$DEVELOPER_DIR/usr/bin/lldb"
		fi

		if [ -e "$BUILD_DIR/libEnhancedDisassembly.dylib" ]; then
			echo Updating "$DEVELOPER_DIR/usr/lib/libEnhancedDisassembly.dylib"
			sudo rm -rf "$DEVELOPER_DIR/usr/lib/libEnhancedDisassembly.dylib"
			sudo cp "$BUILD_DIR/libEnhancedDisassembly.dylib" "$DEVELOPER_DIR/usr/lib/libEnhancedDisassembly.dylib"
		fi

		if [ -d "$BUILD_DIR/LLDB.framework" ]; then
			echo Updating "$DEVELOPER_DIR/Library/PrivateFrameworks/LLDB.framework"
			sudo rm -rf "$DEVELOPER_DIR/Library/PrivateFrameworks/LLDB.framework"
			sudo cp -r "$BUILD_DIR/LLDB.framework" "$DEVELOPER_DIR/Library/PrivateFrameworks/LLDB.framework"
		elif [ -e "$BUILD_DIR/LLDB.framework" ]; then
			echo BUILD_DIR path to LLDB.framework is not a directory: "$BUILD_DIR/LLDB.framework"
			exit 2;			
		fi
	
	else
		echo DEVELOPER_DIR must be a directory: "$DEVELOPER_DIR"
		exit 3;	
	fi

else
	echo BUILD_DIR must be a directory: "$BUILD_DIR"
	exit 4;	
fi