summaryrefslogtreecommitdiffstats
path: root/recipes-ti/ipc/ti-ipc-examples_git.bb
blob: 34735d290c82406cc20c41ff6dbe90152148f460 (plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
DESCRIPTION = "TI Inter Process Communication (IPC) examples"
HOMEPAGE = "http://processors.wiki.ti.com/index.php/Category:IPC"
require ti-ipc-common.inc
require ti-ipc-rtos.inc

LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://${S_ipc-examples}/src/makefile;beginline=1;endline=30;md5=fb83580b16bce88e8ed568a6005c8f02"

DEPENDS = "ti-ipc ti-xdctools ti-sysbios ti-ipc-rtos zip-native"

INSANE_SKIP_${PN} += "arch"

ALLOW_EMPTY_${PN} = "1"

PACKAGES =+ "${PN}-linux"

INSANE_SKIP_${PN}-linux += "arch"
ALLOW_EMPTY_${PN}-linux = "1"

IPC_INSTALL_DIR = "${STAGING_DIR_TARGET}/usr/share/ti/ti-ipc-tree"

do_compile() {

  cd ${S_ipc-examples}/src
  oe_runmake .examples \
    IPCTOOLS="${S_ipc-metadata}/src/etc"

  if [ ! -z ${ALT_PLATFORM} ]; then
    oe_runmake .examples "PLATFORM=${ALT_PLATFORM}" \
      IPCTOOLS="${S_ipc-metadata}/src/etc"
	echo test
  fi
  if [  "${PLATFORM}" != "UNKNOWN" ]; then
    oe_runmake extract HOSTOS="bios" IPC_INSTALL_DIR="${IPC_INSTALL_DIR}"
    oe_runmake extract HOSTOS="linux" IPC_INSTALL_DIR="${IPC_INSTALL_DIR}"

    if [ ! -z ${ALT_PLATFORM} ]; then
      oe_runmake extract PLATFORM="${ALT_PLATFORM}" HOSTOS="bios" \
         IPC_INSTALL_DIR="${IPC_INSTALL_DIR}"
      oe_runmake extract PLATFORM="${ALT_PLATFORM}" HOSTOS="linux" \ 
        IPC_INSTALL_DIR="${IPC_INSTALL_DIR}"
    fi
    oe_runmake -C examples all HOSTOS="bios" \
      IPC_INSTALL_DIR="${IPC_INSTALL_DIR}" 
    oe_runmake -C examples all HOSTOS="linux" \
      LINUX_SYSROOT_DIR="${STAGING_INCDIR}" \
      IPC_INSTALL_DIR="${IPC_INSTALL_DIR}" 
    if [ ! -z ${ALT_PLATFORM} ]; then
      oe_runmake -C examples all HOSTOS="bios" \
        IPC_INSTALL_DIR="${IPC_INSTALL_DIR}" PLATFORM="${ALT_PLATFORM}" 
      oe_runmake -C examples all HOSTOS="linux" \
        LINUX_SYSROOT_DIR="${STAGING_INCDIR}" \
        IPC_INSTALL_DIR="${IPC_INSTALL_DIR}" \
        PLATFORM="${ALT_PLATFORM}" 
      echo testing
    fi
  fi
}

do_install() {
  cd ${S_ipc-examples}/src
  IPC_VERSION=`echo ${PV}${RELEASE_SUFFIX} | sed -e 's|\.|_|g'`

  if [  "${PLATFORM}" != "UNKNOWN" ]; then
    # Install directory for bios examples
    install -d ${D}/ipc_${IPC_VERSION}/examples/bios
    # Install directory for linux examples
    install -d ${D}${bindir}/ipc/examples
    oe_runmake -C examples install IPC_INSTALL_DIR="${IPC_INSTALL_DIR}" \
      HOSTOS="bios" EXEC_DIR="${D}/ipc_${IPC_VERSION}/examples/bios"
    oe_runmake -C examples install_rov IPC_INSTALL_DIR="${IPC_INSTALL_DIR}" \
      HOSTOS="bios" EXEC_DIR="${D}/ipc_${IPC_VERSION}/examples/bios"

    oe_runmake -C examples install IPC_INSTALL_DIR="${IPC_INSTALL_DIR}" \
      LINUX_SYSROOT_DIR="${STAGING_INCDIR}" \
      HOSTOS="linux" EXEC_DIR="${D}/${bindir}/ipc/examples"

    if [ ! -z ${ALT_PLATFORM} ]; then
      oe_runmake -C examples install IPC_INSTALL_DIR="${IPC_INSTALL_DIR}" \
        HOSTOS="bios" EXEC_DIR="${D}/ipc_${IPC_VERSION}/examples/bios" \
        PLATFORM="${ALT_PLATFORM}"
      oe_runmake -C examples install_rov IPC_INSTALL_DIR="${IPC_INSTALL_DIR}" \
        HOSTOS="bios" EXEC_DIR="${D}/ipc_${IPC_VERSION}/examples/bios" \
        PLATFORM="${ALT_PLATFORM}"

      oe_runmake -C examples install IPC_INSTALL_DIR="${IPC_INSTALL_DIR}" \
        LINUX_SYSROOT_DIR="${STAGING_INCDIR}" \
        HOSTOS="linux" EXEC_DIR="${D}/${bindir}/ipc/examples" \
        PLATFORM="${ALT_PLATFORM}"
    fi
  fi
}

FILES_${PN} += "ipc_*"
FILES_${PN}-linux += "${bindir}/*"
INHIBIT_PACKAGE_STRIP = "1"