Back to home page

LXR

 
 

    


0001 # include/asm-generic contains a lot of files that are used
0002 # verbatim by several architectures.
0003 #
0004 # This Makefile reads the file arch/$(SRCARCH)/include/asm/Kbuild
0005 # and for each file listed in this file with generic-y creates
0006 # a small wrapper file in $(obj) (arch/$(SRCARCH)/include/generated/asm)
0007 
0008 kbuild-file := $(srctree)/arch/$(SRCARCH)/include/$(src)/Kbuild
0009 -include $(kbuild-file)
0010 
0011 include scripts/Kbuild.include
0012 
0013 # Create output directory if not already present
0014 _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
0015 
0016 # Stale wrappers when the corresponding files are removed from generic-y
0017 # need removing.
0018 generated-y   := $(generic-y) $(genhdr-y) $(generated-y)
0019 all-files     := $(patsubst %, $(obj)/%, $(generated-y))
0020 old-headers   := $(wildcard $(obj)/*.h)
0021 unwanted      := $(filter-out $(all-files),$(old-headers))
0022 
0023 quiet_cmd_wrap = WRAP    $@
0024 cmd_wrap = echo "\#include <asm-generic/$*.h>" >$@
0025 
0026 quiet_cmd_remove = REMOVE  $(unwanted)
0027 cmd_remove = rm -f $(unwanted)
0028 
0029 all: $(patsubst %, $(obj)/%, $(generic-y)) FORCE
0030         $(if $(unwanted),$(call cmd,remove),)
0031         @:
0032 
0033 $(obj)/%.h:
0034         $(call cmd,wrap)
0035 
0036 PHONY += FORCE
0037 .PHONY: $(PHONY)
0038 FORCE: ;