[tools] firmware-utils: add a tool to compute crc value for the 5gxi firmware
[openwrt.git] / tools / firmware-utils / Makefile
1 #
2 # Copyright (C) 2006-2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME := firmware-utils
10
11 include $(INCLUDE_DIR)/host-build.mk
12
13 include $(INCLUDE_DIR)/kernel.mk
14
15 define cc
16         $(CC) $(HOST_CFLAGS) -include endian.h -o $(HOST_BUILD_DIR)/bin/$(1) src/$(1).c $(2)
17 endef
18
19 define cc2
20         $(CC) $(HOST_CFLAGS) -include endian.h -o $(HOST_BUILD_DIR)/bin/$(firstword $(1)) $(foreach src,$(1),src/$(src).c) $(2)
21 endef
22
23 define cc3
24         $(CC) $(HOST_CFLAGS) -I$(CURDIR)/../../target/linux/brcm63xx/files/include/asm-mips/mach-bcm63xx -include endian.h -o $(HOST_BUILD_DIR)/bin/$(1) src/$(1).c $(2)
25 endef
26
27
28 define Host/Compile
29         mkdir -p $(HOST_BUILD_DIR)/bin
30         $(call cc,addpattern)
31         $(call cc,trx)
32         $(call cc,motorola-bin)
33         $(call cc,dgfirmware)
34         $(call cc,trx2usr)
35         $(call cc,ptgen)
36         $(call cc,airlink)
37         $(call cc,srec2bin)
38         $(call cc,mkmylofw)
39         $(call cc,mkcsysimg)
40         $(call cc,mkzynfw)
41         $(call cc,lzma2eva,-lz)
42         $(call cc,mkcasfw)
43         $(call cc,mkfwimage,-lz)
44         $(call cc,mkfwimage2,-lz)
45         $(call cc3,imagetag)
46         $(call cc,add_header)
47         $(call cc,makeamitbin)
48         $(call cc,encode_crc)
49         $(call cc,nand_ecc)
50         $(call cc2,mkplanexfw sha1)
51         $(call cc2,mktplinkfw md5)
52         $(call cc,pc1crypt)
53         $(call cc,osbridge-crc)
54 endef
55
56 define Host/Install
57         $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/* $(STAGING_DIR_HOST)/bin/
58 endef
59
60 $(eval $(call HostBuild))