^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) # SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) OBJECT_FILES_NON_STANDARD := y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) CFLAGS_REMOVE_empty.o += $(CC_FLAGS_LTO)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) hostprogs-always-y += modpost mk_elfconfig
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) always-y += empty.o
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) modpost-objs := modpost.o file2alias.o sumversion.o
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) devicetable-offsets-file := devicetable-offsets.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) $(obj)/$(devicetable-offsets-file): $(obj)/devicetable-offsets.s FORCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) $(call filechk,offsets,__DEVICETABLE_OFFSETS_H__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) targets += $(devicetable-offsets-file) devicetable-offsets.s
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) # dependencies on generated files need to be listed explicitly
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) $(obj)/modpost.o $(obj)/file2alias.o $(obj)/sumversion.o: $(obj)/elfconfig.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) $(obj)/file2alias.o: $(obj)/$(devicetable-offsets-file)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) quiet_cmd_elfconfig = MKELF $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) cmd_elfconfig = $(obj)/mk_elfconfig < $< > $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) $(obj)/elfconfig.h: $(obj)/empty.o $(obj)/mk_elfconfig FORCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) $(call if_changed,elfconfig)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) targets += elfconfig.h