Skip to contentSkip to conversation

kbuild patches

GIT In review Sam Ravnborg 3 participants 12 messages Nov 24, 2008 – Nov 25, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Just a heads up of what I so far has applied to build-next.git

I have more queued in my mailbox pending review/applying.

If you use "make -s" you will see that we are now more silent than before.

tags support got an overhauls and presently includes symbols form the archs that has not yet killed include/asm-*

Everything is shortly available here:

git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next.git master

I will send patches as followup.

Sam

Mike Frysinger (3):
kbuild: kill output in silent mode of mkcompile_h
kbuild: introduce $(kecho) convenience echo
kbuild: use KECHO convenience echo

Sally, Gene (1):
kbuild: gen_init_cpio expands shell variables in file names

Sam Ravnborg (3):
kbuild: expand -I in KBUILD_CPPFLAGS
kbuild: teach mkmakfile to be silent
kbuild: move tags support to a shell script

Werner Almesberger (1):
remove bashisms from scripts/extract-ikconfig

 Documentation/kbuild/makefiles.txt |   14 ++++
 Makefile                           |  127 ++-----------------------------
 arch/blackfin/boot/Makefile        |    2 +-
 scripts/Kbuild.include             |   18 ++--
 scripts/Makefile.lib               |   15 +++-
 scripts/extract-ikconfig           |    8 +-
 scripts/mkcompile_h                |    6 +-
 scripts/mkmakefile                 |    4 +-
 scripts/tags.sh                    |  147 ++++++++++++++++++++++++++++++++++++
 usr/gen_init_cpio.c                |   28 +++++++-
 10 files changed, 227 insertions(+), 142 deletions(-)
#1 lore raw

PATCH 1/8 kbuild: expand -I in KBUILD_CPPFLAGS

kbuild failed to expand include flags in KBUILD_CPPFLAGS resulting in code like this in arch Makefiles:

ifeq ($(KBUILD_SRC),)
KBUILD_CPPFLAGS += -Iinclude/foo
else
KBUILD_CPPFLAGS += -I$(srctree)/include/foo
endif

Move use of LINUXINCLUDE into Makefile.lib to allow us to expand -I directives of KBUILD_CPPFLAGS so we can avoid the above code.

---
 Makefile             |    2 +-
 scripts/Makefile.lib |   15 ++++++++++-----
 2 files changed, 11 insertions(+), 6 deletions(-)
Makefile +1 -1
index 7b1f238..54720a5 100644
@@ -336,7 +336,7 @@ LINUXINCLUDE    := -Iinclude \
                    -I$(srctree)/arch/$(hdr-arch)/include               \
                    -include include/linux/autoconf.h
 
-KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
+KBUILD_CPPFLAGS :=
 
 KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
 		   -fno-strict-aliasing -fno-common \
scripts/Makefile.lib +10 -5
index b4ca38a..b8a67ec 100644
@@ -104,9 +104,11 @@ else
 debug_flags =
 endif
 
-orig_c_flags   = $(KBUILD_CFLAGS) $(ccflags-y) $(CFLAGS_$(basetarget).o)
+orig_c_flags   = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS)                     \
+                 $(ccflags-y) $(CFLAGS_$(basetarget).o)
 _c_flags       = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags))
-_a_flags       = $(KBUILD_AFLAGS) $(asflags-y) $(AFLAGS_$(basetarget).o)
+_a_flags       = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS)                     \
+                 $(asflags-y) $(AFLAGS_$(basetarget).o)
 _cpp_flags     = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F))
 
 # If building the kernel in a separate objtree expand all occurrences
@@ -127,15 +129,18 @@ __a_flags	=                          $(call flags,_a_flags)
 __cpp_flags     =                          $(call flags,_cpp_flags)
 endif
 
-c_flags        = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \
+c_flags        = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS)                    \
+		 -D__KERNEL__ $(LINUXINCLUDE)                            \
 		 $(__c_flags) $(modkern_cflags) \
 		 -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) \
 		  $(debug_flags)
 
-a_flags        = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \
+a_flags        = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS)                    \
+		 -D__KERNEL__ $(LINUXINCLUDE)                            \
 		 $(__a_flags) $(modkern_aflags)
 
-cpp_flags      = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags)
+cpp_flags      = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS)                    \
+		 -D__KERNEL__ $(LINUXINCLUDE) $(__cpp_flags)
 
 ld_flags       = $(LDFLAGS) $(ldflags-y)
 
Signature · 1 line
1.5.6.GIT
#2 lore raw

PATCH 2/8 kbuild: kill output in silent mode of mkcompile_h

In reply to Sam Ravnborg

From: Mike Frysinger <[email protected]>

The mkcompile_h script does echo regardless of silent mode the make is running at, so have it respect $quiet from kbuild and only echo when not in silent mode.

---
 scripts/mkcompile_h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
scripts/mkcompile_h +4 -2
index a8740df..6a12dd9 100755
@@ -4,6 +4,8 @@ SMP=$3
 PREEMPT=$4
 CC=$5
 
+vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; }
+
 # If compile.h exists already and we don't own autoconf.h
 # (i.e. we're not the same user who did make *config), don't
 # modify compile.h
@@ -11,7 +13,7 @@ CC=$5
 # do "compiled by root"
 
 if [ -r $TARGET -a ! -O include/linux/autoconf.h ]; then
-  echo "  SKIPPED $TARGET"
+  vecho "  SKIPPED $TARGET"
   exit 0
 fi
 
@@ -89,7 +91,7 @@ if [ -r $TARGET ] && \
       cmp -s .tmpver.1 .tmpver.2; then
    rm -f .tmpcompile
 else
-   echo "  UPD     $TARGET"
+   vecho "  UPD     $TARGET"
    mv -f .tmpcompile $TARGET
 fi
 rm -f .tmpver.1 .tmpver.2
Signature · 1 line
1.5.6.GIT
#3 lore raw

PATCH 3/8 kbuild: introduce $(kecho) convenience echo

In reply to Sam Ravnborg

From: Mike Frysinger <[email protected]>

There is a bunch of places in the build system where we do 'echo' to show some nice status lines. This means we still get output when running in silent mode. So declare a new KECHO variable that only does 'echo' when we are in a suitable verbose build mode.

[sam: added Documentation]
---
 Documentation/kbuild/makefiles.txt |   14 ++++++++++++++
 scripts/Kbuild.include             |    7 +++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
Documentation/kbuild/makefiles.txt +14 -0
index 7a77533..51104f9 100644
@@ -383,6 +383,20 @@ more details, with real examples.
 	to prerequisites are referenced with $(src) (because they are not
 	generated files).
 
+    $(kecho)
+	echoing information to user in a rule is often a good practice
+	but when execution "make -s" one does not expect to see any output
+	except for warnings/errors.
+	To support this kbuild define $(kecho) which will echo out the
+	text following $(kecho) to stdout except if "make -s" is used.
+
+	Example:
+		#arch/blackfin/boot/Makefile
+		$(obj)/vmImage: $(obj)/vmlinux.gz
+			$(call if_changed,uimage)
+			@$(kecho) 'Kernel: $@ is ready'
+
+
 --- 3.11 $(CC) support functions
 
 	The kernel may be built with several different versions of
scripts/Kbuild.include +7 -0
index 982dcae..e637e28 100644
@@ -25,6 +25,13 @@ basetarget = $(basename $(notdir $@))
 escsq = $(subst $(squote),'\$(squote)',$1)
 
 ###
+# Easy method for doing a status message
+       kecho := :
+ quiet_kecho := echo
+silent_kecho := :
+kecho := $($(quiet)kecho)
+
+###
 # filechk is used to check if the content of a generated file is updated.
 # Sample usage:
 # define filechk_sample
Signature · 1 line
1.5.6.GIT
#4 lore raw

PATCH 4/8 kbuild: use KECHO convenience echo

In reply to Sam Ravnborg

From: Mike Frysinger <[email protected]>

Convert a few echos in the build system to new $(kecho) so we get correct output according to build verbosity.

[sam: added kecho in a few more places for O=... builds]
---
 Makefile                    |    8 ++++----
 arch/blackfin/boot/Makefile |    2 +-
 scripts/Kbuild.include      |   11 ++---------
 3 files changed, 7 insertions(+), 14 deletions(-)
Makefile +4 -4
index 54720a5..391b2da 100644
@@ -926,7 +926,7 @@ PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
 # 2) Create the include2 directory, used for the second asm symlink
 prepare3: include/config/kernel.release
 ifneq ($(KBUILD_SRC),)
-	@echo '  Using $(srctree) as source for kernel'
+	@$(kecho) '  Using $(srctree) as source for kernel'
 	$(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
 		echo "  $(srctree) is not clean, please run 'make mrproper'";\
 		echo "  in the '$(srctree)' directory.";\
@@ -983,7 +983,7 @@ endef
 # directory for generated filesas used by some architectures.
 define create-symlink
 	if [ ! -L include/asm ]; then                                      \
-			echo '  SYMLINK $@ -> include/asm-$(SRCARCH)';     \
+			$(kecho) '  SYMLINK $@ -> include/asm-$(SRCARCH)'; \
 			if [ ! -d include/asm-$(SRCARCH) ]; then           \
 				mkdir -p include/asm-$(SRCARCH);           \
 			fi;                                                \
@@ -1096,7 +1096,7 @@ all: modules
 PHONY += modules
 modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
 	$(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
-	@echo '  Building modules, stage 2.';
+	@$(kecho) '  Building modules, stage 2.';
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild
 
@@ -1360,7 +1360,7 @@ $(module-dirs): crmodverdir $(objtree)/Module.symvers
 	$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
 
 modules: $(module-dirs)
-	@echo '  Building modules, stage 2.';
+	@$(kecho) '  Building modules, stage 2.';
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
 
 PHONY += modules_install
arch/blackfin/boot/Makefile +1 -1
index 522f3c1..e028d13 100644
@@ -25,7 +25,7 @@ $(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
 
 $(obj)/vmImage: $(obj)/vmlinux.gz
 	$(call if_changed,uimage)
-	@echo 'Kernel: $@ is ready'
+	@$(kecho) 'Kernel: $@ is ready'
 
 install:
 	sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
scripts/Kbuild.include +2 -9
index e637e28..2cf1516 100644
@@ -46,22 +46,15 @@ kecho := $($(quiet)kecho)
 # - If they are equal no change, and no timestamp update
 # - stdin is piped in from the first prerequisite ($<) so one has
 #   to specify a valid file as first prerequisite (often the kbuild file)
-       chk_filechk = :
- quiet_chk_filechk = echo '  CHK     $@'
-silent_chk_filechk = :
-       upd_filechk = :
- quiet_upd_filechk = echo '  UPD     $@'
-silent_upd_filechk = :
-
 define filechk
 	$(Q)set -e;				\
-	$($(quiet)chk_filechk);			\
+	$(kecho) '  CHK     $@';		\
 	mkdir -p $(dir $@);			\
 	$(filechk_$(1)) < $< > [email protected];		\
 	if [ -r $@ ] && cmp -s $@ [email protected]; then	\
 		rm -f [email protected];			\
 	else					\
-		$($(quiet)upd_filechk);		\
+		$(kecho) '  UPD     $@';	\
 		mv -f [email protected] $@;		\
 	fi
 endef
Signature · 1 line
1.5.6.GIT
#5 lore raw

PATCH 5/8 kbuild: teach mkmakfile to be silent

In reply to Sam Ravnborg

With this fix a "make -s" is now really silent

---
 scripts/mkmakefile |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
scripts/mkmakefile +3 -1
index e65d8b3..67d59c7 100644
@@ -17,7 +17,9 @@ if test -e $2/Makefile && ! grep -q Automatically $2/Makefile
 then
 	exit 0
 fi
-echo "  GEN     $2/Makefile"
+if [ "${quiet}" != "silent_" ]; then
+	echo "  GEN     $2/Makefile"
+fi
 
 cat << EOF > $2/Makefile
 # Automatically generated by $0: don't edit
Signature · 1 line
1.5.6.GIT
#6 lore raw

PATCH 6/8 remove bashisms from scripts/extract-ikconfig

In reply to Sam Ravnborg

From: Werner Almesberger <[email protected]>

unbashify-extract-ikconfig.patch

scripts/extract-ikconfig contains a lot of gratuituous bashisms, which make it fail if /bin/sh isn't bash. This patch replaces them with regular Bourne shell constructs.

---
 scripts/extract-ikconfig |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
scripts/extract-ikconfig +4 -4
index 8187e6f..72997c3 100755
@@ -8,8 +8,8 @@ test -e $binoffset || cc -o $binoffset ./scripts/binoffset.c || exit 1
 
 IKCFG_ST="0x49 0x4b 0x43 0x46 0x47 0x5f 0x53 0x54"
 IKCFG_ED="0x49 0x4b 0x43 0x46 0x47 0x5f 0x45 0x44"
-function dump_config {
-    typeset file="$1"
+dump_config() {
+    file="$1"
 
     start=`$binoffset $file $IKCFG_ST 2>/dev/null`
     [ "$?" != "0" ] && start="-1"
@@ -18,8 +18,8 @@ function dump_config {
     fi
     end=`$binoffset $file $IKCFG_ED 2>/dev/null`
 
-    let start="$start + 8"
-    let size="$end - $start"
+    start=`expr $start + 8`
+    size=`expr $end - $start`
 
     dd if="$file" ibs=1 skip="$start" count="$size" 2>/dev/null | zcat
 
Signature · 1 line
1.5.6.GIT
#7 lore raw

PATCH 7/8 kbuild: gen_init_cpio expands shell variables in file names

In reply to Sam Ravnborg

From: Sally, Gene <[email protected]>

Modify gen_init_cpio so that lines that specify files can contain what looks like a shell variable that's expanded during processing.

For example:

   file /sbin/kinit ${RFS_BASE}/usr/src/klibc/kinit/kinit 0755 0 0

given RFS_BASE is "/some/directory" in the environment

would be expanded to

file /sbin/kinit /some/directory/usr/src/klibc/kinit/kinit 0755 0 0

If several environment variables appear in a line, they are all expanded with processing happening from left to right.
Undefined variables expand to a null string.
Syntax errors stop processing, letting the existing error handling show the user offending line.

This patch helps embedded folks who frequently create several RFS directories and then switch between them as they're tuning an initramfs.

---
 usr/gen_init_cpio.c |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)
usr/gen_init_cpio.c +27 -1
index 7abc07f..f1d3fe3 100644
@@ -370,6 +370,30 @@ error:
 	return rc;
 }
 
+static char *cpio_replace_env(char *new_location)
+{
+       char expanded[PATH_MAX + 1];
+       char env_var[PATH_MAX + 1];
+       char *start;
+       char *end;
+
+       for (start = NULL; (start = strstr(new_location, "${")); ) {
+               end = strchr(start, '}');
+               if (start < end) {
+                       *env_var = *expanded = '\0';
+                       strncat(env_var, start + 2, end - start - 2);
+                       strncat(expanded, new_location, start - new_location);
+                       strncat(expanded, getenv(env_var), PATH_MAX);
+                       strncat(expanded, end + 1, PATH_MAX);
+                       strncpy(new_location, expanded, PATH_MAX);
+               } else
+                       break;
+       }
+
+       return new_location;
+}
+
+
 static int cpio_mkfile_line(const char *line)
 {
 	char name[PATH_MAX + 1];
@@ -415,7 +439,8 @@ static int cpio_mkfile_line(const char *line)
 	} else {
 		dname = name;
 	}
-	rc = cpio_mkfile(dname, location, mode, uid, gid, nlinks);
+	rc = cpio_mkfile(dname, cpio_replace_env(location),
+	                 mode, uid, gid, nlinks);
  fail:
 	if (dname_len) free(dname);
 	return rc;
@@ -439,6 +464,7 @@ void usage(const char *prog)
 		"\n"
 		"<name>       name of the file/dir/nod/etc in the archive\n"
 		"<location>   location of the file in the current filesystem\n"
+		"             expands shell variables quoted with ${}\n"
 		"<target>     link target\n"
 		"<mode>       mode/permissions of the file\n"
 		"<uid>        user id (0=root)\n"
Signature · 1 line
1.5.6.GIT
#8 lore raw

PATCH 8/8 kbuild: move tags support to a shell script

In reply to Sam Ravnborg

tags and cscope support really belongs in a shell script as they do not benefit from the make functionality.

Moving the support to a shell script has several benefits:
- The readability of the code has increased a lot
- More people is able to extend the tags support
- We see less changes to the top-level Makefile

The shell script version includes improvements from:
Alexey Dobriyan <[email protected]> (jump to kconfig symbols) Ian Campbell <[email protected]> (simplified find algorithms)

This version has a few caveats:
=> It does not support ALLSOURCE_ARCHS
- it is easy to add if it is really used
=> It assumes all archs have moved to arch/$ARCH/include

---
 Makefile        |  117 +------------------------------------------
 scripts/tags.sh |  147 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 150 insertions(+), 114 deletions(-)
 create mode 100644 scripts/tags.sh
Makefile +3 -114
index 391b2da..483c36d 100644
@@ -1409,123 +1409,12 @@ endif # KBUILD_EXTMOD
 
 # Generate tags for editors
 # ---------------------------------------------------------------------------
+quiet_cmd_tags = GEN     $@
+      cmd_tags = $(CONFIG_SHELL) $(srctree)/scripts/tags.sh $@
 
-#We want __srctree to totally vanish out when KBUILD_OUTPUT is not set
-#(which is the most common case IMHO) to avoid unneeded clutter in the big tags file.
-#Adding $(srctree) adds about 20M on i386 to the size of the output file!
-
-ifeq ($(src),$(obj))
-__srctree =
-else
-__srctree = $(srctree)/
-endif
-
-ifeq ($(ALLSOURCE_ARCHS),)
-ifeq ($(ARCH),um)
-ALLINCLUDE_ARCHS := $(ARCH) $(SUBARCH)
-else
-ALLINCLUDE_ARCHS := $(SRCARCH)
-endif
-else
-#Allow user to specify only ALLSOURCE_PATHS on the command line, keeping existing behaviour.
-ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS)
-endif
-
-ALLSOURCE_ARCHS := $(SRCARCH)
-
-define find-sources
-        ( for arch in $(ALLSOURCE_ARCHS) ; do \
-	       find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \
-		    -wholename $(__srctree)arch/$${arch}/include/asm -type d -prune \
-	            -o -name $1 -print; \
-	  done ; \
-	  find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
-	       -name $1 -print; \
-	  find $(__srctree)include $(RCS_FIND_IGNORE) \
-	       \( -name config -o -name 'asm-*' \) -prune \
-	       -o -name $1 -print; \
-	  for arch in $(ALLINCLUDE_ARCHS) ; do \
-	       test -e $(__srctree)include/asm-$${arch} && \
-                 find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \
-	            -name $1 -print; \
-	       test -e $(__srctree)arch/$${arch}/include/asm && \
-	         find $(__srctree)arch/$${arch}/include/asm $(RCS_FIND_IGNORE) \
-	            -name $1 -print; \
-	  done ; \
-	  find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
-	       -name $1 -print; \
-	  find $(__srctree) $(RCS_FIND_IGNORE) \
-	       \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \
-	       -name $1 -print; \
-	  )
-endef
-
-define all-sources
-	$(call find-sources,'*.[chS]')
-endef
-define all-kconfigs
-	$(call find-sources,'Kconfig*')
-endef
-define all-defconfigs
-	$(call find-sources,'defconfig')
-endef
-
-define xtags
-	if $1 --version 2>&1 | grep -iq exuberant; then \
-	    $(all-sources) | xargs $1 -a \
-		-I __initdata,__exitdata,__acquires,__releases \
-		-I __read_mostly,____cacheline_aligned,____cacheline_aligned_in_smp,____cacheline_internodealigned_in_smp \
-		-I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
-		--extra=+f --c-kinds=+px \
-		--regex-asm='/^ENTRY\(([^)]*)\).*/\1/'; \
-	    $(all-kconfigs) | xargs $1 -a \
-		--langdef=kconfig \
-		--language-force=kconfig \
-		--regex-kconfig='/^[[:blank:]]*(menu|)config[[:blank:]]+([[:alnum:]_]+)/\2/'; \
-	    $(all-defconfigs) | xargs -r $1 -a \
-		--langdef=dotconfig \
-		--language-force=dotconfig \
-		--regex-dotconfig='/^#?[[:blank:]]*(CONFIG_[[:alnum:]_]+)/\1/'; \
-	elif $1 --version 2>&1 | grep -iq emacs; then \
-	    $(all-sources) | xargs $1 -a; \
-	    $(all-kconfigs) | xargs $1 -a \
-		--regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'; \
-	    $(all-defconfigs) | xargs -r $1 -a \
-		--regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \
-	else \
-	    $(all-sources) | xargs $1 -a; \
-	fi
-endef
-
-quiet_cmd_cscope-file = FILELST cscope.files
-      cmd_cscope-file = (echo \-k; echo \-q; $(all-sources)) > cscope.files
-
-quiet_cmd_cscope = MAKE    cscope.out
-      cmd_cscope = cscope -b -f cscope.out
-
-cscope: FORCE
-	$(call cmd,cscope-file)
-	$(call cmd,cscope)
-
-quiet_cmd_TAGS = MAKE   $@
-define cmd_TAGS
-	rm -f $@; \
-	$(call xtags,etags)
-endef
-
-TAGS: FORCE
-	$(call cmd,TAGS)
-
-quiet_cmd_tags = MAKE   $@
-define cmd_tags
-	rm -f $@; \
-	$(call xtags,ctags)
-endef
-
-tags: FORCE
+tags TAGS cscope: FORCE
 	$(call cmd,tags)
 
-
 # Scripts to check various things for consistency
 # ---------------------------------------------------------------------------
 
scripts/tags.sh new file +147 -0

147 lines not on this page · raw message

Signature · 1 line
1.5.6.GIT
#9 lore raw

Re: [PATCH 8/8] kbuild: move tags support to a shell script

scripts/tags.sh line 133

Quoted 8 lines · Sam Ravnborg
scripts/tags.sh new file +7 -0
+# Support um (which has SUBARCH)
+# FIXME: add support for ALLSOURCE_ARCHS if really used
+if [ "${ARCH}" == "${SUBARCH}" ]; then
+       archs="${ARCH} ${SUBARCH}"
+else
+       archs="${SRCARCH}"
+fi

I've never used um but is this conditional backwards? If ${ARCH} == ${SUBARCH} then archs="${ARCH} ${SUBARCH}" is equivalent to archs=" ${ARCH} ${ARCH}", isn't it?

I'm not quite sure I understand the distinction between ARCH, SRCARCH and SUBARCH either but is it expected that for ARCH=um, SUBARCH will be i386/x86_64 or x86? I think it's the former in which case I'd expect these days nothing will be found in arch/i386 or arch/x86_64? is a SRCSUBARCH required?

Ian.

Signature · 4 lines
Ian Campbell

To do two things at once is to do neither.
		-- Publilius Syrus
#10 lore raw

Re: [PATCH 8/8] kbuild: move tags support to a shell script

Quoted 3 lines · Ian Campbell

I'm not quite sure I understand the distinction between ARCH, SRCARCH and SUBARCH either but is it expected that for ARCH=um, SUBARCH will be i386/x86_64 or x86?

Yes, this is for UML to be able to tell what the underlying arch is.

Jeff

Signature · 1 line
Work email - jdike at linux dot intel dot com
#11 lore raw

Re: [PATCH 8/8] kbuild: move tags support to a shell script

In reply to Ian Campbell
Quoted 13 lines · Ian Campbell

scripts/tags.sh line 133

Quoted 8 lines · Sam Ravnborg
scripts/tags.sh new file +7 -0
+# Support um (which has SUBARCH)
+# FIXME: add support for ALLSOURCE_ARCHS if really used
+if [ "${ARCH}" == "${SUBARCH}" ]; then
+       archs="${ARCH} ${SUBARCH}"
+else
+       archs="${SRCARCH}"
+fi

I've never used um but is this conditional backwards? If ${ARCH} == ${SUBARCH} then archs="${ARCH} ${SUBARCH}" is equivalent to archs=" ${ARCH} ${ARCH}", isn't it?

It is buggy.

Quoted 6 lines

I'm not quite sure I understand the distinction between ARCH, SRCARCH and SUBARCH either but is it expected that for ARCH=um, SUBARCH will be i386/x86_64 or x86? I think it's the former in which case I'd expect these days nothing will be found in arch/i386 or arch/x86_64? is a SRCSUBARCH required?

Something like that. But we only need to include headers for the relavant SUBARCH. I will give it a closer look.

Sam