Extend the asm-header stub generation to also handle subdirectories. An upcoming vdso/ header refactoring requires this.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -48,14 +48,13 @@ syscall-y := $(addprefix $(obj)/, $(syscall-y)) · 47 unmodified lines | ||
| 48 | 48 | generated-y := $(addprefix $(obj)/, $(generated-y)) |
| 49 | 49 | |
| 50 | 50 | # 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) | |
| 52 | 52 | unwanted := $(filter-out $(generic-y) $(generated-y) $(syscall-y),$(old-headers)) |
| 53 | 53 | |
| 54 | −quiet_cmd_wrap = WRAP $@ | |
| 55 | − cmd_wrap = echo "\#include <asm-generic/$*.h>" > $@ | |
| 54 | +filechk_wrap = echo "\#include <asm-generic/$*.h>" | |
| 56 | 55 | |
| 57 | 56 | quiet_cmd_remove = REMOVE $(unwanted) |
| 58 | − cmd_remove = rm -f $(unwanted) | |
| 57 | + cmd_remove = rm -f $(unwanted); find $(obj) -type d -empty -delete | |
| 59 | 58 | |
| 60 | 59 | quiet_cmd_syshdr = SYSHDR $@ |
| 61 | 60 | cmd_syshdr = $(CONFIG_SHELL) $(syshdr) \ |
| @@ -74,8 +73,8 @@ all: $(generic-y) $(syscall-y) · 12 unmodified lines | ||
| 74 | 73 | $(if $(unwanted),$(call cmd,remove)) |
| 75 | 74 | @: |
| 76 | 75 | |
| 77 | −$(obj)/%.h: $(srctree)/$(generic)/%.h | |
| 78 | − $(call cmd,wrap) | |
| 76 | +$(obj)/%.h: $(srctree)/$(generic)/%.h FORCE | |
| 77 | + $(call filechk,wrap) | |
| 79 | 78 | |
| 80 | 79 | $(obj)/unistd_%.h: $(syscalltbl) $(syshdr) FORCE |
| 81 | 80 | $(call if_changed,syshdr) |