Root/
Source at commit b05a5adf03613de371c77c3235f7d970d7cd0c71 created 13 years 1 month ago. By Lars-Peter Clausen, NAND: Optimize reading the eec data for the JZ4740 (evil hack) | |
---|---|
1 | # ========================================================================== |
2 | # Installing headers |
3 | # |
4 | # header-y - list files to be installed. They are preprocessed |
5 | # to remove __KERNEL__ section of the file |
6 | # objhdr-y - Same as header-y but for generated files |
7 | # |
8 | # ========================================================================== |
9 | |
10 | # called may set destination dir (when installing to asm/) |
11 | _dst := $(if $(dst),$(dst),$(obj)) |
12 | |
13 | kbuild-file := $(srctree)/$(obj)/Kbuild |
14 | include $(kbuild-file) |
15 | |
16 | _dst := $(if $(destination-y),$(destination-y),$(_dst)) |
17 | |
18 | include scripts/Kbuild.include |
19 | |
20 | install := $(INSTALL_HDR_PATH)/$(_dst) |
21 | |
22 | header-y := $(sort $(header-y)) |
23 | subdirs := $(patsubst %/,%,$(filter %/, $(header-y))) |
24 | header-y := $(filter-out %/, $(header-y)) |
25 | |
26 | # files used to track state of install/check |
27 | install-file := $(install)/.install |
28 | check-file := $(install)/.check |
29 | |
30 | # all headers files for this dir |
31 | all-files := $(header-y) $(objhdr-y) |
32 | input-files := $(addprefix $(srctree)/$(obj)/,$(header-y)) \ |
33 | $(addprefix $(objtree)/$(obj)/,$(objhdr-y)) |
34 | output-files := $(addprefix $(install)/, $(all-files)) |
35 | |
36 | # Work out what needs to be removed |
37 | oldheaders := $(patsubst $(install)/%,%,$(wildcard $(install)/*.h)) |
38 | unwanted := $(filter-out $(all-files),$(oldheaders)) |
39 | |
40 | # Prefix unwanted with full paths to $(INSTALL_HDR_PATH) |
41 | unwanted-file := $(addprefix $(install)/, $(unwanted)) |
42 | |
43 | printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@)) |
44 | |
45 | quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\ |
46 | file$(if $(word 2, $(all-files)),s)) |
47 | cmd_install = \ |
48 | $(PERL) $< $(srctree)/$(obj) $(install) $(SRCARCH) $(header-y); \ |
49 | $(PERL) $< $(objtree)/$(obj) $(install) $(SRCARCH) $(objhdr-y); \ |
50 | touch $@ |
51 | |
52 | quiet_cmd_remove = REMOVE $(unwanted) |
53 | cmd_remove = rm -f $(unwanted-file) |
54 | |
55 | quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files) |
56 | # Headers list can be pretty long, xargs helps to avoid |
57 | # the "Argument list too long" error. |
58 | cmd_check = for f in $(all-files); do \ |
59 | echo "$(install)/$${f}"; done \ |
60 | | xargs \ |
61 | $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH); \ |
62 | touch $@ |
63 | |
64 | PHONY += __headersinst __headerscheck |
65 | |
66 | ifndef HDRCHECK |
67 | # Rules for installing headers |
68 | __headersinst: $(subdirs) $(install-file) |
69 | @: |
70 | |
71 | targets += $(install-file) |
72 | $(install-file): scripts/headers_install.pl $(input-files) FORCE |
73 | $(if $(unwanted),$(call cmd,remove),) |
74 | $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@))) |
75 | $(call if_changed,install) |
76 | |
77 | else |
78 | __headerscheck: $(subdirs) $(check-file) |
79 | @: |
80 | |
81 | targets += $(check-file) |
82 | $(check-file): scripts/headers_check.pl $(output-files) FORCE |
83 | $(call if_changed,check) |
84 | |
85 | endif |
86 | |
87 | # Recursion |
88 | hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj |
89 | .PHONY: $(subdirs) |
90 | $(subdirs): |
91 | $(Q)$(MAKE) $(hdr-inst)=$(obj)/$@ dst=$(_dst)/$@ |
92 | |
93 | targets := $(wildcard $(sort $(targets))) |
94 | cmd_files := $(wildcard \ |
95 | $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd)) |
96 | |
97 | ifneq ($(cmd_files),) |
98 | include $(cmd_files) |
99 | endif |
100 | |
101 | .PHONY: $(PHONY) |
102 | PHONY += FORCE |
103 | FORCE: ; |
104 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9