08b6ff83d2558bf63b8fa136647541db2231e46b
[linux-libre-firmware.git] / Makefile
1 # Copyright (C) 2017 Jason Self <j@jxself.org>
2 #
3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 2 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
16 shell=/bin/sh
17 prefix=/lib/firmware
18 install_program=install
19
20 .PHONY: all test clean install a56 as31 ath9k_htc_toolchain ath9k_htc_firmware av7110 b43-tools carl9170fw-toolchain carl9170fw cis-tools cis dsp56k ihex2fw isci keyspan_pda openfwwf usbdux
21
22 all: ath9k_htc av7110 carl9170fw cis dsp56k isci keyspan_pda openfwwf usbdux
23
24 a56:
25         cd a56 && $(MAKE)
26         
27 as31:
28         cd as31 && ./configure && $(MAKE)
29
30 ath9k_htc_toolchain:
31         cd ath9k_htc && $(MAKE) toolchain
32
33 ath9k_htc: ath9k_htc_toolchain
34         cd ath9k_htc && $(MAKE) -C target_firmware
35
36 av7110:
37         cd av7110 && $(MAKE)
38
39 b43-tools:
40         cd b43-tools/assembler && $(MAKE)
41
42 carl9170fw-toolchain:
43         cd carl9170fw && $(MAKE) -C toolchain
44
45 carl9170fw: carl9170fw-toolchain
46         cd carl9170fw && ./autogen.sh
47
48 cis: cis-tools
49         cd cis && $(MAKE)
50
51 cis-tools:
52         cd cis-tools && $(MAKE)
53
54 dsp56k: a56
55         cd dsp56k && $(MAKE)
56
57 ihex2fw: 
58         cd ihex2fw && $(MAKE)
59
60 isci:
61         cd isci && $(MAKE)
62
63 keyspan_pda: ihex2fw
64         cd keyspan_pda && $(MAKE)
65
66 openfwwf: b43-tools
67         cd openfwwf && $(MAKE)
68
69 usbdux: as31
70         cd usbdux && $(MAKE) -f Makefile_dux
71
72 test:
73         @echo This function is not implemented.
74
75 clean:
76         cd a56 && $(MAKE) clean
77         if [ -a as31/Makefile ]; then cd as31 && $(MAKE) clean; fi;
78         cd ath9k_htc && $(MAKE) toolchain-clean
79         cd ath9k_htc && $(MAKE) -C target_firmware clean
80         cd av7110 && $(MAKE) clean
81         cd carl9170fw/toolchain && $(MAKE) clean
82         if [ -a carl9170fw/Makefile ]; then cd carl9170fw && $(MAKE) clean; fi;
83         cd dsp56k && $(MAKE) clean
84         cd ihex2fw && $(MAKE) clean
85         cd cis-tools && $(MAKE) clean
86         cd cis && $(MAKE) clean
87         cd isci && $(MAKE) clean
88         cd keyspan_pda && $(MAKE) clean
89         cd openfwwf && $(MAKE) clean
90         cd usbdux && $(MAKE) -f Makefile_dux clean
91
92 install:
93         if [ -a ath9k_htc/target_firmware/build/k2/htc_9271.fw ]; then $(install_program) -D ath9k_htc/target_firmware/build/k2/htc_9271.fw $(prefix)/ath9k_htc/htc_9271.fw; fi;
94         if [ -a ath9k_htc/target_firmware/build/magpie/htc_7010.fw ]; then $(install_program) -D ath9k_htc/target_firmware/build/magpie/htc_7010.fw $(prefix)/ath9k_htc/htc_7010.fw; fi;
95         if [ -a av7110/bootcode.bin ]; then $(install_program) -D av7110/bootcode.bin $(prefix)/av7110/bootcode.bin; fi;
96         if [ -a cis/3CCFEM556.cis ]; then $(install_program) -D cis/3CCFEM556.cis $(prefix)/cis/3CCFEM556.cis; fi;
97         if [ -a cis/3CXEM556.cis ]; then $(install_program) -D cis/3CXEM556.cis $(prefix)/cis/3CXEM556.cis; fi;
98         if [ -a cis/COMpad2.cis ]; then $(install_program) -D cis/COMpad2.cis $(prefix)/cis/COMpad2.cis; fi;
99         if [ -a cis/COMpad4.cis ]; then $(install_program) -D cis/COMpad4.cis $(prefix)/cis/COMpad4.cis; fi;
100         if [ -a cis/DP83903.cis ]; then $(install_program) -D cis/DP83903.cis $(prefix)/cis/DP83903.cis; fi;
101         if [ -a cis/LA-PCM.cis ]; then $(install_program) -D cis/LA-PCM.cis $(prefix)/cis/LA-PCM.cis; fi;
102         if [ -a cis/MT5634ZLX.cis ]; then $(install_program) -D cis/MT5634ZLX.cis $(prefix)/cis/MT5634ZLX.cis; fi;
103         if [ -a cis/NE2K.cis ]; then $(install_program) -D cis/NE2K.cis $(prefix)/cis/NE2K.cis; fi;
104         if [ -a cis/PCMLM28.cis ]; then $(install_program) -D cis/PCMLM28.cis $(prefix)/cis/PCMLM28.cis; fi;
105         if [ -a cis/PE520.cis ]; then $(install_program) -D cis/PE520.cis $(prefix)/cis/PE520.cis; fi;
106         if [ -a cis/PE-200.cis ]; then $(install_program) -D cis/PE-200.cis $(prefix)/cis/PE-200.cis; fi;
107         if [ -a cis/RS-COM-2P.cis ]; then $(install_program) -D cis/RS-COM-2P.cis $(prefix)/cis/RS-COM-2P.cis; fi;
108         if [ -a cis/SW_7xx_SER.cis ]; then $(install_program) -D cis/SW_7xx_SER.cis $(prefix)/cis/SW_7xx_SER.cis; fi;
109         if [ -a cis/SW_8xx_SER.cis ]; then $(install_program) -D cis/SW_8xx_SER.cis $(prefix)/cis/SW_8xx_SER.cis; fi;
110         if [ -a cis/SW_555_SER.cis ]; then $(install_program) -D cis/SW_555_SER.cis $(prefix)/cis/SW_555_SER.cis; fi;
111         if [ -a cis/tamarack.cis ]; then $(install_program) -D cis/tamarack.cis $(prefix)/cis/tamarack.cis; fi;
112         if [ -a carl9170fw/carlfw/carl9170.fw ]; then cd carl9170fw && ./autogen.sh install &&  $(install_program) -D carl9170-1.fw $(prefix)/carl9170-1.fw; fi;
113         if [ -a dsp56k/bootstrap.bin ]; then $(install_program) -D dsp56k/bootstrap.bin $(prefix)/dsp56k/bootstrap.bin; fi;
114         if [ -a isci/isci_firmware.bin ]; then $(install_program) -D isci/isci_firmware.bin $(prefix)/isci/isci_firmware.bin; fi
115         if [ -a keyspan_pda/keyspan_pda.fw ]; then $(install_program) -D isci/isci_firmware.bin $(prefix)/keyspan_pda/keyspan_pda.fw; fi
116         if [ -a keyspan_pda/keyspan_pda.fw ]; then $(install_program) -D isci/isci_firmware.bin $(prefix)/keyspan_pda/xircom_pgs.fw; fi
117         if [ -a openfwwf/ucode5.fw ]; then $(install_program) -D openfwwf/ucode5.fw $(prefix)/b43/ucode5.fw; fi
118         if [ -a openfwwf/b0g0bsinitvals5.fw ]; then $(install_program) -D openfwwf/b0g0bsinitvals5.fw $(prefix)/b43/b0g0bsinitvals5.fw; fi
119         if [ -a openfwwf/b0g0initvals5.fw ]; then $(install_program) -D openfwwf/b0g0initvals5.fw $(prefix)/b43/b0g0initvals5.fw; fi
120         if [ -a usbdux/usbduxfast_firmware.bin ]; then $(install_program) -D usbdux/usbduxfast_firmware.bin $(prefix)/usbduxfast_firmware.bin; fi
121         if [ -a usbdux/usbdux_firmware.bin ]; then $(install_program) -D usbdux/usbdux_firmware.bin $(prefix)/usbdux_firmware.bin; fi
122         if [ -a usbdux/usbduxsigma_firmware.bin ]; then $(install_program) -D usbdux/usbduxsigma_firmware.bin $(prefix)/usbduxsigma_firmware.bin; fi