History

kbuild: rename hostprogs-y/always to hostprogs/always-y

In old days, the "host-progs" syntax was used for specifying host programs. It was renamed to the current "hostprogs-y" in 2004. It is typically useful in scripts/Makefile because it allows Kbuild to selectively compile host programs based on the kernel configuration. This commit renames like follows: always -> always-y hostprogs-y -> hostprogs So, scripts/Makefile will look like this: always-$(CONFIG_BUILD_BIN2C) += ... always-$(CONFIG_KALLSYMS) += ... ... hostprogs := $(always-y) $(always-m) I think this makes more sense because a host program is always a host program, irrespective of the kernel configuration. We want to specify which ones to compile by CONFIG options, so always-y will be handier. The "always", "hostprogs-y", "hostprogs-m" will be kept for backward compatibility for a while.

Masahiro Yamada committed 6 years ago

Commit 5f2fb521 parent faa7bdd49 files · +172 −190Browse files

Unified · Split

49 files
  1. Documentation/kbuild/makefiles.rst +16 −33
  2. Kbuild +4 −4
  3. arch/alpha/boot/Makefile +1 −1
  4. arch/arm/vdso/Makefile +1 −1
  5. arch/arm64/kernel/vdso32/Makefile +2 −2
  6. arch/mips/boot/Makefile +1 −1
  7. arch/mips/boot/compressed/Makefile +2 −2
  8. arch/mips/boot/tools/Makefile +1 −1
  9. arch/mips/tools/Makefile +2 −2
  10. arch/mips/vdso/Makefile +1 −1
  11. arch/powerpc/boot/Makefile +2 −2
  12. arch/s390/tools/Makefile +2 −2
  13. arch/sparc/boot/Makefile +1 −1
  14. arch/sparc/vdso/Makefile +1 −1
  15. arch/x86/boot/Makefile +2 −2
  16. arch/x86/boot/compressed/Makefile +1 −1
  17. arch/x86/entry/vdso/Makefile +1 −1
  18. arch/x86/realmode/rm/Makefile +1 −1
  19. arch/x86/tools/Makefile +2 −2
  20. drivers/gpu/drm/radeon/Makefile +1 −1
  21. drivers/tty/vt/Makefile +1 −1
  22. drivers/video/logo/Makefile +1 −1
  23. drivers/zorro/Makefile +1 −1
  24. fs/unicode/Makefile +1 −1
  25. lib/Makefile +2 −2
  26. lib/raid6/Makefile +1 −1
  27. net/bpfilter/Makefile +1 −1
  28. samples/bpf/Makefile +59 −59
  29. samples/connector/Makefile +2 −6
  30. samples/hidraw/Makefile +2 −4
  31. samples/mei/Makefile +2 −2
  32. samples/pidfd/Makefile +2 −2
  33. samples/seccomp/Makefile +2 −2
  34. samples/uhid/Makefile +2 −2
  35. samples/vfs/Makefile +2 −3
  36. scripts/Makefile +11 −11
  37. scripts/Makefile.build +5 −3
  38. scripts/Makefile.clean +2 −2
  39. scripts/Makefile.host +4 −4
  40. scripts/Makefile.lib +5 −1
  41. scripts/basic/Makefile +2 −2
  42. scripts/dtc/Makefile +2 −2
  43. scripts/gcc-plugins/Makefile +1 −1
  44. scripts/genksyms/Makefile +2 −2
  45. scripts/kconfig/Makefile +5 −5
  46. scripts/mod/Makefile +2 −2
  47. scripts/selinux/genheaders/Makefile +2 −2
  48. scripts/selinux/mdp/Makefile +2 −2
  49. usr/Makefile +1 −1
Documentation/kbuild/makefiles.rst+16−33
@@ -28,7 +28,6 @@ This document describes the Linux kernel Makefiles. · 27 unmodified lines
2828 --- 4.3 Using C++ for host programs
2929 --- 4.4 Controlling compiler options for host programs
3030 --- 4.5 When host programs are actually built
31− --- 4.6 Using hostprogs-$(CONFIG_FOO)
3231
3332 === 5 Kbuild clean infrastructure
3433
@@ -595,11 +594,11 @@ compilation stage. · 560 unmodified lines
595594 Two steps are required in order to use a host executable.
596595
597596 The first step is to tell kbuild that a host program exists. This is
598−done utilising the variable hostprogs-y.
597+done utilising the variable "hostprogs".
599598
600599 The second step is to add an explicit dependency to the executable.
601600 This can be done in two ways. Either add the dependency in a rule,
602−or utilise the variable $(always).
601+or utilise the variable "always-y".
603602 Both possibilities are described in the following.
604603
605604 4.1 Simple Host Program
@@ -612,7 +611,7 @@ Both possibilities are described in the following. · 6 unmodified lines
612611
613612 Example::
614613
615− hostprogs-y := bin2hex
614+ hostprogs := bin2hex
616615
617616 Kbuild assumes in the above example that bin2hex is made from a single
618617 c-source file named bin2hex.c located in the same directory as
@@ -630,7 +629,7 @@ Both possibilities are described in the following. · 11 unmodified lines
630629 Example::
631630
632631 #scripts/lxdialog/Makefile
633− hostprogs-y := lxdialog
632+ hostprogs := lxdialog
634633 lxdialog-objs := checklist.o lxdialog.o
635634
636635 Objects with extension .o are compiled from the corresponding .c
@@ -650,7 +649,7 @@ Both possibilities are described in the following. · 13 unmodified lines
650649 Example::
651650
652651 #scripts/kconfig/Makefile
653− hostprogs-y := qconf
652+ hostprogs := qconf
654653 qconf-cxxobjs := qconf.o
655654
656655 In the example above the executable is composed of the C++ file
@@ -662,7 +661,7 @@ Both possibilities are described in the following. · 5 unmodified lines
662661 Example::
663662
664663 #scripts/kconfig/Makefile
665− hostprogs-y := qconf
664+ hostprogs := qconf
666665 qconf-cxxobjs := qconf.o
667666 qconf-objs := check.o
668667
@@ -710,7 +709,7 @@ Both possibilities are described in the following. · 41 unmodified lines
710709 Example::
711710
712711 #drivers/pci/Makefile
713− hostprogs-y := gen-devlist
712+ hostprogs := gen-devlist
714713 $(obj)/devlist.h: $(src)/pci.ids $(obj)/gen-devlist
715714 ( cd $(obj); ./gen-devlist ) < $<
716715
@@ -718,47 +717,31 @@ Both possibilities are described in the following. · 1 unmodified line
718717 $(obj)/gen-devlist is updated. Note that references to
719718 the host programs in special rules must be prefixed with $(obj).
720719
721− (2) Use $(always)
720+ (2) Use always-y
722721
723722 When there is no suitable special rule, and the host program
724− shall be built when a makefile is entered, the $(always)
723+ shall be built when a makefile is entered, the always-y
725724 variable shall be used.
726725
727726 Example::
728727
729728 #scripts/lxdialog/Makefile
730− hostprogs-y := lxdialog
731− always := $(hostprogs-y)
729+ hostprogs := lxdialog
730+ always-y := $(hostprogs)
732731
733732 This will tell kbuild to build lxdialog even if not referenced in
734733 any rule.
735734
736−4.6 Using hostprogs-$(CONFIG_FOO)
737−---------------------------------
738−
739− A typical pattern in a Kbuild file looks like this:
740−
741− Example::
742−
743− #scripts/Makefile
744− hostprogs-$(CONFIG_KALLSYMS) += kallsyms
745−
746− Kbuild knows about both 'y' for built-in and 'm' for module.
747− So if a config symbol evaluates to 'm', kbuild will still build
748− the binary. In other words, Kbuild handles hostprogs-m exactly
749− like hostprogs-y. But only hostprogs-y is recommended to be used
750− when no CONFIG symbols are involved.
751−
752735 5 Kbuild clean infrastructure
753736 =============================
754737
755738 "make clean" deletes most generated files in the obj tree where the kernel
756739 is compiled. This includes generated files such as host programs.
757−Kbuild knows targets listed in $(hostprogs-y), $(hostprogs-m), $(always),
758−$(extra-y) and $(targets). They are all deleted during "make clean".
759−Files matching the patterns "*.[oas]", "*.ko", plus some additional files
760−generated by kbuild are deleted all over the kernel src tree when
761−"make clean" is executed.
740+Kbuild knows targets listed in $(hostprogs), $(always-y), $(always-m),
741+$(always-), $(extra-y), $(extra-) and $(targets). They are all deleted
742+during "make clean". Files matching the patterns "*.[oas]", "*.ko", plus
743+some additional files generated by kbuild are deleted all over the kernel
744+source tree when "make clean" is executed.
762745
763746 Additional files or directories can be specified in kbuild makefiles by use of
764747 $(clean-files).
Kbuild+4−4
@@ -7,7 +7,7 @@ · 6 unmodified lines
77
88 bounds-file := include/generated/bounds.h
99
10−always := $(bounds-file)
10+always-y := $(bounds-file)
1111 targets := kernel/bounds.s
1212
1313 $(bounds-file): kernel/bounds.s FORCE
@@ -28,7 +28,7 @@ $(timeconst-file): kernel/time/timeconst.bc FORCE · 14 unmodified lines
2828
2929 offsets-file := include/generated/asm-offsets.h
3030
31−always += $(offsets-file)
31+always-y += $(offsets-file)
3232 targets += arch/$(SRCARCH)/kernel/asm-offsets.s
3333
3434 arch/$(SRCARCH)/kernel/asm-offsets.s: $(timeconst-file) $(bounds-file)
@@ -39,7 +39,7 @@ $(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE · 4 unmodified lines
3939 #####
4040 # Check for missing system calls
4141
42−always += missing-syscalls
42+always-y += missing-syscalls
4343
4444 quiet_cmd_syscalls = CALL $<
4545 cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
@@ -50,7 +50,7 @@ missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE · 4 unmodified lines
5050 #####
5151 # Check atomic headers are up-to-date
5252
53−always += old-atomics
53+always-y += old-atomics
5454
5555 quiet_cmd_atomics = CALL $<
5656 cmd_atomics = $(CONFIG_SHELL) $<
arch/alpha/boot/Makefile+1−1
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 # Copyright (C) 1994 by Linus Torvalds
99 #
1010
11−hostprogs-y := tools/mkbb tools/objstrip
11+hostprogs := tools/mkbb tools/objstrip
1212 targets := vmlinux.gz vmlinux \
1313 vmlinux.nh tools/lxboot tools/bootlx tools/bootph \
1414 tools/bootpzh bootloader bootpheader bootpzheader
arch/arm/vdso/Makefile+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 ARCH_REL_TYPE_ABS := R_ARM_JUMP_SLOT|R_ARM_GLOB_DAT|R_ARM_ABS32
66 include $(srctree)/lib/vdso/Makefile
77
8−hostprogs-y := vdsomunge
8+hostprogs := vdsomunge
99
1010 obj-vdso := vgettimeofday.o datapage.o note.o
1111
arch/arm64/kernel/vdso32/Makefile+2−2
@@ -115,9 +115,9 @@ VDSO_LDFLAGS += $(call cc32-ldoption,-fuse-ld=bfd) · 114 unmodified lines
115115
116116 # Borrow vdsomunge.c from the arm vDSO
117117 # We have to use a relative path because scripts/Makefile.host prefixes
118−# $(hostprogs-y) with $(obj)
118+# $(hostprogs) with $(obj)
119119 munge := ../../../arm/vdso/vdsomunge
120−hostprogs-y := $(munge)
120+hostprogs := $(munge)
121121
122122 c-obj-vdso := note.o
123123 c-obj-vdso-gettimeofday := vgettimeofday.o
arch/mips/boot/Makefile+1−1
@@ -21,7 +21,7 @@ endif · 20 unmodified lines
2121 drop-sections := .reginfo .mdebug .comment .note .pdr .options .MIPS.options
2222 strip-flags := $(addprefix --remove-section=,$(drop-sections))
2323
24−hostprogs-y := elf2ecoff
24+hostprogs := elf2ecoff
2525
2626 suffix-y := bin
2727 suffix-$(CONFIG_KERNEL_BZIP2) := bz2
arch/mips/boot/compressed/Makefile+2−2
@@ -84,7 +84,7 @@ $(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE · 83 unmodified lines
8484 HOSTCFLAGS_calc_vmlinuz_load_addr.o += $(LINUXINCLUDE)
8585
8686 # Calculate the load address of the compressed kernel image
87−hostprogs-y := calc_vmlinuz_load_addr
87+hostprogs := calc_vmlinuz_load_addr
8888
8989 ifneq ($(zload-y),)
9090 VMLINUZ_LOAD_ADDRESS := $(zload-y)
@@ -112,7 +112,7 @@ ifdef CONFIG_MACH_DECSTATION · 21 unmodified lines
112112 endif
113113
114114 # elf2ecoff can only handle 32bit image
115−hostprogs-y += ../elf2ecoff
115+hostprogs += ../elf2ecoff
116116
117117 ifdef CONFIG_32BIT
118118 VMLINUZ = vmlinuz
arch/mips/boot/tools/Makefile+1−1
@@ -1,6 +1,6 @@
11 # SPDX-License-Identifier: GPL-2.0
22
3−hostprogs-y += relocs
3+hostprogs += relocs
44 relocs-objs += relocs_32.o
55 relocs-objs += relocs_64.o
66 relocs-objs += relocs_main.o
arch/mips/tools/Makefile+2−2
@@ -1,10 +1,10 @@
11 # SPDX-License-Identifier: GPL-2.0
2−hostprogs-y := elf-entry
2+hostprogs := elf-entry
33 PHONY += elf-entry
44 elf-entry: $(obj)/elf-entry
55 @:
66
7−hostprogs-$(CONFIG_CPU_LOONGSON3_WORKAROUNDS) += loongson3-llsc-check
7+hostprogs += loongson3-llsc-check
88 PHONY += loongson3-llsc-check
99 loongson3-llsc-check: $(obj)/loongson3-llsc-check
1010 @:
arch/mips/vdso/Makefile+1−1
@@ -100,7 +100,7 @@ $(obj)/%.so.raw: OBJCOPYFLAGS := -S · 99 unmodified lines
100100 $(obj)/%.so.raw: $(obj)/%.so.dbg.raw FORCE
101101 $(call if_changed,objcopy)
102102
103−hostprogs-y := genvdso
103+hostprogs := genvdso
104104
105105 quiet_cmd_genvdso = GENVDSO $@
106106 define cmd_genvdso
arch/powerpc/boot/Makefile+2−2
@@ -224,7 +224,7 @@ $(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S FORCE · 223 unmodified lines
224224 $(obj)/wrapper.a: $(obj-wlib) FORCE
225225 $(call if_changed,bootar)
226226
227−hostprogs-y := addnote hack-coff mktree
227+hostprogs := addnote hack-coff mktree
228228
229229 targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
230230 extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
@@ -464,7 +464,7 @@ WRAPPER_BINDIR := /usr/sbin · 233 unmodified lines
464464 INSTALL := install
465465
466466 extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y))
467−hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs-y))
467+hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs))
468468 wrapper-installed := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper
469469 dts-installed := $(patsubst $(dtstree)/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(dtstree)/*.dts))
470470
arch/s390/tools/Makefile+2−2
@@ -10,8 +10,8 @@ PHONY += kapi · 9 unmodified lines
1010
1111 kapi: $(kapi-hdrs-y)
1212
13−hostprogs-y += gen_facilities
14−hostprogs-y += gen_opcode_table
13+hostprogs += gen_facilities
14+hostprogs += gen_opcode_table
1515
1616 HOSTCFLAGS_gen_facilities.o += $(LINUXINCLUDE)
1717
arch/sparc/boot/Makefile+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 ROOT_IMG := /usr/src/root.img
88 ELFTOAOUT := elftoaout
99
10−hostprogs-y := piggyback
10+hostprogs := piggyback
1111 targets := tftpboot.img image zImage vmlinux.aout
1212 clean-files := System.map
1313
arch/sparc/vdso/Makefile+1−1
@@ -41,7 +41,7 @@ $(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE · 40 unmodified lines
4141 $(call if_changed,vdso)
4242
4343 HOST_EXTRACFLAGS += -I$(srctree)/tools/include
44−hostprogs-y += vdso2c
44+hostprogs += vdso2c
4545
4646 quiet_cmd_vdso2c = VDSO2C $@
4747 cmd_vdso2c = $(obj)/vdso2c $< $(<:%.dbg=%) $@
arch/x86/boot/Makefile+2−2
@@ -45,8 +45,8 @@ setup-y += video-vesa.o · 44 unmodified lines
4545 setup-y += video-bios.o
4646
4747 targets += $(setup-y)
48−hostprogs-y := tools/build
49−hostprogs-$(CONFIG_X86_FEATURE_NAMES) += mkcpustr
48+hostprogs := tools/build
49+hostprogs += mkcpustr
5050
5151 HOST_EXTRACFLAGS += -I$(srctree)/tools/include \
5252 -include include/generated/autoconf.h \
arch/x86/boot/compressed/Makefile+1−1
@@ -58,7 +58,7 @@ KBUILD_LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \ · 57 unmodified lines
5858 endif
5959 LDFLAGS_vmlinux := -T
6060
61−hostprogs-y := mkpiggy
61+hostprogs := mkpiggy
6262 HOST_EXTRACFLAGS += -I$(srctree)/tools/include
6363
6464 sed-voffset := -e 's/^\([0-9a-fA-F]*\) [ABCDGRSTVW] \(_text\|__bss_start\|_end\)$$/\#define VO_\2 _AC(0x\1,UL)/p'
arch/x86/entry/vdso/Makefile+1−1
@@ -59,7 +59,7 @@ $(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE · 58 unmodified lines
5959 $(call if_changed,vdso_and_check)
6060
6161 HOST_EXTRACFLAGS += -I$(srctree)/tools/include -I$(srctree)/include/uapi -I$(srctree)/arch/$(SUBARCH)/include/uapi
62−hostprogs-y += vdso2c
62+hostprogs += vdso2c
6363
6464 quiet_cmd_vdso2c = VDSO2C $@
6565 cmd_vdso2c = $(obj)/vdso2c $< $(<:%.dbg=%) $@
arch/x86/realmode/rm/Makefile+1−1
@@ -12,7 +12,7 @@ OBJECT_FILES_NON_STANDARD := y · 11 unmodified lines
1212 # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
1313 KCOV_INSTRUMENT := n
1414
15−always := realmode.bin realmode.relocs
15+always-y := realmode.bin realmode.relocs
1616
1717 wakeup-objs := wakeup_asm.o wakemain.o video-mode.o
1818 wakeup-objs += copy.o bioscall.o regs.o
arch/x86/tools/Makefile+2−2
@@ -26,7 +26,7 @@ posttest: $(obj)/insn_decoder_test vmlinux $(obj)/insn_sanity · 25 unmodified lines
2626 $(call cmd,posttest)
2727 $(call cmd,sanitytest)
2828
29−hostprogs-y += insn_decoder_test insn_sanity
29+hostprogs += insn_decoder_test insn_sanity
3030
3131 # -I needed for generated C source and C source which in the kernel tree.
3232 HOSTCFLAGS_insn_decoder_test.o := -Wall -I$(objtree)/arch/x86/lib/ -I$(srctree)/arch/x86/include/uapi/ -I$(srctree)/arch/x86/include/ -I$(srctree)/arch/x86/lib/ -I$(srctree)/include/uapi/
@@ -39,7 +39,7 @@ $(obj)/insn_decoder_test.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/l · 6 unmodified lines
3939 $(obj)/insn_sanity.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/inat.c $(srctree)/arch/x86/include/asm/inat_types.h $(srctree)/arch/x86/include/asm/inat.h $(srctree)/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c
4040
4141 HOST_EXTRACFLAGS += -I$(srctree)/tools/include
42−hostprogs-y += relocs
42+hostprogs += relocs
4343 relocs-objs := relocs_32.o relocs_64.o relocs_common.o
4444 PHONY += relocs
4545 relocs: $(obj)/relocs
drivers/gpu/drm/radeon/Makefile+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55
66 ccflags-y := -Idrivers/gpu/drm/amd/include
77
8−hostprogs-y := mkregtable
8+hostprogs := mkregtable
99 clean-files := rn50_reg_safe.h r100_reg_safe.h r200_reg_safe.h rv515_reg_safe.h r300_reg_safe.h r420_reg_safe.h rs600_reg_safe.h r600_reg_safe.h evergreen_reg_safe.h cayman_reg_safe.h
1010
1111 quiet_cmd_mkregtable = MKREGTABLE $@
drivers/tty/vt/Makefile+1−1
@@ -12,7 +12,7 @@ obj-$(CONFIG_HW_CONSOLE) += vt.o defkeymap.o · 11 unmodified lines
1212 # Files generated that shall be removed upon make clean
1313 clean-files := consolemap_deftbl.c defkeymap.c
1414
15−hostprogs-y += conmakehash
15+hostprogs += conmakehash
1616
1717 quiet_cmd_conmk = CONMK $@
1818 cmd_conmk = $(obj)/conmakehash $< > $@
drivers/video/logo/Makefile+1−1
@@ -18,7 +18,7 @@ obj-$(CONFIG_SPU_BASE) += logo_spe_clut224.o · 17 unmodified lines
1818
1919 # How to generate logo's
2020
21−hostprogs-y := pnmtologo
21+hostprogs := pnmtologo
2222
2323 # Create commands like "pnmtologo -t mono -n logo_mac_mono -o ..."
2424 quiet_cmd_logo = LOGO $@
drivers/zorro/Makefile+1−1
@@ -7,7 +7,7 @@ obj-$(CONFIG_ZORRO) += zorro.o zorro-driver.o zorro-sysfs.o · 6 unmodified lines
77 obj-$(CONFIG_PROC_FS) += proc.o
88 obj-$(CONFIG_ZORRO_NAMES) += names.o
99
10−hostprogs-y := gen-devlist
10+hostprogs := gen-devlist
1111
1212 # Files generated that shall be removed upon make clean
1313 clean-files := devlist.h
fs/unicode/Makefile+1−1
@@ -35,4 +35,4 @@ $(obj)/utf8data.h: $(src)/utf8data.h_shipped FORCE · 34 unmodified lines
3535 endif
3636
3737 targets += utf8data.h
38−hostprogs-y += mkutf8data
38+hostprogs += mkutf8data
lib/Makefile+2−2
@@ -239,8 +239,8 @@ obj-$(CONFIG_ASN1) += asn1_decoder.o · 238 unmodified lines
239239
240240 obj-$(CONFIG_FONT_SUPPORT) += fonts/
241241
242−hostprogs-y := gen_crc32table
243−hostprogs-y += gen_crc64table
242+hostprogs := gen_crc32table
243+hostprogs += gen_crc64table
244244 clean-files := crc32table.h
245245 clean-files += crc64table.h
246246
lib/raid6/Makefile+1−1
@@ -10,7 +10,7 @@ raid6_pq-$(CONFIG_ALTIVEC) += altivec1.o altivec2.o altivec4.o altivec8.o \ · 9 unmodified lines
1010 raid6_pq-$(CONFIG_KERNEL_MODE_NEON) += neon.o neon1.o neon2.o neon4.o neon8.o recov_neon.o recov_neon_inner.o
1111 raid6_pq-$(CONFIG_S390) += s390vx8.o recov_s390xc.o
1212
13−hostprogs-y += mktables
13+hostprogs += mktables
1414
1515 ifeq ($(CONFIG_ALTIVEC),y)
1616 altivec_flags := -maltivec $(call cc-option,-mabi=altivec)
net/bpfilter/Makefile+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 # Makefile for the Linux BPFILTER layer.
44 #
55
6−hostprogs-y := bpfilter_umh
6+hostprogs := bpfilter_umh
77 bpfilter_umh-objs := main.o
88 KBUILD_HOSTCFLAGS += -I $(srctree)/tools/include/ -I $(srctree)/tools/include/uapi
99 HOSTCC := $(CC)
samples/bpf/Makefile+59−59
@@ -111,65 +111,65 @@ ibumad-objs := bpf_load.o ibumad_user.o $(TRACE_HELPERS) · 110 unmodified lines
111111 hbm-objs := bpf_load.o hbm.o $(CGROUP_HELPERS)
112112
113113 # Tell kbuild to always build the programs
114−always := $(tprogs-y)
115−always += sockex1_kern.o
116−always += sockex2_kern.o
117−always += sockex3_kern.o
118−always += tracex1_kern.o
119−always += tracex2_kern.o
120−always += tracex3_kern.o
121−always += tracex4_kern.o
122−always += tracex5_kern.o
123−always += tracex6_kern.o
124−always += tracex7_kern.o
125−always += sock_flags_kern.o
126−always += test_probe_write_user_kern.o
127−always += trace_output_kern.o
128−always += tcbpf1_kern.o
129−always += tc_l2_redirect_kern.o
130−always += lathist_kern.o
131−always += offwaketime_kern.o
132−always += spintest_kern.o
133−always += map_perf_test_kern.o
134−always += test_overhead_tp_kern.o
135−always += test_overhead_raw_tp_kern.o
136−always += test_overhead_kprobe_kern.o
137−always += parse_varlen.o parse_simple.o parse_ldabs.o
138−always += test_cgrp2_tc_kern.o
139−always += xdp1_kern.o
140−always += xdp2_kern.o
141−always += xdp_router_ipv4_kern.o
142−always += test_current_task_under_cgroup_kern.o
143−always += trace_event_kern.o
144−always += sampleip_kern.o
145−always += lwt_len_hist_kern.o
146−always += xdp_tx_iptunnel_kern.o
147−always += test_map_in_map_kern.o
148−always += tcp_synrto_kern.o
149−always += tcp_rwnd_kern.o
150−always += tcp_bufs_kern.o
151−always += tcp_cong_kern.o
152−always += tcp_iw_kern.o
153−always += tcp_clamp_kern.o
154−always += tcp_basertt_kern.o
155−always += tcp_tos_reflect_kern.o
156−always += tcp_dumpstats_kern.o
157−always += xdp_redirect_kern.o
158−always += xdp_redirect_map_kern.o
159−always += xdp_redirect_cpu_kern.o
160−always += xdp_monitor_kern.o
161−always += xdp_rxq_info_kern.o
162−always += xdp2skb_meta_kern.o
163−always += syscall_tp_kern.o
164−always += cpustat_kern.o
165−always += xdp_adjust_tail_kern.o
166−always += xdp_fwd_kern.o
167−always += task_fd_query_kern.o
168−always += xdp_sample_pkts_kern.o
169−always += ibumad_kern.o
170−always += hbm_out_kern.o
171−always += hbm_edt_kern.o
172−always += xdpsock_kern.o
114+always-y := $(tprogs-y)
115+always-y += sockex1_kern.o
116+always-y += sockex2_kern.o
117+always-y += sockex3_kern.o
118+always-y += tracex1_kern.o
119+always-y += tracex2_kern.o
120+always-y += tracex3_kern.o
121+always-y += tracex4_kern.o
122+always-y += tracex5_kern.o
123+always-y += tracex6_kern.o
124+always-y += tracex7_kern.o
125+always-y += sock_flags_kern.o
126+always-y += test_probe_write_user_kern.o
127+always-y += trace_output_kern.o
128+always-y += tcbpf1_kern.o
129+always-y += tc_l2_redirect_kern.o
130+always-y += lathist_kern.o
131+always-y += offwaketime_kern.o
132+always-y += spintest_kern.o
133+always-y += map_perf_test_kern.o
134+always-y += test_overhead_tp_kern.o
135+always-y += test_overhead_raw_tp_kern.o
136+always-y += test_overhead_kprobe_kern.o
137+always-y += parse_varlen.o parse_simple.o parse_ldabs.o
138+always-y += test_cgrp2_tc_kern.o
139+always-y += xdp1_kern.o
140+always-y += xdp2_kern.o
141+always-y += xdp_router_ipv4_kern.o
142+always-y += test_current_task_under_cgroup_kern.o
143+always-y += trace_event_kern.o
144+always-y += sampleip_kern.o
145+always-y += lwt_len_hist_kern.o
146+always-y += xdp_tx_iptunnel_kern.o
147+always-y += test_map_in_map_kern.o
148+always-y += tcp_synrto_kern.o
149+always-y += tcp_rwnd_kern.o
150+always-y += tcp_bufs_kern.o
151+always-y += tcp_cong_kern.o
152+always-y += tcp_iw_kern.o
153+always-y += tcp_clamp_kern.o
154+always-y += tcp_basertt_kern.o
155+always-y += tcp_tos_reflect_kern.o
156+always-y += tcp_dumpstats_kern.o
157+always-y += xdp_redirect_kern.o
158+always-y += xdp_redirect_map_kern.o
159+always-y += xdp_redirect_cpu_kern.o
160+always-y += xdp_monitor_kern.o
161+always-y += xdp_rxq_info_kern.o
162+always-y += xdp2skb_meta_kern.o
163+always-y += syscall_tp_kern.o
164+always-y += cpustat_kern.o
165+always-y += xdp_adjust_tail_kern.o
166+always-y += xdp_fwd_kern.o
167+always-y += task_fd_query_kern.o
168+always-y += xdp_sample_pkts_kern.o
169+always-y += ibumad_kern.o
170+always-y += hbm_out_kern.o
171+always-y += hbm_edt_kern.o
172+always-y += xdpsock_kern.o
173173
174174 ifeq ($(ARCH), arm)
175175 # Strip all except -D__LINUX_ARM_ARCH__ option needed to handle linux
samples/connector/Makefile+2−6
@@ -2,12 +2,8 @@ · 1 unmodified line
22 obj-$(CONFIG_SAMPLE_CONNECTOR) += cn_test.o
33
44 # List of programs to build
5−ifdef CONFIG_SAMPLE_CONNECTOR
6−hostprogs-y := ucon
7−endif
8−
9−# Tell kbuild to always build the programs
10−always := $(hostprogs-y)
5+hostprogs := ucon
6+always-y := $(hostprogs)
117
128 HOSTCFLAGS_ucon.o += -I$(objtree)/usr/include
139
samples/hidraw/Makefile+2−4
@@ -1,9 +1,7 @@
11 # SPDX-License-Identifier: GPL-2.0
22 # List of programs to build
3−hostprogs-y := hid-example
4−
5−# Tell kbuild to always build the programs
6−always := $(hostprogs-y)
3+hostprogs := hid-example
4+always-y := $(hostprogs)
75
86 HOSTCFLAGS_hid-example.o += -I$(objtree)/usr/include
97
samples/mei/Makefile+2−2
@@ -1,10 +1,10 @@
11 # SPDX-License-Identifier: GPL-2.0
22 # Copyright (c) 2012-2019, Intel Corporation. All rights reserved.
33
4−hostprogs-y := mei-amt-version
4+hostprogs := mei-amt-version
55
66 HOSTCFLAGS_mei-amt-version.o += -I$(objtree)/usr/include
77
8−always := $(hostprogs-y)
8+always-y := $(hostprogs)
99
1010 all: mei-amt-version
samples/pidfd/Makefile+2−2
@@ -1,6 +1,6 @@
11 # SPDX-License-Identifier: GPL-2.0
22
3−hostprogs-y := pidfd-metadata
4−always := $(hostprogs-y)
3+hostprogs := pidfd-metadata
4+always-y := $(hostprogs)
55 HOSTCFLAGS_pidfd-metadata.o += -I$(objtree)/usr/include
66 all: pidfd-metadata
samples/seccomp/Makefile+2−2
@@ -1,6 +1,6 @@
11 # SPDX-License-Identifier: GPL-2.0
22 ifndef CROSS_COMPILE
3−hostprogs-y := bpf-fancy dropper bpf-direct user-trap
3+hostprogs := bpf-fancy dropper bpf-direct user-trap
44
55 HOSTCFLAGS_bpf-fancy.o += -I$(objtree)/usr/include
66 HOSTCFLAGS_bpf-fancy.o += -idirafter $(objtree)/include
@@ -40,5 +40,5 @@ HOSTLDLIBS_bpf-fancy += $(MFLAG) · 33 unmodified lines
4040 HOSTLDLIBS_dropper += $(MFLAG)
4141 HOSTLDLIBS_user-trap += $(MFLAG)
4242 endif
43−always := $(hostprogs-y)
43+always-y := $(hostprogs)
4444 endif
samples/uhid/Makefile+2−2
@@ -1,8 +1,8 @@
11 # SPDX-License-Identifier: GPL-2.0-only
22 # List of programs to build
3−hostprogs-y := uhid-example
3+hostprogs := uhid-example
44
55 # Tell kbuild to always build the programs
6−always := $(hostprogs-y)
6+always-y := $(hostprogs)
77
88 HOSTCFLAGS_uhid-example.o += -I$(objtree)/usr/include
samples/vfs/Makefile+2−3
@@ -1,11 +1,10 @@
11 # SPDX-License-Identifier: GPL-2.0-only
22 # List of programs to build
3−hostprogs-y := \
3+hostprogs := \
44 test-fsmount \
55 test-statx
66
7−# Tell kbuild to always build the programs
8−always := $(hostprogs-y)
7+always-y := $(hostprogs)
98
109 HOSTCFLAGS_test-fsmount.o += -I$(objtree)/usr/include
1110 HOSTCFLAGS_test-statx.o += -I$(objtree)/usr/include
scripts/Makefile+11−11
@@ -7,14 +7,14 @@ · 6 unmodified lines
77
88 HOST_EXTRACFLAGS += -I$(srctree)/tools/include
99
10−hostprogs-$(CONFIG_BUILD_BIN2C) += bin2c
11−hostprogs-$(CONFIG_KALLSYMS) += kallsyms
12−hostprogs-$(BUILD_C_RECORDMCOUNT) += recordmcount
13−hostprogs-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable
14−hostprogs-$(CONFIG_ASN1) += asn1_compiler
15−hostprogs-$(CONFIG_MODULE_SIG_FORMAT) += sign-file
16−hostprogs-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert
17−hostprogs-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
10+always-$(CONFIG_BUILD_BIN2C) += bin2c
11+always-$(CONFIG_KALLSYMS) += kallsyms
12+always-$(BUILD_C_RECORDMCOUNT) += recordmcount
13+always-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable
14+always-$(CONFIG_ASN1) += asn1_compiler
15+always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file
16+always-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert
17+always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
1818
1919 HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include
2020 HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
@@ -30,10 +30,10 @@ HOSTCFLAGS_sorttable.o += -DUNWINDER_ORC_ENABLED · 9 unmodified lines
3030 HOSTLDLIBS_sorttable = -lpthread
3131 endif
3232
33−always := $(hostprogs-y) $(hostprogs-m)
33+hostprogs := $(always-y) $(always-m)
3434
35−# The following hostprogs-y programs are only build on demand
36−hostprogs-y += unifdef
35+# The following programs are only built on demand
36+hostprogs += unifdef
3737
3838 subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins
3939 subdir-$(CONFIG_MODVERSIONS) += genksyms
scripts/Makefile.build+5−3
@@ -16,6 +16,8 @@ obj-m := · 15 unmodified lines
1616 lib-y :=
1717 lib-m :=
1818 always :=
19+always-y :=
20+always-m :=
1921 targets :=
2022 subdir-y :=
2123 subdir-m :=
@@ -44,7 +46,7 @@ include $(kbuild-file) · 22 unmodified lines
4446 include scripts/Makefile.lib
4547
4648 # Do not include host rules unless needed
47−ifneq ($(hostprogs-y)$(hostprogs-m)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),)
49+ifneq ($(hostprogs)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),)
4850 include scripts/Makefile.host
4951 endif
5052
@@ -348,7 +350,7 @@ $(obj)/%.o: $(src)/%.S $(objtool_dep) FORCE · 297 unmodified lines
348350 $(call if_changed_rule,as_o_S)
349351
350352 targets += $(filter-out $(subdir-obj-y), $(real-obj-y)) $(real-obj-m) $(lib-y)
351−targets += $(extra-y) $(MAKECMDGOALS) $(always)
353+targets += $(extra-y) $(always-y) $(MAKECMDGOALS)
352354
353355 # Linker scripts preprocessor (.lds.S -> .lds)
354356 # ---------------------------------------------------------------------------
@@ -490,7 +492,7 @@ else · 135 unmodified lines
490492
491493 __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
492494 $(if $(KBUILD_MODULES),$(obj-m) $(mod-targets) $(modorder-target)) \
493− $(subdir-ym) $(always)
495+ $(subdir-ym) $(always-y)
494496 @:
495497
496498 endif
scripts/Makefile.clean+2−2
@@ -28,8 +28,8 @@ subdir-ymn := $(addprefix $(obj)/,$(subdir-ymn)) · 27 unmodified lines
2828 # directory
2929
3030 __clean-files := $(extra-y) $(extra-m) $(extra-) \
31− $(always) $(targets) $(clean-files) \
32− $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \
31+ $(always) $(always-y) $(always-m) $(always-) $(targets) $(clean-files) \
32+ $(hostprogs) $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \
3333 $(hostlibs-y) $(hostlibs-m) $(hostlibs-) \
3434 $(hostcxxlibs-y) $(hostcxxlibs-m)
3535
scripts/Makefile.host+4−4
@@ -24,21 +24,21 @@ $(obj)/%.tab.c $(obj)/%.tab.h: $(src)/%.y FORCE · 23 unmodified lines
2424 # Both C and C++ are supported, but preferred language is C for such utilities.
2525 #
2626 # Sample syntax (see Documentation/kbuild/makefiles.rst for reference)
27−# hostprogs-y := bin2hex
27+# hostprogs := bin2hex
2828 # Will compile bin2hex.c and create an executable named bin2hex
2929 #
30−# hostprogs-y := lxdialog
30+# hostprogs := lxdialog
3131 # lxdialog-objs := checklist.o lxdialog.o
3232 # Will compile lxdialog.c and checklist.c, and then link the executable
3333 # lxdialog, based on checklist.o and lxdialog.o
3434 #
35−# hostprogs-y := qconf
35+# hostprogs := qconf
3636 # qconf-cxxobjs := qconf.o
3737 # qconf-objs := menu.o
3838 # Will compile qconf as a C++ program, and menu as a C program.
3939 # They are linked as C++ code to the executable qconf
4040
41−__hostprogs := $(sort $(hostprogs-y) $(hostprogs-m))
41+__hostprogs := $(sort $(hostprogs))
4242 host-cshlib := $(sort $(hostlibs-y) $(hostlibs-m))
4343 host-cxxshlib := $(sort $(hostcxxlibs-y) $(hostcxxlibs-m))
4444
scripts/Makefile.lib+5−1
@@ -4,6 +4,8 @@ asflags-y += $(EXTRA_AFLAGS) · 3 unmodified lines
44 ccflags-y += $(EXTRA_CFLAGS)
55 cppflags-y += $(EXTRA_CPPFLAGS)
66 ldflags-y += $(EXTRA_LDFLAGS)
7+always-y += $(always)
8+hostprogs += $(hostprogs-y) $(hostprogs-m)
79
810 # flags that take effect in current and sub directories
911 KBUILD_AFLAGS += $(subdir-asflags-y)
@@ -59,6 +61,8 @@ subdir-obj-y := $(filter %/built-in.a, $(obj-y)) · 49 unmodified lines
5961 real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m)))
6062 real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m)))
6163
64+always-y += $(always-m)
65+
6266 # DTB
6367 # If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built
6468 extra-y += $(dtb-y)
@@ -72,7 +76,7 @@ endif · 7 unmodified lines
7276 # Add subdir path
7377
7478 extra-y := $(addprefix $(obj)/,$(extra-y))
75−always := $(addprefix $(obj)/,$(always))
79+always-y := $(addprefix $(obj)/,$(always-y))
7680 targets := $(addprefix $(obj)/,$(targets))
7781 modorder := $(addprefix $(obj)/,$(modorder))
7882 obj-m := $(addprefix $(obj)/,$(obj-m))
scripts/basic/Makefile+2−2
@@ -2,5 +2,5 @@ · 1 unmodified line
22 #
33 # fixdep: used to generate dependency information during build process
44
5−hostprogs-y := fixdep
6−always := $(hostprogs-y)
5+hostprogs := fixdep
6+always-y := $(hostprogs)
scripts/dtc/Makefile+2−2
@@ -1,8 +1,8 @@
11 # SPDX-License-Identifier: GPL-2.0
22 # scripts/dtc makefile
33
4−hostprogs-$(CONFIG_DTC) := dtc
5−always := $(hostprogs-y)
4+hostprogs := dtc
5+always-$(CONFIG_DTC) := $(hostprogs)
66
77 dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
88 srcpos.o checks.o util.o
scripts/gcc-plugins/Makefile+1−1
@@ -23,7 +23,7 @@ $(objtree)/$(obj)/randomize_layout_seed.h: FORCE · 22 unmodified lines
2323 targets = randomize_layout_seed.h randomize_layout_hash.h
2424
2525 $(HOSTLIBS)-y := $(foreach p,$(GCC_PLUGIN),$(if $(findstring /,$(p)),,$(p)))
26−always := $($(HOSTLIBS)-y)
26+always-y := $($(HOSTLIBS)-y)
2727
2828 $(foreach p,$($(HOSTLIBS)-y:%.so=%),$(eval $(p)-objs := $(p).o))
2929
scripts/genksyms/Makefile+2−2
@@ -1,7 +1,7 @@
11 # SPDX-License-Identifier: GPL-2.0
22
3−hostprogs-y := genksyms
4−always := $(hostprogs-y)
3+hostprogs := genksyms
4+always-y := $(hostprogs)
55
66 genksyms-objs := genksyms.o parse.tab.o lex.lex.o
77
scripts/kconfig/Makefile+5−5
@@ -157,11 +157,11 @@ HOSTCFLAGS_lexer.lex.o := -I $(srctree)/$(src) · 156 unmodified lines
157157 HOSTCFLAGS_parser.tab.o := -I $(srctree)/$(src)
158158
159159 # conf: Used for defconfig, oldconfig and related targets
160−hostprogs-y += conf
160+hostprogs += conf
161161 conf-objs := conf.o $(common-objs)
162162
163163 # nconf: Used for the nconfig target based on ncurses
164−hostprogs-y += nconf
164+hostprogs += nconf
165165 nconf-objs := nconf.o nconf.gui.o $(common-objs)
166166
167167 HOSTLDLIBS_nconf = $(shell . $(obj)/nconf-cfg && echo $$libs)
@@ -171,7 +171,7 @@ HOSTCFLAGS_nconf.gui.o = $(shell . $(obj)/nconf-cfg && echo $$cflags) · 3 unmodified lines
171171 $(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/nconf-cfg
172172
173173 # mconf: Used for the menuconfig target based on lxdialog
174−hostprogs-y += mconf
174+hostprogs += mconf
175175 lxdialog := $(addprefix lxdialog/, \
176176 checklist.o inputbox.o menubox.o textbox.o util.o yesno.o)
177177 mconf-objs := mconf.o $(lxdialog) $(common-objs)
@@ -183,7 +183,7 @@ $(foreach f, mconf.o $(lxdialog), \ · 5 unmodified lines
183183 $(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/mconf-cfg
184184
185185 # qconf: Used for the xconfig target based on Qt
186−hostprogs-y += qconf
186+hostprogs += qconf
187187 qconf-cxxobjs := qconf.o
188188 qconf-objs := images.o $(common-objs)
189189
@@ -199,7 +199,7 @@ $(obj)/%.moc: $(src)/%.h $(obj)/qconf-cfg · 9 unmodified lines
199199 $(call cmd,moc)
200200
201201 # gconf: Used for the gconfig target based on GTK+
202−hostprogs-y += gconf
202+hostprogs += gconf
203203 gconf-objs := gconf.o images.o $(common-objs)
204204
205205 HOSTLDLIBS_gconf = $(shell . $(obj)/gconf-cfg && echo $$libs)
scripts/mod/Makefile+2−2
@@ -1,8 +1,8 @@
11 # SPDX-License-Identifier: GPL-2.0
22 OBJECT_FILES_NON_STANDARD := y
33
4−hostprogs-y := modpost mk_elfconfig
5−always := $(hostprogs-y) empty.o
4+hostprogs := modpost mk_elfconfig
5+always-y := $(hostprogs) empty.o
66
77 modpost-objs := modpost.o file2alias.o sumversion.o
88
scripts/selinux/genheaders/Makefile+2−2
@@ -1,7 +1,7 @@
11 # SPDX-License-Identifier: GPL-2.0
2−hostprogs-y := genheaders
2+hostprogs := genheaders
33 HOST_EXTRACFLAGS += \
44 -I$(srctree)/include/uapi -I$(srctree)/include \
55 -I$(srctree)/security/selinux/include
66
7−always := $(hostprogs-y)
7+always-y := $(hostprogs)
scripts/selinux/mdp/Makefile+2−2
@@ -1,8 +1,8 @@
11 # SPDX-License-Identifier: GPL-2.0
2−hostprogs-y := mdp
2+hostprogs := mdp
33 HOST_EXTRACFLAGS += \
44 -I$(srctree)/include/uapi -I$(srctree)/include \
55 -I$(srctree)/security/selinux/include -I$(objtree)/include
66
7−always := $(hostprogs-y)
7+always-y := $(hostprogs)
88 clean-files := policy.* file_contexts
usr/Makefile+1−1
@@ -52,7 +52,7 @@ ifeq ($(cpio-data),) · 51 unmodified lines
5252
5353 cpio-data := $(obj)/initramfs_data.cpio
5454
55−hostprogs-y := gen_init_cpio
55+hostprogs := gen_init_cpio
5656
5757 # .initramfs_data.cpio.d is used to identify all files included
5858 # in initramfs and to detect if any files are added/removed.