GNUmakefile.in 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2009-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. #
  5. # StarPU is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU Lesser General Public License as published by
  7. # the Free Software Foundation; either version 2.1 of the License, or (at
  8. # your option) any later version.
  9. #
  10. # StarPU is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. #
  14. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. #
  16. SUBDIRS=
  17. @STARPU_BUILD_EXAMPLES_TRUE@SUBDIRS += examples
  18. @STARPU_BUILD_TESTS_TRUE@SUBDIRS += tests
  19. all:
  20. @STARPU_SIMGRID_FALSE@check: check-recursive
  21. @STARPU_SIMGRID_FALSE@ :
  22. # divide by 4 the number of jobs to run in parallel, since mpirun will start 4
  23. # processes in the tests and examples
  24. @STARPU_SIMGRID_FALSE@check-recursive:
  25. @STARPU_SIMGRID_FALSE@ RET=0 ; \
  26. @STARPU_SIMGRID_FALSE@ NJOBS=`printf %s "$(MAKEFLAGS)" | sed -ne 's/.*-j \?\([0-9]\+\).*/\1/p'` ; \
  27. @STARPU_SIMGRID_FALSE@ JOBS="" ; \
  28. @STARPU_SIMGRID_FALSE@ if [ -n "$$NJOBS" ] ; then \
  29. @STARPU_SIMGRID_FALSE@ if [ "$$NJOBS" -ge 4 ] ; then \
  30. @STARPU_SIMGRID_FALSE@ JOBS="-j$$(($$NJOBS / 4))" ; \
  31. @STARPU_SIMGRID_FALSE@ else \
  32. @STARPU_SIMGRID_FALSE@ JOBS="-j1" ; \
  33. @STARPU_SIMGRID_FALSE@ fi ; \
  34. @STARPU_SIMGRID_FALSE@ fi ; \
  35. @STARPU_SIMGRID_FALSE@ for i in $(SUBDIRS) ; do \
  36. @STARPU_SIMGRID_FALSE@ $(MAKE) check -C $$i MAKEFLAGS="$(MAKEFLAGS) $$JOBS" || RET=1; \
  37. @STARPU_SIMGRID_FALSE@ done ; \
  38. @STARPU_SIMGRID_FALSE@ exit $$RET
  39. %: force
  40. @$(MAKE) -f Makefile $@
  41. force: ;