873fb7490c17739a1d58ad8703a5670cd6011e6c
[carl9170fw.git] / autogen.sh
1 #!/bin/bash
2
3 set -e
4
5 case "$1" in
6         config)
7                 echo "Configuring..."
8                 pushd config
9                 cmake .
10                 make
11                 popd
12                 config/conf Kconfig
13                 cmake .
14         ;;
15
16         compile)
17                 echo "Compile time..."
18                 make
19         ;;
20
21         install)
22                 if [ ! -e .config ]; then
23                         exit 1
24                 fi
25
26                 . ./.config
27
28                 echo -n "Installing firmware..."
29                 if [ "$CONFIG_CARL9170FW_BUILD_TOOLS" = "y" ] &&
30                    [ "$CONFIG_CARL9170FW_BUILD_MINIBOOT" = "y" ]; then
31                         echo -n "Apply miniboot..."
32                         tools/src/miniboot a carlfw/carl9170.fw minifw/miniboot.fw
33                 fi
34
35                 sudo install carlfw/carl9170.fw /lib/firmware/carl9170-$CONFIG_CARL9170FW_RELEASE_VERSION.fw
36                 echo "done."
37         ;;
38
39         *)
40                 $0 config
41                 $0 compile
42         ;;
43
44
45 esac