blob: 99db2b0e6e7fd9d6d44af4f2a4ad28f659b70d78 [file] [log] [blame]
Dylan Reid2470f8c2018-04-25 09:48:39 -07001#!/bin/bash
2
Liam Girdwood58a99d62017-06-06 10:45:07 +01003# fail on any errors
4set -e
5
6# run autogen.sh
7./autogen.sh
8
Liam Girdwood8855ce52016-10-18 17:18:16 +01009pwd=`pwd`
10
Pierre-Louis Bossartb9880a52018-04-03 12:57:53 -050011# make sure rimage is built and aligned with code
12./configure --enable-rimage
13make
14sudo make install
15
16# now build the firmware (depends on rimage)
Liam Girdwood8855ce52016-10-18 17:18:16 +010017rm -fr src/arch/xtensa/*.ri
Liam Girdwoodc0dfb4e2016-09-21 15:57:22 +010018
Ranjani Sridharanb5ca5c42018-02-26 09:17:32 -080019SUPPORTED_PLATFORMS=(byt cht bdw hsw apl cnl)
Liam Girdwoodc0dfb4e2016-09-21 15:57:22 +010020
Ranjani Sridharanb5ca5c42018-02-26 09:17:32 -080021# build all images for chosen targets
22if [ "$#" -eq 0 ]
23then
24 PLATFORMS=${SUPPORTED_PLATFORMS[@]}
25else
26 PLATFORMS=$@
27fi
Liam Girdwoodc0dfb4e2016-09-21 15:57:22 +010028
Ranjani Sridharanb5ca5c42018-02-26 09:17:32 -080029for i in ${PLATFORMS[@]}
30do
31 for j in ${SUPPORTED_PLATFORMS[@]}
32 do
33 if [ $j == $i ]
34 then
35 if [ $j == "byt" ]
36 then
37 PLATFORM="baytrail"
38 ROOT="xtensa-byt-elf"
39 fi
40 if [ $j == "cht" ]
41 then
42 PLATFORM="cherrytrail"
43 ROOT="xtensa-byt-elf"
44 fi
45 if [ $j == "bdw" ]
46 then
47 PLATFORM="broadwell"
48 ROOT="xtensa-hsw-elf"
49 fi
50 if [ $j == "hsw" ]
51 then
52 PLATFORM="haswell"
53 ROOT="xtensa-hsw-elf"
54 fi
55 if [ $j == "apl" ]
56 then
57 PLATFORM="apollolake"
58 ROOT="xtensa-bxt-elf"
59 fi
60 if [ $j == "cnl" ]
61 then
62 PLATFORM="cannonlake"
63 ROOT="xtensa-cnl-elf"
64 fi
Pierre-Louis Bossartf7471ab2018-04-03 08:57:16 -050065 PATH=$pwd/../xtensa-root/$ROOT/bin:$PATH
Ranjani Sridharanb5ca5c42018-02-26 09:17:32 -080066 ./configure --with-arch=xtensa --with-platform=$PLATFORM --with-root-dir=$pwd/../xtensa-root/$ROOT --host=$ROOT
67 make clean
68 make
69 make bin
70 fi
71 done
72done
Liam Girdwoodf198ad92018-01-21 23:48:35 +000073
Liam Girdwood8855ce52016-10-18 17:18:16 +010074# list all the images
75ls -l src/arch/xtensa/*.ri