c5fbb70cbcfb79cd27055d9f31715c30ae7e3a75
[openwrt-10.03/.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
24 define Host/Compile
25         mkdir -p $(HOST_BUILD_DIR)/bin
26         $(call cc,addpattern)
27         $(call cc,trx)
28         $(call cc,motorola-bin)
29         $(call cc,dgfirmware)
30         $(call cc,trx2usr)
31         $(call cc,ptgen)
32         $(call cc,airlink)
33         $(call cc,srec2bin)
34         $(call cc,mkmylofw)
35         $(call cc,mkcsysimg)
36         $(call cc,mkzynfw)
37         $(call cc,lzma2eva,-lz)
38         $(call cc,mkcasfw)
39         $(call cc,mkfwimage,-lz)
40         $(call cc,mkfwimage2,-lz)
41         $(call cc2,imagetag)
42         $(call cc,add_header)
43         $(call cc,makeamitbin)
44         $(call cc,encode_crc)
45         $(call cc,nand_ecc)
46         $(call cc2,mkplanexfw sha1)
47         $(call cc2,mktplinkfw md5)
48         $(call cc,pc1crypt)
49         $(call cc,osbridge-crc)
50         $(call cc2,wrt400n cyg_crc32)
51         $(call cc,wndr3700)
52         $(call cc,mkdniimg)
53 endef
54
55 define Host/Install
56         $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/* $(STAGING_DIR_HOST)/bin/
57 endef
58
59 $(eval $(call HostBuild))