aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/fwtool/Makefile
blob: 283be8d77a0ea2c4cc3e06ef15f32c545dda5a32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#
# Copyright (C) Felix Fietkau <nbd@nbd.name>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=fwtool
PKG_RELEASE:=2

PKG_FLAGS:=nonshared

PKG_MAINTAINER := Felix Fietkau <nbd@nbd.name>
PKG_BUILD_DEPENDS := fwtool/host

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk

HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)

define Package/fwtool
  SECTION:=utils
  CATEGORY:=Base system
  TITLE:=Utility for appending and extracting firmware metadata and signatures
endef

define Host/Compile
	$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $(HOST_BUILD_DIR)/fwtool ./src/fwtool.c
endef

define Host/Install
	$(INSTALL_BIN) $(HOST_BUILD_DIR)/fwtool $(1)/bin/
endef

define Build/Compile
	$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) -o $(PKG_BUILD_DIR)/fwtool ./src/fwtool.c
endef

define Package/fwtool/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/fwtool $(1)/usr/bin/
endef

$(eval $(call HostBuild))
$(eval $(call BuildPackage,fwtool))