Blame view
scripts/Makefile.asm-generic
1.15 KB
b24413180
|
1 |
# SPDX-License-Identifier: GPL-2.0 |
d8ecc5cd8
|
2 3 4 |
# include/asm-generic contains a lot of files that are used # verbatim by several architectures. # |
64236e315
|
5 |
# This Makefile reads the file arch/$(SRCARCH)/include/$(src)/Kbuild |
d8ecc5cd8
|
6 |
# and for each file listed in this file with generic-y creates |
64236e315
|
7 |
# a small wrapper file in $(obj) (arch/$(SRCARCH)/include/generated/$(src)) |
d8ecc5cd8
|
8 |
|
3c5994c83
|
9 |
kbuild-file := $(srctree)/arch/$(SRCARCH)/include/$(src)/Kbuild |
7a04fc94d
|
10 |
-include $(kbuild-file) |
d8ecc5cd8
|
11 12 13 14 15 |
include scripts/Kbuild.include # Create output directory if not already present _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) |
cda2c65f9
|
16 17 |
# Stale wrappers when the corresponding files are removed from generic-y # need removing. |
ae3f41517
|
18 |
generated-y := $(generic-y) $(generated-y) |
cda2c65f9
|
19 20 21 |
all-files := $(patsubst %, $(obj)/%, $(generated-y)) old-headers := $(wildcard $(obj)/*.h) unwanted := $(filter-out $(all-files),$(old-headers)) |
d8ecc5cd8
|
22 23 |
quiet_cmd_wrap = WRAP $@ cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ |
cda2c65f9
|
24 25 26 27 28 |
quiet_cmd_remove = REMOVE $(unwanted) cmd_remove = rm -f $(unwanted) all: $(patsubst %, $(obj)/%, $(generic-y)) FORCE $(if $(unwanted),$(call cmd,remove),) |
181e97632
|
29 |
@: |
d8ecc5cd8
|
30 31 32 |
$(obj)/%.h: $(call cmd,wrap) |
cda2c65f9
|
33 34 35 36 |
PHONY += FORCE .PHONY: $(PHONY) FORCE: ; |