Jackeagle | 1cba413 | 2018-12-19 17:08:24 +0100 | [diff] [blame] | 1 | From d90fac6121821ac30cd915e4a36ff107d3709b54 Mon Sep 17 00:00:00 2001 |
Jackeagle | d3ba228 | 2018-11-17 20:49:22 -0700 | [diff] [blame] | 2 | From: Jackeagle <jackeagle102@gmail.com> |
Jackeagle | a3ae16b | 2018-12-04 11:30:49 -0500 | [diff] [blame] | 3 | Date: Mon, 3 Dec 2018 10:56:07 -0500 |
Jackeagle | 1cba413 | 2018-12-19 17:08:24 +0100 | [diff] [blame] | 4 | Subject: [PATCH 05/11] Revert "vendor/bliss: Remove kernel.mk headers |
Jackeagle | d3ba228 | 2018-11-17 20:49:22 -0700 | [diff] [blame] | 5 | generation" |
| 6 | |
| 7 | This reverts commit 6a4c7c1258ffecc26324b034c9091373bf0272dd. |
| 8 | --- |
| 9 | build/tasks/kernel.mk | 50 +++++++++++++++++++++++++++++++++++++++++++ |
| 10 | 1 file changed, 50 insertions(+) |
| 11 | |
| 12 | diff --git a/build/tasks/kernel.mk b/build/tasks/kernel.mk |
Jackeagle | 1cba413 | 2018-12-19 17:08:24 +0100 | [diff] [blame] | 13 | index b42d86d..d0263d3 100644 |
Jackeagle | d3ba228 | 2018-11-17 20:49:22 -0700 | [diff] [blame] | 14 | --- a/build/tasks/kernel.mk |
| 15 | +++ b/build/tasks/kernel.mk |
| 16 | @@ -151,6 +151,9 @@ endif |
| 17 | |
| 18 | ifeq ($(FULL_KERNEL_BUILD),true) |
| 19 | |
| 20 | +KERNEL_HEADERS_INSTALL_DIR := $(KERNEL_OUT)/usr |
| 21 | +KERNEL_HEADERS_INSTALL_DEPS := $(KERNEL_OUT)/.headers_install_deps |
| 22 | + |
| 23 | ifeq ($(NEED_KERNEL_MODULE_ROOT),true) |
| 24 | KERNEL_MODULES_INSTALL := root |
| 25 | KERNEL_MODULES_OUT := $(TARGET_ROOT_OUT)/lib/modules |
| 26 | @@ -252,6 +255,53 @@ $(TARGET_KERNEL_MODULES): TARGET_KERNEL_BINARIES |
| 27 | |
| 28 | $(TARGET_PREBUILT_INT_KERNEL): $(TARGET_KERNEL_MODULES) |
| 29 | |
| 30 | +# Install kernel (uapi) headers. |
| 31 | +# |
| 32 | +# The dependency file serves two purposes: |
| 33 | +# - It is a stamp indicating when the headers were last installed. |
| 34 | +# - It contains a rule to regenerate itself when any kernel header |
| 35 | +# files change. This rule is identical to the rule emitted by |
| 36 | +# GCC using the M/MM flags. |
| 37 | +# |
| 38 | +# Note that the location of installed kernel headers changed when the |
| 39 | +# kernel uapi system was introduced in 3.7. Unfortunately, it is not |
| 40 | +# sufficient to test whether the uapi directories exist because some |
| 41 | +# kernels backport patches that contain uapi headers. So we look for |
| 42 | +# the string "version_h" in the kernel makefile which was introduced |
| 43 | +# as a part of the uapi system (commit d183e6f570f3). |
| 44 | +-include $(KERNEL_HEADERS_INSTALL_DEPS) |
| 45 | +$(KERNEL_HEADERS_INSTALL_DEPS): |
| 46 | + @echo "Building Kernel Headers" |
| 47 | + $(hide) mkdir -p $(KERNEL_OUT) |
| 48 | + $(hide) rm -f $@ |
| 49 | + $(hide) $(MAKE) $(MAKE_FLAGS) -C $(KERNEL_SRC) O=$(KERNEL_OUT) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(KERNEL_CLANG_TRIPLE) $(KERNEL_CC) headers_install |
| 50 | + $(hide) echo "$@: \\" > $@ |
| 51 | + $(hide) ( cd $(KERNEL_SRC); \ |
| 52 | + if grep -q '^version_h' 'Makefile'; then \ |
| 53 | + depdirs="arch/$(KERNEL_ARCH)/include/uapi include/uapi"; \ |
| 54 | + else \ |
| 55 | + depdirs="arch/$(KERNEL_ARCH)/include/asm include"; \ |
| 56 | + fi; \ |
| 57 | + deps="Makefile $$(find $$depdirs -type f -name '*.h')"; \ |
| 58 | + for f in $$deps; do \ |
| 59 | + echo " $(KERNEL_SRC)/$$f \\" >> $@; \ |
| 60 | + done ; \ |
| 61 | + echo "" >> $@ ; \ |
| 62 | + for f in $$deps; do \ |
| 63 | + echo "$(KERNEL_SRC)/$$f:" >> $@; \ |
| 64 | + echo "" >> $@; \ |
| 65 | + done \ |
| 66 | + ) |
| 67 | + |
| 68 | +.PHONY: INSTALLED_KERNEL_HEADERS |
| 69 | +INSTALLED_KERNEL_HEADERS: $(KERNEL_HEADERS_INSTALL_DEPS) |
| 70 | + |
| 71 | +# Dependencies on $(KERNEL_OUT)/usr are deprecated |
| 72 | +$(KERNEL_HEADERS_INSTALL_DIR): $(KERNEL_HEADERS_INSTALL_DEPS) |
| 73 | + @echo "Depending on $(KERNEL_HEADERS_INSTALL_DIR) is deprecated." 1>&2 |
| 74 | + @echo "Use INSTALLED_KERNEL_HEADERS instead." 1>&2 |
| 75 | + @exit 1 |
| 76 | + |
| 77 | .PHONY: kerneltags |
| 78 | kerneltags: $(KERNEL_CONFIG) |
| 79 | $(hide) mkdir -p $(KERNEL_OUT) |
| 80 | -- |
| 81 | 2.17.1 |
| 82 | |