Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

radix tree test suite: fix mapshift build target

Commit c6ce3e2fe3da ("radix tree test suite: Add config option for map
shift") introduced a phony makefile target called 'mapshift' that ends
up generating the file generated/map-shift.h. This phony target was
then added as a dependency of the top level 'targets' build target,
which is what is run when you go to tools/testing/radix-tree and just
type 'make'.

Unfortunately, this phony target doesn't actually work as a dependency,
so you end up getting:

$ make
make: *** No rule to make target 'generated/map-shift.h', needed by 'main.o'. Stop.
make: *** Waiting for unfinished jobs....

Fix this by making the file generated/map-shift.h our real makefile
target, and add this a dependency of the top level build target.

Link: http://lkml.kernel.org/r/20180503192430.7582-2-ross.zwisler@linux.intel.com
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: CR, Sapthagirish <sapthagirish.cr@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Ross Zwisler and committed by
Linus Torvalds
8d9fa88e d97baf94

+2 -4
+2 -4
tools/testing/radix-tree/Makefile
··· 17 17 LDFLAGS += -m32 18 18 endif 19 19 20 - targets: mapshift $(TARGETS) 20 + targets: generated/map-shift.h $(TARGETS) 21 21 22 22 main: $(OFILES) 23 23 ··· 42 42 idr.c: ../../../lib/idr.c 43 43 sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@ 44 44 45 - .PHONY: mapshift 46 - 47 - mapshift: 45 + generated/map-shift.h: 48 46 @if ! grep -qws $(SHIFT) generated/map-shift.h; then \ 49 47 echo "#define RADIX_TREE_MAP_SHIFT $(SHIFT)" > \ 50 48 generated/map-shift.h; \