Commit a0674e88d9c150e016a69e78e735f48772314c53

Authored by Ian Campbell
Committed by Sam Ravnborg
1 parent acbef459a6

[PATCH] kbuild: allow cscope to index multiple architectures

I have a single source tree which I cross compile for a couple of
different architectures using ARHC=foo O=blah etc.

The existing cscope target is very handy but only indexes the current
$(ARCH), which is a pain since inevitably I'm interested in the other
one at any given time ;-). This patch allows me to pass a list of
architectures for cscope to index. e.g.
	make ALLSOURCE_ARCHS="i386 arm" cscope

This change also works for etags etc, and I presume it is just as useful
there.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

Showing 1 changed file with 10 additions and 4 deletions Side-by-side Diff

... ... @@ -1159,19 +1159,25 @@
1159 1159 __srctree = $(srctree)/
1160 1160 endif
1161 1161  
  1162 +ALLSOURCE_ARCHS := $(ARCH)
  1163 +
1162 1164 define all-sources
1163 1165 ( find $(__srctree) $(RCS_FIND_IGNORE) \
1164 1166 \( -name include -o -name arch \) -prune -o \
1165 1167 -name '*.[chS]' -print; \
1166   - find $(__srctree)arch/$(ARCH) $(RCS_FIND_IGNORE) \
1167   - -name '*.[chS]' -print; \
  1168 + for ARCH in $(ALLSOURCE_ARCHS) ; do \
  1169 + find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \
  1170 + -name '*.[chS]' -print; \
  1171 + done ; \
1168 1172 find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \
1169 1173 -name '*.[chS]' -print; \
1170 1174 find $(__srctree)include $(RCS_FIND_IGNORE) \
1171 1175 \( -name config -o -name 'asm-*' \) -prune \
1172 1176 -o -name '*.[chS]' -print; \
1173   - find $(__srctree)include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
1174   - -name '*.[chS]' -print; \
  1177 + for ARCH in $(ALLSOURCE_ARCHS) ; do \
  1178 + find $(__srctree)include/asm-$${ARCH} $(RCS_FIND_IGNORE) \
  1179 + -name '*.[chS]' -print; \
  1180 + done ; \
1175 1181 find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
1176 1182 -name '*.[chS]' -print )
1177 1183 endef