History

kbuild: Support generated asm-headers in subdirectories

Extend the asm-header stub generation to also handle subdirectories. An upcoming vdso/ header refactoring requires this.

Thomas Weißschuh committed 3 months ago

Commit 2d69b891 parent ecacc9c1 file · +5 −6Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/Makefile.asm-headers+5−6
@@ -48,14 +48,13 @@ syscall-y := $(addprefix $(obj)/, $(syscall-y)) · 47 unmodified lines
4848 generated-y := $(addprefix $(obj)/, $(generated-y))
4949
5050 # Remove stale wrappers when the corresponding files are removed from generic-y
51−old-headers := $(wildcard $(obj)/*.h)
51+old-headers := $(shell test -d $(obj) && find $(obj) -name *.h)
5252 unwanted := $(filter-out $(generic-y) $(generated-y) $(syscall-y),$(old-headers))
5353
54−quiet_cmd_wrap = WRAP $@
55− cmd_wrap = echo "\#include <asm-generic/$*.h>" > $@
54+filechk_wrap = echo "\#include <asm-generic/$*.h>"
5655
5756 quiet_cmd_remove = REMOVE $(unwanted)
58− cmd_remove = rm -f $(unwanted)
57+ cmd_remove = rm -f $(unwanted); find $(obj) -type d -empty -delete
5958
6059 quiet_cmd_syshdr = SYSHDR $@
6160 cmd_syshdr = $(CONFIG_SHELL) $(syshdr) \
@@ -74,8 +73,8 @@ all: $(generic-y) $(syscall-y) · 12 unmodified lines
7473 $(if $(unwanted),$(call cmd,remove))
7574 @:
7675
77−$(obj)/%.h: $(srctree)/$(generic)/%.h
78− $(call cmd,wrap)
76+$(obj)/%.h: $(srctree)/$(generic)/%.h FORCE
77+ $(call filechk,wrap)
7978
8079 $(obj)/unistd_%.h: $(syscalltbl) $(syshdr) FORCE
8180 $(call if_changed,syshdr)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t