1 #!/bin/bash
2 #############################################################
3 # @file build_all.sh
4 #
5 # @brief TIMAC 2.0 Build All script
6 #
7 # This shell script will "build the world" everything in order.
8 # It accepts a few parameters, examples:
9 #
10 # bash$ sh ./build_all.sh <- defaults to host build
11 # bash$ sh ./build_all.sh host <- host only
12 # bash$ sh ./build_all.sh bbb <- bbb target
13 # bash$ sh ./build_all.sh clean <- erases everything
14 # bash$ sh ./build_all.sh remake <- 'clean' and then 'all'
15 #
16 # Group: WCS LPC
17 # $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
18 #
19 #############################################################
20 # $License: BSD3 2016 $
21 #
22 # Copyright (c) 2015, Texas Instruments Incorporated
23 # All rights reserved.
24 #
25 # Redistribution and use in source and binary forms, with or without
26 # modification, are permitted provided that the following conditions
27 # are met:
28 #
29 # * Redistributions of source code must retain the above copyright
30 # notice, this list of conditions and the following disclaimer.
31 #
32 # * Redistributions in binary form must reproduce the above copyright
33 # notice, this list of conditions and the following disclaimer in the
34 # documentation and/or other materials provided with the distribution.
35 #
36 # * Neither the name of Texas Instruments Incorporated nor the names of
37 # its contributors may be used to endorse or promote products derived
38 # from this software without specific prior written permission.
39 #
40 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
41 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
42 # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
44 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
45 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
46 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
47 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
48 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
49 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
50 # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51 #############################################################
52 # $Release Name: TI-15.4Stack Linux x64 SDK$
53 # $Release Date: July 14, 2016 (2.00.00.30)$
54 #############################################################
57 function usage()
58 {
59 echo "usage $0 TARGET"
60 echo ""
61 echo "Where TARGET is one of: host, bbb"
62 echo ""
63 echo "The BBB options require appropriate tools"
64 echo "be made in `pwd`/scripts/front_matter.mak"
65 echo "And in `pwd`/example/cc13xx-sbl/app/linux/Makefile"
66 echo ""
67 }
69 case $# in
70 0)
71 target=host
72 ;;
73 1)
74 target=$1
75 ;;
76 *)
77 echo "Wrong number of parameters, $#"
78 usage
79 exit 1
80 ;;
81 esac
83 case $target in
84 clean)
85 # ok
86 ;;
87 host)
88 # ok
89 ;;
90 bbb)
91 # ok
92 ;;
93 klockwork)
94 # ok
95 ;;
96 remake)
97 # ok
98 ;;
99 *)
100 echo "Unknown target: $target"
101 usage
102 exit 1
103 esac
105 # this is a simple script...
106 # We die/exit if there was a problem
107 set -e
109 script -e -f -c "cd components/common && make $target" $target.common.log
111 script -e -f -c "cd components/nv && make $target" $target.nv.log
113 script -e -f -c "cd components/api && make $target" $target.api.log
115 script -e -f -c "cd example/npi_server2 && make $target" $target.npi_server2.log
117 script -e -f -c "cd example/collector && make $target" $target.collector.log
119 script -e -f -c "cd example/cc13xx-sbl/app/linux && make $target" $target.bootloader.log
121 # ========================================
122 # Texas Instruments Micro Controller Style
123 # ========================================
124 # Local Variables:
125 # mode: sh
126 # End:
127 # vim:set filetype=sh