carl9170 firmware: add radar pattern generator
[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                 shift 1
13                 config/conf Kconfig "$@"
14                 cmake .
15         ;;
16
17         compile)
18                 echo "Compile time..."
19                 make
20         ;;
21
22         install)
23                 if [ ! -e .config ]; then
24                         exit 1
25                 fi
26
27                 . ./.config
28                 make
29
30                 echo -n "Installing firmware..."
31                 if [ "$CONFIG_CARL9170FW_BUILD_TOOLS" = "y" ]; then
32                         echo -n "Prepare firmware image..."
33                         tools/src/fwprepare carlfw/carl9170.fw
34
35                         if [ "$CONFIG_CARL9170FW_BUILD_MINIBOOT" = "y" ]; then
36                                 echo -n "Apply miniboot..."
37                                 # also adds checksum
38                                 tools/src/miniboot a carlfw/carl9170.fw minifw/miniboot.fw
39                         else
40                                 echo -n "Add checksum..."
41                                 tools/src/checksum carlfw/carl9170.fw
42                         fi
43                 fi
44
45                 install -m 644 carlfw/carl9170.fw \
46                         ../carl9170-$CONFIG_CARL9170FW_RELEASE_VERSION.fw
47                 echo "done."
48         ;;
49
50         *)
51                 $0 config "$@"
52                 $0 compile
53         ;;
54
55
56 esac