From: Kenn H. <ke...@us...> - 2003-01-29 00:08:16
|
Update of /cvsroot/linux-vax/kernel-2.5 In directory sc8-pr-cvs1:/tmp/cvs-serv10265 Modified Files: Makefile Rules.make Log Message: Merge with 2.5.25 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/Makefile,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- Makefile 27 Jan 2003 01:28:21 -0000 1.30 +++ Makefile 29 Jan 2003 00:08:11 -0000 1.31 @@ -1,8 +1,14 @@ VERSION = 2 PATCHLEVEL = 5 -SUBLEVEL = 24 +SUBLEVEL = 25 EXTRAVERSION = +# *DOCUMENTATION* +# Too see a list of typical targets execute "make help" +# More info can be located in ./Documentation/kbuild +# Comments in this file is targeted only to the developer, do not +# expect to learn how to build the kernel reading this file. + # We are using a recursive build, so we need to do a little thinking # to get the ordering right. # @@ -140,16 +146,23 @@ CONFIG_SHELL TOPDIR HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \ CPP AR NM STRIP OBJCOPY OBJDUMP MAKE MAKEFILES GENKSYMS PERL -export CPPFLAGS EXPORT_FLAGS NOSTDINC_FLAGS +export CPPFLAGS EXPORT_FLAGS NOSTDINC_FLAGS OBJCOPYFLAGS export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE +src := . +obj := . +srctree := $(TOPDIR) +objtree := $(TOPDIR) + +export srctree objtree + SUBDIRS := init kernel mm fs ipc lib drivers sound net noconfig_targets := xconfig menuconfig config oldconfig randconfig \ defconfig allyesconfig allnoconfig allmodconfig \ clean mrproper distclean \ - tags TAGS sgmldocs psdocs pdfdocs htmldocs \ + help tags TAGS sgmldocs psdocs pdfdocs htmldocs \ checkconfig checkhelp checkincludes ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) @@ -217,7 +230,7 @@ include arch/$(ARCH)/Makefile -export NETWORKS DRIVERS LIBS HEAD LDFLAGS LINKFLAGS MAKEBOOT ASFLAGS +export NETWORKS DRIVERS LIBS HEAD LDFLAGS MAKEBOOT ASFLAGS # boot target # --------------------------------------------------------------------------- @@ -238,7 +251,7 @@ vmlinux-objs := $(HEAD) $(INIT) $(CORE_FILES) $(LIBS) $(DRIVERS) $(NETWORKS) quiet_cmd_link_vmlinux = LD $@ -cmd_link_vmlinux = $(LD) $(LINKFLAGS) $(HEAD) $(INIT) \ +cmd_link_vmlinux = $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $(HEAD) $(INIT) \ --start-group \ $(CORE_FILES) \ $(LIBS) \ @@ -255,7 +268,7 @@ . scripts/mkversion > .tmpversion mv -f .tmpversion .version +$(MAKE) -C init - $(call cmd,cmd_link_vmlinux) + $(call cmd,link_vmlinux) $(cmd_link_vmlinux) echo 'cmd_$@ := $(cmd_link_vmlinux)' > $(@D)/.$(@F).cmd $(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map @@ -679,6 +692,43 @@ find $(SUBDIRS) init -name SCCS -prune -o -name BitKeeper -prune -o \ -name '*.[ch]' -print | xargs ctags $$CTAGSF -a +# Brief documentation of the typical targets used +# --------------------------------------------------------------------------- + +help: + @echo 'Cleaning targets:' + @echo ' clean - remove most generated files but keep the config' + @echo ' mrproper - remove all generated files including the config' + @echo ' distclean - mrproper + remove files generated by editors and patch' + @echo '' + @echo 'Configuration targets:' + @echo ' oldconfig - Update current config utilising a line-oriented program' + @echo ' menuconfig - Update current config utilising a menu based program' + @echo ' xconfig - Update current config utilising a X-based program' + @echo ' defconfig - New config with default answer to all options' + @echo ' allmodconfig - New config selecting modules when possible' + @echo ' allyesconfig - New config where all options are accepted with yes' + @echo ' allnoconfig - New minimal config' + @echo '' + @echo 'Other generic targets:' + @echo ' all - Build all targets marked with [*]' + @echo ' dep - Create module version information' + @echo '* vmlinux - Build the bare kernel' + @echo '* modules - Build all modules' + @echo ' dir/file.[ois]- Build specified target only' + @echo ' rpm - Build a kernel as an RPM package' + @echo ' tags/TAGS - Generate tags file for editors' + @echo '' + @echo 'Documentation targets:' + @$(MAKE) --no-print-directory -f Documentation/DocBook/Makefile dochelp + @echo '' + @echo 'Architecture specific targets ($(ARCH)):' + @$(MAKE) --no-print-directory -f arch/$(ARCH)/boot/Makefile archhelp + @echo '' + @echo 'Execute "make" or "make all" to build all targets marked with [*] ' + @echo 'For further info browse Documentation/kbuild/*' + + # Documentation targets # --------------------------------------------------------------------------- @@ -735,9 +785,9 @@ $(filter-out $(cmd_$(@F)),$(cmd_$(1)))),\ @$(rule_$(1))) -# If quiet is set, only print short version of rule +# If quiet is set, only print short version of command -cmd = @$(if $($(quiet)$(1)),echo ' $($(quiet)$(1))' &&) $($(1)) +cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1)) define update-if-changed if [ -r $@ ] && cmp -s $@ $@.tmp; then \ Index: Rules.make =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/Rules.make,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- Rules.make 27 Jan 2003 01:28:21 -0000 1.16 +++ Rules.make 29 Jan 2003 00:08:12 -0000 1.17 @@ -34,7 +34,7 @@ # $(srctree)/include/linux/module.h : Some file relative to the source # dir root # -# Those can only be used in the section after +# $(obj) and $(src) can only be used in the section after # include $(TOPDIR)/Rules.make, i.e for generated files and the like. # Intentionally. # @@ -43,8 +43,10 @@ obj := . src := . -objtree := $(TOPDIR) -srctree := $(TOPDIR) + +# For use in the quiet output + +echo_target = $(RELDIR)/$@ # Figure out what we need to build from the various variables # =========================================================================== @@ -272,25 +274,25 @@ -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) \ $(export_flags) -quiet_cmd_cc_s_c = CC $(RELDIR)/$@ +quiet_cmd_cc_s_c = CC $(echo_target) cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $< %.s: %.c FORCE $(call if_changed_dep,cc_s_c) -quiet_cmd_cc_i_c = CPP $(RELDIR)/$@ +quiet_cmd_cc_i_c = CPP $(echo_target) cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $< %.i: %.c FORCE $(call if_changed_dep,cc_i_c) -quiet_cmd_cc_o_c = CC $(RELDIR)/$@ +quiet_cmd_cc_o_c = CC $(echo_target) cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< $(listing_o_c) %.o: %.c FORCE $(call if_changed_dep,cc_o_c) -quiet_cmd_cc_lst_c = ' Generating $(RELDIR)/$@' +quiet_cmd_cc_lst_c = ' Generating $(echo_target)' cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && $(TOPDIR)/scripts/makelst $*.o $(TOPDIR)/System.map $(OBJDUMP) > $@ %.lst: %.c FORCE @@ -307,13 +309,13 @@ a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(NOSTDINC_FLAGS) \ $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) -quiet_cmd_as_s_S = CPP $(RELDIR)/$@ +quiet_cmd_as_s_S = CPP $(echo_target) cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< %.s: %.S FORCE $(call if_changed_dep,as_s_S) -quiet_cmd_as_o_S = AS $(RELDIR)/$@ +quiet_cmd_as_o_S = AS $(echo_target) cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< %.o: %.S FORCE @@ -331,10 +333,10 @@ # Rule to compile a set of .o files into one .o file # ifdef O_TARGET -quiet_cmd_link_o_target = LD $(RELDIR)/$@ +quiet_cmd_link_o_target = LD $(echo_target) # If the list of objects to link is empty, just create an empty O_TARGET cmd_link_o_target = $(if $(strip $(obj-y)),\ - $(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(obj-y), $^),\ + $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(obj-y), $^),\ rm -f $@; $(AR) rcs $@) $(O_TARGET): $(obj-y) FORCE @@ -347,7 +349,7 @@ # Rule to compile a set of .o files into one .a file # ifdef L_TARGET -quiet_cmd_link_l_target = AR $(RELDIR)/$@ +quiet_cmd_link_l_target = AR $(echo_target) cmd_link_l_target = rm -f $@; $(AR) $(EXTRA_ARFLAGS) rcs $@ $(obj-y) $(L_TARGET): $(obj-y) FORCE @@ -360,8 +362,8 @@ # Rule to link composite objects # -quiet_cmd_link_multi = LD $(RELDIR)/$@ -cmd_link_multi = $(LD) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs),$^) +quiet_cmd_link_multi = LD $(echo_target) +cmd_link_multi = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs),$^) # We would rather have a list of rules like # foo.o: $(foo-objs) @@ -382,22 +384,22 @@ host-progs-multi := $(foreach m,$(host-progs),$(if $($(m)-objs),$(m))) host-progs-multi-objs := $(foreach m,$(host-progs-multi),$($(m)-objs)) -quiet_cmd_host_cc__c = HOSTCC $(RELDIR)/$@ -cmd_host_cc__c = $(HOSTCC) -Wp,-MD,.$(subst /,_,$@).d \ +quiet_cmd_host_cc__c = HOSTCC $(echo_target) +cmd_host_cc__c = $(HOSTCC) -Wp,-MD,$(depfile) \ $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ $(HOST_LOADLIBES) -o $@ $< $(host-progs-single): %: %.c FORCE $(call if_changed_dep,host_cc__c) -quiet_cmd_host_cc_o_c = HOSTCC $(RELDIR)/$@ -cmd_host_cc_o_c = $(HOSTCC) -Wp,-MD,.$(subst /,_,$@).d \ +quiet_cmd_host_cc_o_c = HOSTCC $(echo_target) +cmd_host_cc_o_c = $(HOSTCC) -Wp,-MD,$(depfile) \ $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) -c -o $@ $< $(host-progs-multi-objs): %.o: %.c FORCE $(call if_changed_dep,host_cc_o_c) -quiet_cmd_host_cc__o = HOSTLD $(RELDIR)/$@ +quiet_cmd_host_cc__o = HOSTLD $(echo_target) cmd_host_cc__o = $(HOSTCC) $(HOSTLDFLAGS) -o $@ $($@-objs) \ $(HOST_LOADLIBES) @@ -413,9 +415,39 @@ # =========================================================================== %:: %_shipped - @echo ' CP $(RELDIR)/$@' + @echo ' CP $(echo_target)' @cp $< $@ +# Commands useful for building a boot image +# =========================================================================== +# +# Use as following: +# +# target: source(s) FORCE +# $(if_changed,ld/objcopy) +# +# and add target to EXTRA_TARGETS so that we know we have to +# read in the saved command line + +# Linking +# --------------------------------------------------------------------------- + +quiet_cmd_ld = LD $(echo_target) +cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$@) \ + $(filter-out FORCE,$^) -o $@ + +# Objcopy +# --------------------------------------------------------------------------- + +quiet_cmd_objcopy = OBJCPY $(echo_target) +cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $< $@ + +# Gzip +# --------------------------------------------------------------------------- + +quiet_cmd_gzip = GZIP $(echo_target) +cmd_gzip = gzip -f -9 < $< > $@ + # =========================================================================== # Generic stuff # =========================================================================== @@ -523,4 +555,4 @@ # If quiet is set, only print short version of command -cmd = @$(if $($(quiet)$(1)),echo ' $($(quiet)$(1))' &&) $($(1)) +cmd = @$(if $($(quiet)cmd_$(1)),echo ' $($(quiet)cmd_$(1))' &&) $(cmd_$(1)) |