xref: /btstack/port/archive/pic32-harmony/app.X/nbproject/Package-default.bash (revision bfc39f3e53bffb178d46475fc3f3e00a92502490)
1*bfc39f3eSMatthias Ringwald#!/bin/bash -x
2*bfc39f3eSMatthias Ringwald
3*bfc39f3eSMatthias Ringwald#
4*bfc39f3eSMatthias Ringwald# Generated - do not edit!
5*bfc39f3eSMatthias Ringwald#
6*bfc39f3eSMatthias Ringwald
7*bfc39f3eSMatthias Ringwald# Macros
8*bfc39f3eSMatthias RingwaldTOP=`pwd`
9*bfc39f3eSMatthias RingwaldCND_CONF=default
10*bfc39f3eSMatthias RingwaldCND_DISTDIR=dist
11*bfc39f3eSMatthias RingwaldTMPDIR=build/${CND_CONF}/${IMAGE_TYPE}/tmp-packaging
12*bfc39f3eSMatthias RingwaldTMPDIRNAME=tmp-packaging
13*bfc39f3eSMatthias RingwaldOUTPUT_PATH=dist/${CND_CONF}/${IMAGE_TYPE}/app.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
14*bfc39f3eSMatthias RingwaldOUTPUT_BASENAME=app.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
15*bfc39f3eSMatthias RingwaldPACKAGE_TOP_DIR=app.x/
16*bfc39f3eSMatthias Ringwald
17*bfc39f3eSMatthias Ringwald# Functions
18*bfc39f3eSMatthias Ringwaldfunction checkReturnCode
19*bfc39f3eSMatthias Ringwald{
20*bfc39f3eSMatthias Ringwald    rc=$?
21*bfc39f3eSMatthias Ringwald    if [ $rc != 0 ]
22*bfc39f3eSMatthias Ringwald    then
23*bfc39f3eSMatthias Ringwald        exit $rc
24*bfc39f3eSMatthias Ringwald    fi
25*bfc39f3eSMatthias Ringwald}
26*bfc39f3eSMatthias Ringwaldfunction makeDirectory
27*bfc39f3eSMatthias Ringwald# $1 directory path
28*bfc39f3eSMatthias Ringwald# $2 permission (optional)
29*bfc39f3eSMatthias Ringwald{
30*bfc39f3eSMatthias Ringwald    mkdir -p "$1"
31*bfc39f3eSMatthias Ringwald    checkReturnCode
32*bfc39f3eSMatthias Ringwald    if [ "$2" != "" ]
33*bfc39f3eSMatthias Ringwald    then
34*bfc39f3eSMatthias Ringwald      chmod $2 "$1"
35*bfc39f3eSMatthias Ringwald      checkReturnCode
36*bfc39f3eSMatthias Ringwald    fi
37*bfc39f3eSMatthias Ringwald}
38*bfc39f3eSMatthias Ringwaldfunction copyFileToTmpDir
39*bfc39f3eSMatthias Ringwald# $1 from-file path
40*bfc39f3eSMatthias Ringwald# $2 to-file path
41*bfc39f3eSMatthias Ringwald# $3 permission
42*bfc39f3eSMatthias Ringwald{
43*bfc39f3eSMatthias Ringwald    cp "$1" "$2"
44*bfc39f3eSMatthias Ringwald    checkReturnCode
45*bfc39f3eSMatthias Ringwald    if [ "$3" != "" ]
46*bfc39f3eSMatthias Ringwald    then
47*bfc39f3eSMatthias Ringwald        chmod $3 "$2"
48*bfc39f3eSMatthias Ringwald        checkReturnCode
49*bfc39f3eSMatthias Ringwald    fi
50*bfc39f3eSMatthias Ringwald}
51*bfc39f3eSMatthias Ringwald
52*bfc39f3eSMatthias Ringwald# Setup
53*bfc39f3eSMatthias Ringwaldcd "${TOP}"
54*bfc39f3eSMatthias Ringwaldmkdir -p ${CND_DISTDIR}/${CND_CONF}/package
55*bfc39f3eSMatthias Ringwaldrm -rf ${TMPDIR}
56*bfc39f3eSMatthias Ringwaldmkdir -p ${TMPDIR}
57*bfc39f3eSMatthias Ringwald
58*bfc39f3eSMatthias Ringwald# Copy files and create directories and links
59*bfc39f3eSMatthias Ringwaldcd "${TOP}"
60*bfc39f3eSMatthias RingwaldmakeDirectory ${TMPDIR}/app.x/bin
61*bfc39f3eSMatthias RingwaldcopyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
62*bfc39f3eSMatthias Ringwald
63*bfc39f3eSMatthias Ringwald
64*bfc39f3eSMatthias Ringwald# Generate tar file
65*bfc39f3eSMatthias Ringwaldcd "${TOP}"
66*bfc39f3eSMatthias Ringwaldrm -f ${CND_DISTDIR}/${CND_CONF}/package/app.x.tar
67*bfc39f3eSMatthias Ringwaldcd ${TMPDIR}
68*bfc39f3eSMatthias Ringwaldtar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/package/app.x.tar *
69*bfc39f3eSMatthias RingwaldcheckReturnCode
70*bfc39f3eSMatthias Ringwald
71*bfc39f3eSMatthias Ringwald# Cleanup
72*bfc39f3eSMatthias Ringwaldcd "${TOP}"
73*bfc39f3eSMatthias Ringwaldrm -rf ${TMPDIR}
74