aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2007-05-06 03:23:45 -0400
committerSam Ravnborg <sam@ravnborg.org>2007-05-06 03:23:45 -0400
commit767e581d759fe6adfef5e676cd1cd8e11f603d1a (patch)
treef208026e00ace8ba32cc4f9c1fc6168af329c167 /scripts/Makefile.build
parent5447d34b080a1e3e312b05a91e87eff4710a1152 (diff)
kbuild: enable use of code from a different dir
To introduce support for source in one directory but output files in another directory during a non O= build prefix all paths with $(src) repsectively $(obj). Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r--scripts/Makefile.build19
1 files changed, 9 insertions, 10 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index e2ad2dccccdb..a525112847fd 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -131,13 +131,13 @@ $(multi-objs-y:.o=.lst) : modname = $(modname-multi)
131quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ 131quiet_cmd_cc_s_c = CC $(quiet_modtag) $@
132cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $< 132cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $<
133 133
134%.s: %.c FORCE 134$(obj)/%.s: $(src)/%.c FORCE
135 $(call if_changed_dep,cc_s_c) 135 $(call if_changed_dep,cc_s_c)
136 136
137quiet_cmd_cc_i_c = CPP $(quiet_modtag) $@ 137quiet_cmd_cc_i_c = CPP $(quiet_modtag) $@
138cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $< 138cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $<
139 139
140%.i: %.c FORCE 140$(obj)/%.i: $(src)/%.c FORCE
141 $(call if_changed_dep,cc_i_c) 141 $(call if_changed_dep,cc_i_c)
142 142
143quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@ 143quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@
@@ -146,7 +146,7 @@ cmd_cc_symtypes_c = \
146 | $(GENKSYMS) -T $@ >/dev/null; \ 146 | $(GENKSYMS) -T $@ >/dev/null; \
147 test -s $@ || rm -f $@ 147 test -s $@ || rm -f $@
148 148
149%.symtypes : %.c FORCE 149$(obj)/%.symtypes : $(src)/%.c FORCE
150 $(call if_changed_dep,cc_symtypes_c) 150 $(call if_changed_dep,cc_symtypes_c)
151 151
152# C (.c) files 152# C (.c) files
@@ -198,14 +198,13 @@ define rule_cc_o_c
198endef 198endef
199 199
200# Built-in and composite module parts 200# Built-in and composite module parts
201 201$(obj)/%.o: $(src)/%.c FORCE
202%.o: %.c FORCE
203 $(call cmd,force_checksrc) 202 $(call cmd,force_checksrc)
204 $(call if_changed_rule,cc_o_c) 203 $(call if_changed_rule,cc_o_c)
205 204
206# Single-part modules are special since we need to mark them in $(MODVERDIR) 205# Single-part modules are special since we need to mark them in $(MODVERDIR)
207 206
208$(single-used-m): %.o: %.c FORCE 207$(single-used-m): $(obj)/%.o: $(src)/%.c FORCE
209 $(call cmd,force_checksrc) 208 $(call cmd,force_checksrc)
210 $(call if_changed_rule,cc_o_c) 209 $(call if_changed_rule,cc_o_c)
211 @{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod) 210 @{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod)
@@ -215,7 +214,7 @@ quiet_cmd_cc_lst_c = MKLST $@
215 $(CONFIG_SHELL) $(srctree)/scripts/makelst $*.o \ 214 $(CONFIG_SHELL) $(srctree)/scripts/makelst $*.o \
216 System.map $(OBJDUMP) > $@ 215 System.map $(OBJDUMP) > $@
217 216
218%.lst: %.c FORCE 217$(obj)/%.lst: $(src)/%.c FORCE
219 $(call if_changed_dep,cc_lst_c) 218 $(call if_changed_dep,cc_lst_c)
220 219
221# Compile assembler sources (.S) 220# Compile assembler sources (.S)
@@ -229,13 +228,13 @@ $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE)
229quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ 228quiet_cmd_as_s_S = CPP $(quiet_modtag) $@
230cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< 229cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<
231 230
232%.s: %.S FORCE 231$(obj)/%.s: $(src)/%.S FORCE
233 $(call if_changed_dep,as_s_S) 232 $(call if_changed_dep,as_s_S)
234 233
235quiet_cmd_as_o_S = AS $(quiet_modtag) $@ 234quiet_cmd_as_o_S = AS $(quiet_modtag) $@
236cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< 235cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $<
237 236
238%.o: %.S FORCE 237$(obj)/%.o: $(src)/%.S FORCE
239 $(call if_changed_dep,as_o_S) 238 $(call if_changed_dep,as_o_S)
240 239
241targets += $(real-objs-y) $(real-objs-m) $(lib-y) 240targets += $(real-objs-y) $(real-objs-m) $(lib-y)
@@ -246,7 +245,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $(always)
246quiet_cmd_cpp_lds_S = LDS $@ 245quiet_cmd_cpp_lds_S = LDS $@
247 cmd_cpp_lds_S = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -o $@ $< 246 cmd_cpp_lds_S = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -o $@ $<
248 247
249%.lds: %.lds.S FORCE 248$(obj)/%.lds: $(src)/%.lds.S FORCE
250 $(call if_changed_dep,cpp_lds_S) 249 $(call if_changed_dep,cpp_lds_S)
251 250
252# Build the compiled-in targets 251# Build the compiled-in targets