[PATCH] Fix recursive make in clang-tools-extra
Eric Christopher
echristo at gmail.com
Fri Mar 1 11:57:01 PST 2013
LGTM.
-eric
On Thu, Feb 28, 2013 at 12:58 PM, Edwin Vane <edwin.vane at intel.com> wrote:
> Hi gribozavr, echristo,
>
> Autoconf make (all) now properly recurses from tools/extra/Makefile into
> tools/extra/test/Makefile and tools/extra/test/cpp11-migrate/Makefile.
> The 'all' target is responsible for creating lit config files and
> autogenerating tests. Subsequent 'check-all' targets will properly work.
>
> Re-enabling UseAuto/iterator.cpp test.
>
> General clean-up of clang-tools-extra makefiles, removing dead targets
> and not using copied pieces of Makefile.rules.
>
> http://llvm-reviews.chandlerc.com/D479
>
> Files:
> Makefile
> test/Makefile
> test/cpp11-migrate/Makefile
> test/cpp11-migrate/UseAuto/iterator.cpp
>
> Index: Makefile
> ===================================================================
> --- Makefile
> +++ Makefile
> @@ -12,29 +12,15 @@
> include $(CLANG_LEVEL)/../../Makefile.config
>
> PARALLEL_DIRS := remove-cstr-calls tool-template clang-format
> cpp11-migrate
> +DIRS := test
>
> include $(CLANG_LEVEL)/Makefile
>
> -###
> -# Handle the nested test suite.
> -
> -ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
> -$(RecursiveTargets)::
> - $(Verb) for dir in test; do \
> - if [ -f $(PROJ_SRC_DIR)/$${dir}/Makefile ] && [ ! -f
> $${dir}/Makefile ]; then \
> - $(MKDIR) $${dir}; \
> - $(CP) $(PROJ_SRC_DIR)/$${dir}/Makefile $${dir}/Makefile; \
> - fi \
> - done
> -endif
> -
> +# Custom target. Pass request to test/Makefile that knows what to do. To
> access
> +# this target you'd issue:
> +#
> +# make -C <build_dir>/tools/clang/tools/extra test
> test::
> - @ $(MAKE) -C test
> -
> -report::
> - @ $(MAKE) -C test report
> -
> -clean::
> - @ $(MAKE) -C test clean
> + @ $(MAKE) -C test test
>
> -.PHONY: test report clean
> +.PHONY: test
> Index: test/Makefile
> ===================================================================
> --- test/Makefile
> +++ test/Makefile
> @@ -9,8 +9,6 @@
>
> CLANG_LEVEL := ../../..
> include $(CLANG_LEVEL)/../../Makefile.config
> -
> -# Recurse into any subdirectories that have their own Makefiles.
> DIRS := cpp11-migrate
> include $(CLANG_LEVEL)/Makefile
>
> @@ -45,14 +43,19 @@
> endif
>
> all:: lit.site.cfg
> +
> +# Run just the Clang extra tools tests. This target assumes 'make (all)'
> has
> +# been run previously as that target is responsible for generating lit
> config
> +# files and auto-generated tests.
> +test::
> @ echo '--- Running the Clang extra tools tests for
> $(TARGET_TRIPLE) ---'
> @ $(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py \
> $(LIT_ARGS) $(TESTARGS) $(TESTDIRS)
>
> FORCE:
>
> lit.site.cfg: FORCE
> - @echo "Making Clang extra tools' 'lit.site.cfg' file..."
> + @echo "Making lit.site.cfg for Clang extra tools..."
> @$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > lit.tmp
> @$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> lit.tmp
> @$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
> @@ -69,4 +72,4 @@
> clean::
> @ find . -name Output | xargs rm -fr
>
> -.PHONY: all report clean
> +.PHONY: all test clean
> Index: test/cpp11-migrate/Makefile
> ===================================================================
> --- test/cpp11-migrate/Makefile
> +++ test/cpp11-migrate/Makefile
> @@ -22,7 +22,6 @@
> UseAuto/gen_basic_std_iterator_tests.cpp.py \
> UseAuto/Inputs/gen_my_std.h.py
>
> -
> # macro to be used with $(call) that generates a rule and recipe that
> causes a
> # file to be auto-generated from a generator script. Generator scripts
> must
> # follow scheme above. The resulting file is placed in:
> Index: test/cpp11-migrate/UseAuto/iterator.cpp
> ===================================================================
> --- test/cpp11-migrate/UseAuto/iterator.cpp
> +++ test/cpp11-migrate/UseAuto/iterator.cpp
> @@ -1,6 +1,6 @@
> // RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
> -// NORUN cpp11-migrate -use-auto %t.cpp -- --std=c++11 -I
> %gen_root/UseAuto/Inputs
> -// NORUN FileCheck -input-file=%t.cpp %s
> +// RUN: cpp11-migrate -use-auto %t.cpp -- --std=c++11 -I
> %gen_root/UseAuto/Inputs
> +// RUN: FileCheck -input-file=%t.cpp %s
> #include "my_std.h"
>
> typedef std::vector<int>::iterator int_iterator;
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130301/ab5a3644/attachment.html>
More information about the cfe-commits
mailing list