Merge branch 'master' into radar
[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                 make
28
29                 echo -n "Installing firmware..."
30                 if [ "$CONFIG_CARL9170FW_BUILD_TOOLS" = "y" ]; then
31                         echo -n "Prepare firmware image..."
32                         tools/src/fwprepare carlfw/carl9170.fw
33
34                         if [ "$CONFIG_CARL9170FW_BUILD_MINIBOOT" = "y" ]; then
35                                 echo -n "Apply miniboot..."
36                                 # also update checksum
37                                 tools/src/miniboot a carlfw/carl9170.fw minifw/miniboot.fw
38                         fi
39                 fi
40                 install -m 644 carlfw/carl9170.fw \
41                         ../carl9170-$CONFIG_CARL9170FW_RELEASE_VERSION.fw
42                 echo "done."
43         ;;
44
45         *)
46                 $0 config
47                 $0 compile
48         ;;
49
50
51 esac