Statistics
| Branch: | Tag: | Revision:

mongoose / examples / PIC32 / mqtt_client / firmware / mqtt_client.X / nbproject / Package-mx795_CC3100_e16.bash @ eaef5bd1

History | View | Annotate | Download (1.37 KB)

1
#!/bin/bash -x
2

    
3
#
4
# Generated - do not edit!
5
#
6

    
7
# Macros
8
TOP=`pwd`
9
CND_CONF=mx795_CC3100_e16
10
CND_DISTDIR=dist
11
TMPDIR=build/${CND_CONF}/${IMAGE_TYPE}/tmp-packaging
12
TMPDIRNAME=tmp-packaging
13
OUTPUT_PATH=dist/${CND_CONF}/${IMAGE_TYPE}/mqtt_client.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
14
OUTPUT_BASENAME=mqtt_client.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
15
PACKAGE_TOP_DIR=mqttclient.x/
16

    
17
# Functions
18
function checkReturnCode
19
{
20
    rc=$?
21
    if [ $rc != 0 ]
22
    then
23
        exit $rc
24
    fi
25
}
26
function makeDirectory
27
# $1 directory path
28
# $2 permission (optional)
29
{
30
    mkdir -p "$1"
31
    checkReturnCode
32
    if [ "$2" != "" ]
33
    then
34
      chmod $2 "$1"
35
      checkReturnCode
36
    fi
37
}
38
function copyFileToTmpDir
39
# $1 from-file path
40
# $2 to-file path
41
# $3 permission
42
{
43
    cp "$1" "$2"
44
    checkReturnCode
45
    if [ "$3" != "" ]
46
    then
47
        chmod $3 "$2"
48
        checkReturnCode
49
    fi
50
}
51

    
52
# Setup
53
cd "${TOP}"
54
mkdir -p ${CND_DISTDIR}/${CND_CONF}/package
55
rm -rf ${TMPDIR}
56
mkdir -p ${TMPDIR}
57

    
58
# Copy files and create directories and links
59
cd "${TOP}"
60
makeDirectory ${TMPDIR}/mqttclient.x/bin
61
copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
62

    
63

    
64
# Generate tar file
65
cd "${TOP}"
66
rm -f ${CND_DISTDIR}/${CND_CONF}/package/mqttclient.x.tar
67
cd ${TMPDIR}
68
tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/package/mqttclient.x.tar *
69
checkReturnCode
70

    
71
# Cleanup
72
cd "${TOP}"
73
rm -rf ${TMPDIR}