aboutsummaryrefslogtreecommitdiff
path: root/scripts/copy.sh
blob: 508ed56afef911f77ac0eb000481aa172b2ffd00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

STAGING_DIR=$1
TARGET_DIR=$2

echo "Copying development files to target..."

cp -af ${STAGING_DIR}/usr/include ${TARGET_DIR}/usr

for LIBSDIR in /lib /usr/lib; do
	for WILDCARD in *.a *.la; do
		for FILE_PATH in `find ${STAGING_DIR}${LIBSDIR} -name ${WILDCARD}`; do
			STAGING_STRIPPED=${FILE_PATH##${STAGING_DIR}}
			EXTENDED_DIR=${STAGING_STRIPPED%/${WILDCARD}}
			mkdir -p ${TARGET_DIR}${EXTENDED_DIR}
			cp -fa ${FILE_PATH} ${TARGET_DIR}${STAGING_STRIPPED}
			#echo ${TARGET_DIR}${STAGING_STRIPPED}
		done
	done
done