[package] add nvramtool (#6086)
[openwrt/svn-archive/archive.git] / utils / nvramtool / Makefile
1 #
2 # Copyright (C) 2008 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:=nvramtool
10 PKG_REV:=4887
11 PKG_VERSION:=$(PKG_REV)
12 PKG_RELEASE:=1
13
14 PKG_SOURCE_PROTO:=svn
15 PKG_SOURCE_VERSION:=$(PKG_REV)
16 PKG_SOURCE_SUBDIR:=nvramtool-$(PKG_VERSION)
17 PKG_SOURCE_URL:=svn://coreboot.org/repos/trunk/util/nvramtool
18 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/nvramtool
23 SECTION:=utils
24 CATEGORY:=Utilities
25 URL:=http://www.coreboot.org/Nvramtool
26 TITLE:=Coreboot nvramtool
27 DEPENDS:=@TARGET_x86 +@PACKAGE_pciutils +zlib
28 endef
29
30 define Package/nvramtool/description
31 nvramtool (previously known as lxbios and cmos_util) is a utility for reading/writing coreboot parameters and displaying information from the coreboot table in CMOS/NVRAM.
32 The program is intended only for x86-based Linux systems that use coreboot, but can also be used for non-coreboot systems (e.g. for dumping all NVRAM bytes).
33 endef
34
35 define Build/Configure
36 endef
37
38 define Build/Compile
39 $(MAKE) -C $(PKG_BUILD_DIR) \
40 CC="$(TARGET_CC)" \
41 CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
42 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
43 LIBS="-lpci -lz" \
44 DESTDIR="$(PKG_INSTALL_DIR)" \
45 nvramtool
46 endef
47
48 define Package/nvramtool/install
49 $(INSTALL_DIR) $(1)/sbin
50 $(INSTALL_BIN) $(PKG_BUILD_DIR)/nvramtool $(1)/sbin/nvramtool
51 endef
52
53 $(eval $(call BuildPackage,nvramtool))