diff options
| author | Sam Ravnborg <sam@mars.ravnborg.org> | 2002-11-22 20:15:19 +0100 |
|---|---|---|
| committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2002-11-22 20:15:19 +0100 |
| commit | 996fdfdc65a5adfb6442f899c3a9eeba39c48361 (patch) | |
| tree | d09e7d5a840694fbabbe8e2f057f41167e75cec8 /scripts | |
| parent | 621ce5a8315f24f5c8c0dd76c5d031876a8f1689 (diff) | |
kbuild: Move flags to Makefile.lib
a_flags defined in Makefile.lib, and a set of flags made for host
related rules. This avoided some duplication in Makefile.build
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/Makefile.build | 23 | ||||
| -rw-r--r-- | scripts/Makefile.lib | 8 |
2 files changed, 14 insertions, 17 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index f5f9a84fdd99..db56f901d0ae 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -103,7 +103,9 @@ cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< $(call if_changed_dep,cc_o_c) quiet_cmd_cc_lst_c = MKLST $@ -cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && sh scripts/makelst $*.o System.map $(OBJDUMP) > $@ + cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && \ + $(CONFIG_SHELL) $(src)/scripts/makelst $*.o \ + System.map $(OBJDUMP) > $@ %.lst: %.c FORCE $(call if_changed_dep,cc_lst_c) @@ -116,9 +118,6 @@ modkern_aflags := $(AFLAGS_KERNEL) $(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE) $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE) -a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(NOSTDINC_FLAGS) \ - $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) - quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< @@ -217,9 +216,7 @@ targets += $(multi-used-y) $(multi-used-m) # Create executable from a single .c file # host-csingle -> Executable quiet_cmd_host-csingle = HOSTCC $@ - cmd_host-csingle = $(HOSTCC) -Wp,-MD,$(depfile) \ - $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ - $(HOST_LOADLIBES) -o $@ $< + cmd_host-csingle = $(HOSTCC) $(hostc_flags) $(HOST_LOADLIBES) -o $@ $< $(host-csingle): %: %.c FORCE $(call if_changed_dep,host-csingle) @@ -235,9 +232,7 @@ $(host-cmulti): %: $(host-cobjs) $(host-cshlib) FORCE # Create .o file from a single .c file # host-cobjs -> .o quiet_cmd_host-cobjs = HOSTCC $@ - cmd_host-cobjs = $(HOSTCC) -Wp,-MD,$(depfile) \ - $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ - $(HOSTCFLAGS_$(@F)) -c -o $@ $< + cmd_host-cobjs = $(HOSTCC) $(hostc_flags) -c -o $@ $< $(host-cobjs): %.o: %.c FORCE $(call if_changed_dep,host-cobjs) @@ -253,18 +248,14 @@ $(host-cxxmulti): %: $(host-cobjs) $(host-cxxobjs) $(host-cshlib) FORCE # Create .o file from a single .cc (C++) file quiet_cmd_host-cxxobjs = HOSTCXX $@ - cmd_host-cxxobjs = $(HOSTCXX) -Wp,-MD,$(depfile) \ - $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ - $(HOSTCXXFLAGS_$(@F)) -c -o $@ $< + cmd_host-cxxobjs = $(HOSTCXX) $(hostcxx_flags) -c -o $@ $< $(host-cxxobjs): %.o: %.cc FORCE $(call if_changed_dep,host-cxxobjs) # Compile .c file, create position independent .o file # host-cshobjs -> .o quiet_cmd_host-cshobjs = HOSTCC -fPIC $@ - cmd_host-cshobjs = $(HOSTCC) -Wp,-MD,$(depfile) -fPIC\ - $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ - $(HOSTCFLAGS_$(@F)) -c -o $@ $< + cmd_host-cshobjs = $(HOSTCC) $(hostc_flags) -fPIC -c -o $@ $< $(host-cshobjs): %.o: %.c FORCE $(call if_changed_dep,host-cshobjs) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index ab209ad5830e..dd074686c2e7 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -128,6 +128,12 @@ modname_flags = -DKBUILD_MODNAME=$(subst $(comma),_,$(subst -,_,$(modname))) c_flags = -Wp,-MD,$(depfile) $(CFLAGS) $(NOSTDINC_FLAGS) \ $(modkern_cflags) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) \ $(basename_flags) $(modname_flags) $(export_flags) +a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(NOSTDINC_FLAGS)\ + $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) +hostc_flags = -Wp,-MD,$(depfile) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS)\ + $(HOSTCFLAGS_$(*F).o) +hostcxx_flags = -Wp,-MD,$(depfile) $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS)\ + $(HOSTCXXFLAGS_$(*F).o) # Finds the multi-part object the current object will be linked into modname-multi = $(subst $(space),_,$(strip $(foreach m,$(multi-used),\ @@ -139,7 +145,7 @@ modname-multi = $(subst $(space),_,$(strip $(foreach m,$(multi-used),\ quiet_cmd_shipped = SHIPPED $@ cmd_shipped = cat $< > $@ -%:: %_shipped +$(obj)/%:: $(src)/%_shipped $(call cmd,shipped) # Commands useful for building a boot image |
