9a68b80c71759f23692e5d68b605beaafa080b2a
[openwrt/openwrt.git] / tools / firmware-utils / Makefile
1 #
2 # Copyright (C) 2006-2020 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 PKG_RELEASE := 7
11
12 include $(INCLUDE_DIR)/host-build.mk
13 include $(INCLUDE_DIR)/kernel.mk
14
15 define cc
16 $(HOSTCC) \
17 $(HOST_CFLAGS) \
18 -Wno-unused-parameter \
19 -include endian.h $(HOST_LDFLAGS) \
20 -o $(HOST_BUILD_DIR)/bin/$(firstword $(1)) \
21 $(foreach src,$(1),src/$(src).c) \
22 $(2)
23 endef
24
25 define Host/Compile
26 mkdir -p $(HOST_BUILD_DIR)/bin
27 $(call cc,add_header)
28 $(call cc,addpattern)
29 $(call cc,asustrx)
30 $(call cc,buffalo-enc buffalo-lib,-Wall)
31 $(call cc,buffalo-tag buffalo-lib,-Wall)
32 $(call cc,buffalo-tftp buffalo-lib,-Wall)
33 $(call cc,dgfirmware)
34 $(call cc,dgn3500sum,-Wall)
35 $(call cc,dns313-header,-Wall)
36 $(call cc,edimax_fw_header,-Wall)
37 $(call cc,encode_crc)
38 $(call cc,fix-u-media-header cyg_crc32,-Wall)
39 $(call cc,hcsmakeimage bcmalgo)
40 $(call cc,imagetag imagetag_cmdline cyg_crc32)
41 $(call cc,jcgimage,-lz -Wall)
42 $(call cc,lxlfw)
43 $(call cc,lzma2eva,-lz)
44 $(call cc,makeamitbin)
45 $(call cc,mkbrncmdline)
46 $(call cc,mkbrnimg)
47 $(call cc,mkbuffaloimg,-Wall)
48 $(call cc,mkcameofw,-Wall)
49 $(call cc,mkcasfw)
50 $(call cc,mkchkimg)
51 $(call cc,mkcsysimg)
52 $(call cc,mkdapimg)
53 $(call cc,mkdapimg2)
54 $(call cc,mkdhpimg buffalo-lib,-Wall)
55 $(call cc,mkdlinkfw mkdlinkfw-lib,-lz -Wall --std=c99)
56 $(call cc,mkdniimg)
57 $(call cc,mkedimaximg)
58 $(call cc,mkfwimage,-lz -Wall -Werror -Wextra -D_FILE_OFFSET_BITS=64)
59 $(call cc,mkfwimage2,-lz)
60 $(call cc,mkheader_gemtek,-lz)
61 $(call cc,mkhilinkfw,-lcrypto)
62 $(call cc,mkmerakifw sha1,-Wall)
63 $(call cc,mkmerakifw-old,-Wall)
64 $(call cc,mkmylofw)
65 $(call cc,mkplanexfw sha1)
66 $(call cc,mkporayfw,-Wall)
67 $(call cc,mkrasimage,--std=gnu99)
68 $(call cc,mkrtn56uimg,-lz)
69 $(call cc,mksenaofw md5,-Wall --std=gnu99)
70 $(call cc,mksercommfw,-Wall)
71 $(call cc,mktitanimg)
72 $(call cc,mktplinkfw mktplinkfw-lib md5,-Wall -fgnu89-inline)
73 $(call cc,mktplinkfw2 mktplinkfw-lib md5,-fgnu89-inline)
74 $(call cc,mkwrggimg md5,-Wall)
75 $(call cc,mkwrgimg md5,-Wall)
76 $(call cc,mkzcfw cyg_crc32)
77 $(call cc,mkzynfw)
78 $(call cc,motorola-bin)
79 $(call cc,nand_ecc)
80 $(call cc,nec-enc,-Wall --std=gnu99)
81 $(call cc,osbridge-crc)
82 $(call cc,oseama md5,-Wall)
83 $(call cc,otrx)
84 $(call cc,pc1crypt)
85 $(call cc,ptgen cyg_crc32)
86 $(call cc,seama md5)
87 $(call cc,spw303v)
88 $(call cc,srec2bin)
89 $(call cc,tplink-safeloader md5,-Wall --std=gnu99)
90 $(call cc,trx)
91 $(call cc,trx2edips)
92 $(call cc,trx2usr)
93 $(call cc,uimage_padhdr,-Wall -lz)
94 $(call cc,wrt400n cyg_crc32)
95 $(call cc,xorimage)
96 $(call cc,zyimage,-Wall)
97 $(call cc,zyxbcm)
98 endef
99
100 define Host/Install
101 $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/* $(STAGING_DIR_HOST)/bin/
102 endef
103
104 $(eval $(call HostBuild))