kernel: be consistent with formatting style
[openwrt/svn-archive/archive.git] / package / boot / kexec-tools / Makefile
1 #
2 # Copyright (C) 2006-2012 OpenWrt.org
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:=kexec-tools
11 PKG_VERSION:=2.0.3
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
16 PKG_MD5SUM:=b3ced2097ce3981abba38ceedc84f939
17
18 PKG_FIXUP:=autoreconf
19
20 PKG_CONFIG_DEPENDS := CONFIG_KEXEC_ZLIB
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/kexec-tools
25 SECTION:=utils
26 CATEGORY:=Utilities
27 DEPENDS:=@armeb||@arm||@i386||@powerpc64||@mipsel||@mips +KEXEC_ZLIB:zlib
28 TITLE:=Kernel boots kernel
29 URL:=http://kernel.org/pub/linux/kernel/people/horms/kexec-tools/
30 MAINTAINER:=Florian Fainelli <florian@openwrt.org>
31 MENU:=1
32 endef
33
34 define Package/kexec-tools/description
35 kexec is a set of systems call that allows you to load
36 another kernel from the currently executing Linux kernel.
37 endef
38
39 define Package/kexec-tools/config
40 source "$(SOURCE)/Config.in"
41 endef
42
43 KEXEC_TARGET_NAME:=$(call qstrip,$(CONFIG_KEXEC_TOOLS_TARGET_NAME))-linux-$(TARGET_SUFFIX)
44
45 CONFIGURE_ARGS = \
46 --target=$(KEXEC_TARGET_NAME) \
47 --host=$(REAL_GNU_TARGET_NAME) \
48 --build=$(GNU_HOST_NAME) \
49 --program-prefix="" \
50 --program-suffix="" \
51 --prefix=/usr \
52 --exec-prefix=/usr \
53 --bindir=/usr/bin \
54 --sbindir=/usr/sbin \
55 --libexecdir=/usr/lib \
56 --sysconfdir=/etc \
57 $(if $(CONFIG_KEXEC_ZLIB),--with,--without)-zlib
58
59 TARGET_CFLAGS += -ffunction-sections -fdata-sections
60 TARGET_LDFLAGS += -Wl,--gc-sections
61
62 CONFIGURE_VARS += \
63 BUILD_CC="$(HOSTCC)" \
64 TARGET_CC="$(TARGET_CC)"
65
66 kexec-extra-sbin-$(CONFIG_KEXEC_TOOLS_kdump) += kdump
67
68 define Build/Compile
69 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install
70 endef
71
72 define Package/kexec-tools/install
73 $(INSTALL_DIR) $(1)/usr/sbin
74 $(INSTALL_BIN) \
75 $(addprefix $(PKG_INSTALL_DIR)/usr/sbin/, \
76 $(kexec-extra-sbin-y)) \
77 $(kexec-extra-bin-y) \
78 $(PKG_INSTALL_DIR)/usr/sbin/kexec \
79 $(1)/usr/sbin
80
81 # make a link for compatability with other distros
82 $(INSTALL_DIR) $(1)/sbin
83 ln -s /usr/sbin/kexec $(1)/sbin/kexec
84 endef
85
86 $(eval $(call BuildPackage,kexec-tools))