cris
[buildroot.git] / package / kexec / kexec.mk
blobc123d8ea9af6ab2bef3b34c864a44d821cb33db8
1 #############################################################
3 # kexec
5 #############################################################
6 KEXEC_VERSION:=1.101
7 KEXEC_SOURCE:=kexec-tools_$(KEXEC_VERSION)-kdump10.orig.tar.gz
8 KEXEC_PATCH:=kexec-tools_$(KEXEC_VERSION)-kdump10-2.diff.gz
9 KEXEC_SITE:=$(BR2_DEBIAN_MIRROR)/debian/pool/main/k/kexec-tools/
10 KEXEC_DIR:=$(BUILD_DIR)/kexec-tools-$(KEXEC_VERSION)
11 KEXEC_CAT:=$(ZCAT)
12 KEXEC_BINARY:=kexec
13 KEXEC_TARGET_BINARY:=sbin/kexec
15 KEXEC_CONFIG_OPTS:=
16 KEXEC_DEPS_y:=
18 KEXEC_DEPS_$(KEXEC_PACKAGE_KEXEC) += zlib
20 ifeq ($(BR2_PACKAGE_KEXEC_ZLIB),y)
21 KEXEC_CONFIG_OPTS += --with-zlib
22 else
23 KEXEC_CONFIG_OPTS += --without-zlib
24 endif
26 $(DL_DIR)/$(KEXEC_SOURCE):
27 $(WGET) -P $(DL_DIR) $(KEXEC_SITE)/$(KEXEC_SOURCE)
29 $(DL_DIR)/$(KEXEC_PATCH):
30 $(WGET) -P $(DL_DIR) $(KEXEC_SITE)/$(KEXEC_PATCH)
32 kexec-source: $(DL_DIR)/$(KEXEC_SOURCE) $(DL_DIR)/$(KEXEC_PATCH)
34 $(KEXEC_DIR)/.unpacked: $(DL_DIR)/$(KEXEC_SOURCE) $(DL_DIR)/$(KEXEC_PATCH)
35 $(KEXEC_CAT) $(DL_DIR)/$(KEXEC_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
36 ifneq ($(KEXEC_PATCH),)
37 (cd $(KEXEC_DIR) && $(KEXEC_CAT) $(DL_DIR)/$(KEXEC_PATCH) | patch -p1; \
38 for f in `cat debian/patches/00list`; do \
39 cat debian/patches/$$f | patch -p2; \
40 done)
41 endif
42 toolchain/patch-kernel.sh $(KEXEC_DIR) package/kexec/ kexec\*.patch
43 $(CONFIG_UPDATE) $(@D)
44 touch $@
46 $(KEXEC_DIR)/.configured: $(KEXEC_DIR)/.unpacked
47 (cd $(KEXEC_DIR); rm -rf config.cache; \
48 $(AUTO_CONFIGURE_TARGET) \
49 --prefix=/ \
50 $(KEXEC_CONFIG_OPTS) \
52 touch $@
54 $(KEXEC_DIR)/objdir-$(GNU_TARGET_NAME)/build/$(KEXEC_TARGET_BINARY): $(KEXEC_DIR)/.configured
55 $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(KEXEC_DIR)
56 touch -c $@
58 $(TARGET_DIR)/$(KEXEC_TARGET_BINARY): $(KEXEC_DIR)/objdir-$(GNU_TARGET_NAME)/build/$(KEXEC_TARGET_BINARY)
59 $(INSTALL) -D $(KEXEC_DIR)/objdir-$(GNU_TARGET_NAME)/build/sbin/$(KEXEC_BINARY) $@
60 $(INSTALL) -D $(KEXEC_DIR)/objdir-$(GNU_TARGET_NAME)/build/sbin/kdump \
61 $(TARGET_DIR)/sbin/kdump
62 $(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/sbin/kexec \
63 $(TARGET_DIR)/sbin/kdump
65 kexec: uclibc $(TARGET_DIR)/$(KEXEC_TARGET_BINARY)
67 kexec-clean:
68 -$(MAKE) -C $(KEXEC_DIR) clean
69 rm -f $(TARGET_DIR)/sbin/kexec $(TARGET_DIR)/sbin/kdump
71 kexec-dirclean:
72 rm -rf $(KEXEC_DIR)
73 #############################################################
75 # Toplevel Makefile options
77 #############################################################
78 ifeq ($(BR2_PACKAGE_KEXEC),y)
79 TARGETS+=kexec
80 endif