diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2007-05-06 03:23:45 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2007-05-06 03:23:45 -0400 |
commit | 767e581d759fe6adfef5e676cd1cd8e11f603d1a (patch) | |
tree | f208026e00ace8ba32cc4f9c1fc6168af329c167 /scripts/Makefile.build | |
parent | 5447d34b080a1e3e312b05a91e87eff4710a1152 (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.build | 19 |
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) | |||
131 | quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ | 131 | quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ |
132 | cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $< | 132 | cmd_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 | ||
137 | quiet_cmd_cc_i_c = CPP $(quiet_modtag) $@ | 137 | quiet_cmd_cc_i_c = CPP $(quiet_modtag) $@ |
138 | cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $< | 138 | cmd_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 | ||
143 | quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@ | 143 | quiet_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 | |||
198 | endef | 198 | endef |
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) | |||
229 | quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ | 228 | quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ |
230 | cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< | 229 | cmd_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 | ||
235 | quiet_cmd_as_o_S = AS $(quiet_modtag) $@ | 234 | quiet_cmd_as_o_S = AS $(quiet_modtag) $@ |
236 | cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< | 235 | cmd_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 | ||
241 | targets += $(real-objs-y) $(real-objs-m) $(lib-y) | 240 | targets += $(real-objs-y) $(real-objs-m) $(lib-y) |
@@ -246,7 +245,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $(always) | |||
246 | quiet_cmd_cpp_lds_S = LDS $@ | 245 | quiet_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 |