fwtool: add utility for appending and extracting firmware metadata/signatures
[openwrt/openwrt.git] / package / system / fwtool / Makefile
1 #
2 # Copyright (C) Felix Fietkau <nbd@nbd.name>
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=fwtool
11 PKG_RELEASE:=1
12
13 PKG_FLAGS:=nonshared
14
15 PKG_MAINTAINER := Felix Fietkau <nbd@nbd.name>
16 PKG_BUILD_DEPENDS := fwtool/host
17
18 include $(INCLUDE_DIR)/package.mk
19 include $(INCLUDE_DIR)/host-build.mk
20
21 HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)
22
23 define Package/fwtool
24 SECTION:=utils
25 CATEGORY:=Base system
26 TITLE:=Utility for appending and extracting firmware metadata and signatures
27 endef
28
29 define Host/Compile
30 $(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $(HOST_BUILD_DIR)/fwtool ./src/fwtool.c
31 endef
32
33 define Host/Install
34 $(INSTALL_BIN) $(HOST_BUILD_DIR)/fwtool $(1)/bin/
35 endef
36
37 define Build/Compile
38 $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) -o $(PKG_BUILD_DIR)/fwtool ./src/fwtool.c
39 endef
40
41 define Package/fwtool/install
42 $(INSTALL_DIR) $(1)/usr/bin
43 $(INSTALL_BIN) $(PKG_BUILD_DIR)/fwtool $(1)/usr/bin/
44 endef
45
46 $(eval $(call HostBuild))
47 $(eval $(call BuildPackage,fwtool))