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