24cf88eecd6f247d35450917f15eeaec50e5771f
[openwrt/staging/chunkeey.git] / tools / firmware-utils / Makefile
1 #
2 # Copyright (C) 2006 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_BUILD_DIR:=$(TOOL_BUILD_DIR)/firmware-utils
11
12 include $(INCLUDE_DIR)/host-build.mk
13
14 CFLAGS := -O2 -I $(STAGING_DIR)/include-host -include endian.h
15
16 define cc
17 $(CC) $(CFLAGS) -o $(PKG_BUILD_DIR)/bin/$(1) src/$(1).c
18 endef
19
20 define Build/Compile
21 mkdir -p $(PKG_BUILD_DIR)/bin
22 $(call cc,addpattern)
23 $(call cc,trx)
24 $(call cc,motorola-bin)
25 $(call cc,dgfirmware)
26 $(call cc,trx2usr)
27 $(call cc,ptgen)
28 $(call cc,airlink)
29 $(call cc,srec2bin)
30 $(call cc,mkmylofw)
31 $(call cc,mkcsysimg)
32 $(call cc,mkzynfw)
33 endef
34
35 define Build/Install
36 $(CP) $(PKG_BUILD_DIR)/bin/* $(STAGING_DIR)/bin
37 endef
38
39 $(eval $(call HostBuild))