carl9170: Install binary in the parent directory, not /lib/firmware
[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
32                 if [ "$CONFIG_CARL9170FW_BUILD_MINIBOOT" = "y" ]; then
33                         echo -n "Apply miniboot..."
34                         # also adds checksum
35                         tools/src/miniboot a carlfw/carl9170.fw minifw/miniboot.fw
36                 else
37                         echo -n "Add checksum..."
38                         tools/src/checksum carlfw/carl9170.fw
39                 fi
40
41                 install -m 644 carlfw/carl9170.fw \
42                         ../carl9170-$CONFIG_CARL9170FW_RELEASE_VERSION.fw
43                 echo "done."
44         ;;
45
46         *)
47                 $0 config
48                 $0 compile
49         ;;
50
51
52 esac