source: rtems/testsuites/automake/subdirs.am @ 7ec982bf

5
Last change on this file since 7ec982bf was 7ec982bf, checked in by Chris Johns <chrisj@…>, on 05/26/17 at 00:35:17

build-system: Fix the targets support for the parallel build.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1## Borrowed from automake/subdir.am which borrowed automake-1.4 and adapted to RTEMS
2
3## NOTE: This is a temporary work-around until automake is removed from RTEMS.
4##   It is a hack within many hacks and is designed to keep the source as clean
5##   as possible.
6
7define TESTDIR
8.PHONY: $1
9$1:
10        @+set fnord $(MAKEFLAGS); \
11        if test "$(1)" != "."; then \
12          target=`echo $(MAKECMDGOALS) | sed s/-recursive//`; \
13          if test "$$$$target" = "all-local-am"; then \
14            target="all-am"; \
15          fi; \
16          if test "$$$$target" = "all-local"; then \
17            target="all"; \
18          fi; \
19          tcheck="$(top_srcdir)/../../tools/build/rtems-test-check-py"; \
20          tdata="$(RTEMS_BSP)-testsuite.tcfg"; \
21          tincludes="$(top_srcdir)/../../c/src/lib/libbsp/$(RTEMS_CPU)/$(RTEMS_BSP_FAMILY)/make/custom:$(top_srcdir)/.."; \
22          if test -f $$$$tcheck; then \
23            check_result=`$$$$tcheck exclude $(RTEMS_BSP) $$$$tdata $$$$tincludes $(1)`; \
24          else \
25            check_result="$(1)"; \
26          fi; \
27          if test "$(1)" = "$$$$check_result"; then \
28            if test -f $$$$tcheck; then \
29              test_FLAGS=`$$$$tcheck flags $(RTEMS_BSP) $$$$tdata $$$$tincludes $(1)`; \
30            fi; \
31            if test -z "$$$$test_FLAGS"; then \
32              echo "BSP Testsuite: $(1): PASS"; \
33            else \
34              echo "BSP Testsuite: $(1): $$$$test_FLAGS"; \
35            fi; \
36            echo "Making $$$$target in $(1)"; \
37            cd $(1); \
38            $(MAKE) $(AM_MAKEFLAGS) TEST_FLAGS="$$$$test_FLAGS" $$$$target; \
39          else \
40            echo "BSP Testsuite: $(1): EXCLUDED"; \
41          fi; \
42        fi;
43endef
44
45$(foreach T,$(_SUBDIRS),$(eval $(call TESTDIR,$(strip $(T)))))
46
47all-local:  $(_SUBDIRS)
Note: See TracBrowser for help on using the repository browser.