Blame view
scripts/Makefile.asm-generic
1.17 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 |
|
a7d34df3d
|
9 10 |
PHONY := all all: |
3c5994c83
|
11 |
kbuild-file := $(srctree)/arch/$(SRCARCH)/include/$(src)/Kbuild |
7a04fc94d
|
12 |
-include $(kbuild-file) |
d8ecc5cd8
|
13 14 15 16 17 |
include scripts/Kbuild.include # Create output directory if not already present _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) |
cda2c65f9
|
18 19 |
# Stale wrappers when the corresponding files are removed from generic-y # need removing. |
ae3f41517
|
20 |
generated-y := $(generic-y) $(generated-y) |
cda2c65f9
|
21 22 23 |
all-files := $(patsubst %, $(obj)/%, $(generated-y)) old-headers := $(wildcard $(obj)/*.h) unwanted := $(filter-out $(all-files),$(old-headers)) |
d8ecc5cd8
|
24 25 |
quiet_cmd_wrap = WRAP $@ cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@ |
cda2c65f9
|
26 27 28 29 30 |
quiet_cmd_remove = REMOVE $(unwanted) cmd_remove = rm -f $(unwanted) all: $(patsubst %, $(obj)/%, $(generic-y)) FORCE $(if $(unwanted),$(call cmd,remove),) |
181e97632
|
31 |
@: |
d8ecc5cd8
|
32 33 34 |
$(obj)/%.h: $(call cmd,wrap) |
cda2c65f9
|
35 36 37 38 |
PHONY += FORCE .PHONY: $(PHONY) FORCE: ; |