.. | .. |
---|
1 | 1 | # SPDX-License-Identifier: GPL-2.0 |
---|
2 | 2 | VERSION = 5 |
---|
3 | 3 | PATCHLEVEL = 10 |
---|
4 | | -SUBLEVEL = 160 |
---|
| 4 | +SUBLEVEL = 198 |
---|
5 | 5 | EXTRAVERSION = |
---|
6 | 6 | NAME = Dare mighty things |
---|
7 | 7 | |
---|
.. | .. |
---|
93 | 93 | |
---|
94 | 94 | # If the user is running make -s (silent mode), suppress echoing of |
---|
95 | 95 | # commands |
---|
| 96 | +# make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS. |
---|
96 | 97 | |
---|
97 | | -ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),) |
---|
98 | | - quiet=silent_ |
---|
| 98 | +ifeq ($(filter 3.%,$(MAKE_VERSION)),) |
---|
| 99 | +silence:=$(findstring s,$(firstword -$(MAKEFLAGS))) |
---|
| 100 | +else |
---|
| 101 | +silence:=$(findstring s,$(filter-out --%,$(MAKEFLAGS))) |
---|
| 102 | +endif |
---|
| 103 | + |
---|
| 104 | +ifeq ($(silence),s) |
---|
| 105 | +quiet=silent_ |
---|
99 | 106 | endif |
---|
100 | 107 | |
---|
101 | 108 | export quiet Q KBUILD_VERBOSE |
---|
.. | .. |
---|
522 | 529 | -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \ |
---|
523 | 530 | -Werror=implicit-function-declaration -Werror=implicit-int \ |
---|
524 | 531 | -Werror=return-type -Wno-format-security \ |
---|
525 | | - -w \ |
---|
526 | 532 | -std=gnu89 |
---|
527 | 533 | KBUILD_CPPFLAGS := -D__KERNEL__ |
---|
528 | 534 | KBUILD_AFLAGS_KERNEL := |
---|
.. | .. |
---|
598 | 604 | ifneq ($(GCC_TOOLCHAIN),) |
---|
599 | 605 | CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN) |
---|
600 | 606 | endif |
---|
601 | | -ifneq ($(LLVM_IAS),1) |
---|
602 | | -CLANG_FLAGS += -no-integrated-as |
---|
| 607 | +ifeq ($(LLVM_IAS),1) |
---|
| 608 | +CLANG_FLAGS += -fintegrated-as |
---|
| 609 | +else |
---|
| 610 | +CLANG_FLAGS += -fno-integrated-as |
---|
603 | 611 | endif |
---|
604 | 612 | CLANG_FLAGS += -Werror=unknown-warning-option |
---|
605 | 613 | KBUILD_CFLAGS += $(CLANG_FLAGS) |
---|
.. | .. |
---|
829 | 837 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) |
---|
830 | 838 | |
---|
831 | 839 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) |
---|
| 840 | + |
---|
| 841 | +# These result in bogus false positives |
---|
| 842 | +KBUILD_CFLAGS += $(call cc-disable-warning, dangling-pointer) |
---|
| 843 | + |
---|
832 | 844 | ifdef CONFIG_FRAME_POINTER |
---|
833 | 845 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls |
---|
834 | 846 | else |
---|
.. | .. |
---|
872 | 884 | DEBUG_CFLAGS += -g |
---|
873 | 885 | endif |
---|
874 | 886 | |
---|
875 | | -ifeq ($(LLVM_IAS),1) |
---|
| 887 | +ifdef CONFIG_AS_IS_LLVM |
---|
876 | 888 | KBUILD_AFLAGS += -g |
---|
877 | 889 | else |
---|
878 | 890 | KBUILD_AFLAGS += -Wa,-gdwarf-2 |
---|
.. | .. |
---|
1520 | 1532 | |
---|
1521 | 1533 | PHONY += modules |
---|
1522 | 1534 | # if KBUILD_BUILTIN && !KBUILD_MIXED_TREE, depend on vmlinux |
---|
1523 | | -modules: $(if $(KBUILD_BUILTIN), $(if $(KBUILD_MIXED_TREE),,vmlinux)) |
---|
1524 | | -modules: modules_check modules_prepare |
---|
1525 | | - $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost |
---|
| 1535 | +modules: $(if $(KBUILD_BUILTIN), $(if $(KBUILD_MIXED_TREE),,vmlinux)) modules_check modules_prepare |
---|
1526 | 1536 | |
---|
1527 | 1537 | PHONY += modules_check |
---|
1528 | 1538 | modules_check: modules.order |
---|
.. | .. |
---|
1540 | 1550 | modules_prepare: prepare |
---|
1541 | 1551 | $(Q)$(MAKE) $(build)=scripts scripts/module.lds |
---|
1542 | 1552 | |
---|
1543 | | -# Target to install modules |
---|
1544 | | -PHONY += modules_install |
---|
1545 | | -modules_install: _modinst_ _modinst_post |
---|
1546 | | - |
---|
1547 | | -PHONY += _modinst_ |
---|
1548 | | -_modinst_: |
---|
| 1553 | +modules_install: __modinst_pre |
---|
| 1554 | +PHONY += __modinst_pre |
---|
| 1555 | +__modinst_pre: |
---|
1549 | 1556 | @rm -rf $(MODLIB)/kernel |
---|
1550 | 1557 | @rm -f $(MODLIB)/source |
---|
1551 | 1558 | @mkdir -p $(MODLIB)/kernel |
---|
.. | .. |
---|
1557 | 1564 | @sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order |
---|
1558 | 1565 | @cp -f $(mixed-build-prefix)modules.builtin $(MODLIB)/ |
---|
1559 | 1566 | @cp -f $(or $(mixed-build-prefix),$(objtree)/)modules.builtin.modinfo $(MODLIB)/ |
---|
1560 | | - $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst |
---|
1561 | | - |
---|
1562 | | -# This depmod is only for convenience to give the initial |
---|
1563 | | -# boot a modules.dep even before / is mounted read-write. However the |
---|
1564 | | -# boot script depmod is the master version. |
---|
1565 | | -PHONY += _modinst_post |
---|
1566 | | -_modinst_post: _modinst_ |
---|
1567 | | - $(call cmd,depmod) |
---|
1568 | 1567 | |
---|
1569 | 1568 | ifeq ($(CONFIG_MODULE_SIG), y) |
---|
1570 | 1569 | PHONY += modules_sign |
---|
1571 | 1570 | modules_sign: |
---|
1572 | 1571 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modsign |
---|
1573 | 1572 | endif |
---|
1574 | | - |
---|
1575 | | -else # CONFIG_MODULES |
---|
1576 | | - |
---|
1577 | | -# Modules not configured |
---|
1578 | | -# --------------------------------------------------------------------------- |
---|
1579 | | - |
---|
1580 | | -PHONY += modules modules_install |
---|
1581 | | -modules modules_install: |
---|
1582 | | - @echo >&2 |
---|
1583 | | - @echo >&2 "The present kernel configuration has modules disabled." |
---|
1584 | | - @echo >&2 "Type 'make config' and enable loadable module support." |
---|
1585 | | - @echo >&2 "Then build a kernel with module support enabled." |
---|
1586 | | - @echo >&2 |
---|
1587 | | - @exit 1 |
---|
1588 | 1573 | |
---|
1589 | 1574 | endif # CONFIG_MODULES |
---|
1590 | 1575 | |
---|
.. | .. |
---|
1833 | 1818 | KBUILD_MODULES := 1 |
---|
1834 | 1819 | |
---|
1835 | 1820 | build-dirs := $(KBUILD_EXTMOD) |
---|
1836 | | -PHONY += modules |
---|
1837 | | -modules: $(MODORDER) |
---|
1838 | | - $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost |
---|
1839 | | - |
---|
1840 | 1821 | $(MODORDER): descend |
---|
1841 | 1822 | @: |
---|
1842 | | - |
---|
1843 | | -PHONY += modules_install |
---|
1844 | | -modules_install: _emodinst_ _emodinst_post |
---|
1845 | | - |
---|
1846 | | -install-dir := $(if $(INSTALL_MOD_DIR),$(INSTALL_MOD_DIR),extra) |
---|
1847 | | -PHONY += _emodinst_ |
---|
1848 | | -_emodinst_: |
---|
1849 | | - $(Q)mkdir -p $(MODLIB)/$(install-dir) |
---|
1850 | | - $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst |
---|
1851 | | - |
---|
1852 | | -PHONY += _emodinst_post |
---|
1853 | | -_emodinst_post: _emodinst_ |
---|
1854 | | - $(call cmd,depmod) |
---|
1855 | 1823 | |
---|
1856 | 1824 | compile_commands.json: $(extmod-prefix)compile_commands.json |
---|
1857 | 1825 | PHONY += compile_commands.json |
---|
.. | .. |
---|
1877 | 1845 | |
---|
1878 | 1846 | endif # KBUILD_EXTMOD |
---|
1879 | 1847 | |
---|
| 1848 | +# --------------------------------------------------------------------------- |
---|
| 1849 | +# Modules |
---|
| 1850 | + |
---|
| 1851 | +PHONY += modules modules_install |
---|
| 1852 | + |
---|
| 1853 | +ifdef CONFIG_MODULES |
---|
| 1854 | + |
---|
| 1855 | +modules: $(MODORDER) |
---|
| 1856 | + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost |
---|
| 1857 | + |
---|
| 1858 | +quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) |
---|
| 1859 | + cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \ |
---|
| 1860 | + $(KERNELRELEASE) $(mixed-build-prefix) |
---|
| 1861 | + |
---|
| 1862 | +modules_install: |
---|
| 1863 | + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst |
---|
| 1864 | + $(call cmd,depmod) |
---|
| 1865 | + |
---|
| 1866 | +else # CONFIG_MODULES |
---|
| 1867 | + |
---|
| 1868 | +# Modules not configured |
---|
| 1869 | +# --------------------------------------------------------------------------- |
---|
| 1870 | + |
---|
| 1871 | +modules modules_install: |
---|
| 1872 | + @echo >&2 '***' |
---|
| 1873 | + @echo >&2 '*** The present kernel configuration has modules disabled.' |
---|
| 1874 | + @echo >&2 '*** To use the module feature, please run "make menuconfig" etc.' |
---|
| 1875 | + @echo >&2 '*** to enable CONFIG_MODULES.' |
---|
| 1876 | + @echo >&2 '***' |
---|
| 1877 | + @exit 1 |
---|
| 1878 | + |
---|
| 1879 | +KBUILD_MODULES := |
---|
| 1880 | + |
---|
| 1881 | +endif # CONFIG_MODULES |
---|
| 1882 | + |
---|
1880 | 1883 | # Single targets |
---|
1881 | 1884 | # --------------------------------------------------------------------------- |
---|
1882 | 1885 | # To build individual files in subdirectories, you can do like this: |
---|
.. | .. |
---|
1900 | 1903 | $(single-no-ko): descend |
---|
1901 | 1904 | @: |
---|
1902 | 1905 | |
---|
1903 | | -ifeq ($(KBUILD_EXTMOD),) |
---|
1904 | | -# For the single build of in-tree modules, use a temporary file to avoid |
---|
1905 | | -# the situation of modules_install installing an invalid modules.order. |
---|
1906 | | -MODORDER := .modules.tmp |
---|
1907 | | -endif |
---|
1908 | | - |
---|
| 1906 | +# Remove MODORDER when done because it is not the real one. |
---|
1909 | 1907 | PHONY += single_modpost |
---|
1910 | 1908 | single_modpost: $(single-no-ko) modules_prepare |
---|
1911 | 1909 | $(Q){ $(foreach m, $(single-ko), echo $(extmod-prefix)$m;) } > $(MODORDER) |
---|
1912 | 1910 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost |
---|
1913 | | - |
---|
1914 | | -KBUILD_MODULES := 1 |
---|
| 1911 | + $(Q)rm -f $(MODORDER) |
---|
1915 | 1912 | |
---|
1916 | 1913 | export KBUILD_SINGLE_TARGETS := $(addprefix $(extmod-prefix), $(single-no-ko)) |
---|
1917 | 1914 | |
---|
.. | .. |
---|
1919 | 1916 | build-dirs := $(foreach d, $(build-dirs), \ |
---|
1920 | 1917 | $(if $(filter $(d)/%, $(KBUILD_SINGLE_TARGETS)), $(d))) |
---|
1921 | 1918 | |
---|
1922 | | -endif |
---|
1923 | | - |
---|
1924 | | -ifndef CONFIG_MODULES |
---|
1925 | | -KBUILD_MODULES := |
---|
1926 | 1919 | endif |
---|
1927 | 1920 | |
---|
1928 | 1921 | # Handle descending into subdirectories listed in $(build-dirs) |
---|
.. | .. |
---|
2065 | 2058 | |
---|
2066 | 2059 | quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))) |
---|
2067 | 2060 | cmd_rmfiles = rm -rf $(rm-files) |
---|
2068 | | - |
---|
2069 | | -# Run depmod only if we have System.map and depmod is executable |
---|
2070 | | -quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) |
---|
2071 | | - cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \ |
---|
2072 | | - $(KERNELRELEASE) $(mixed-build-prefix) |
---|
2073 | 2061 | |
---|
2074 | 2062 | # read saved command lines for existing targets |
---|
2075 | 2063 | existing-targets := $(wildcard $(sort $(targets))) |
---|