From 25fcd3545008ba9262c58d92a481d607e55b0358 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sun, 2 Nov 2008 18:37:51 -0500 Subject: [PATCH] Support separate kbuild source and output directories. Signed-off-by: Anders Kaseorg --- Makefile.ksplice | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Makefile.ksplice b/Makefile.ksplice index 79a6515..8175dc0 100644 --- a/Makefile.ksplice +++ b/Makefile.ksplice @@ -52,6 +52,18 @@ ifneq ($(filter snap diff,$(KSPLICE_MODE)),) include $(if $(KBUILD_SRC),$(KBUILD_SRC)/)scripts/Makefile.lib endif include $(if $(KBUILD_SRC),$(KBUILD_SRC)/)Makefile + +ifneq ($(skip-makefile),) + +PHONY += __ksplice +__ksplice: FORCE + $(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \ + KBUILD_SRC=$(CURDIR) \ + KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(ksplice-makefile) \ + $(if $(wildcard $(KBUILD_OUTPUT)/include/config/kernel.release),--old-file=include/config/kernel.release) + +else # skip-makefile + CC := ksplice-cc.pl $(CC) CFLAGS_KSPLICE = -ffunction-sections -fdata-sections -ksplice-cflags-api=1 CFLAGS_KERNEL += $(CFLAGS_KSPLICE) @@ -96,6 +108,8 @@ ksplice_modinst: $(ksplice-dirs) endif # KSPLICE_MODE +endif # skip-makefile + else # obj ifeq ($(KSPLICE_MODE),revert) @@ -159,6 +173,8 @@ endif # KSPLICE_MODE endif # obj +ifeq ($(skip-makefile),) + ifeq ($(KSPLICE_MODE),revert) ksplice-revert-obj := $(wildcard $(obj)/*.KSPLICE_pre) @@ -243,6 +259,8 @@ PHONY += $(ksplice-dirs) $(ksplice-dirs): $(ksplice-before) $(Q)$(MAKE) -f $(ksplice-makefile) obj=$(@:_ksplice_%=%) +endif # skip-makefile + $(eval $(ksplice-cow-eval)) PHONY += FORCE -- 2.11.4.GIT