[258bda3] | 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 | |
---|
[900c407] | 7 | define TESTDIR |
---|
| 8 | .PHONY: $1 |
---|
| 9 | $1: |
---|
| 10 | @+set fnord $(MAKEFLAGS); \ |
---|
[30eeb0d] | 11 | if test "$(1)" != "."; then \ |
---|
[7396e39] | 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 \ |
---|
[30eeb0d] | 23 | check_result=`$$$$tcheck exclude $(RTEMS_BSP) $$$$tdata $$$$tincludes $(1)`; \ |
---|
[7396e39] | 24 | else \ |
---|
[30eeb0d] | 25 | check_result="$(1)"; \ |
---|
[7396e39] | 26 | fi; \ |
---|
[30eeb0d] | 27 | if test "$(1)" = "$$$$check_result"; then \ |
---|
[900c407] | 28 | if test -f $$$$tcheck; then \ |
---|
[30eeb0d] | 29 | test_FLAGS=`$$$$tcheck flags $(RTEMS_BSP) $$$$tdata $$$$tincludes $(1)`; \ |
---|
[258bda3] | 30 | fi; \ |
---|
[900c407] | 31 | local_target="$$$$target"; \ |
---|
| 32 | if test -z "$$$$test_FLAGS"; then \ |
---|
[30eeb0d] | 33 | echo "BSP Testsuite: $(1): PASS"; \ |
---|
[258bda3] | 34 | else \ |
---|
[30eeb0d] | 35 | echo "BSP Testsuite: $(1): $$$$test_FLAGS"; \ |
---|
[258bda3] | 36 | fi; \ |
---|
[30eeb0d] | 37 | echo "Making $$$$target in $(1)"; \ |
---|
| 38 | cd $(1); \ |
---|
[900c407] | 39 | $(MAKE) $(AM_MAKEFLAGS) TEST_FLAGS="$$$$test_FLAGS" $$$$local_target; \ |
---|
[7396e39] | 40 | else \ |
---|
[30eeb0d] | 41 | echo "BSP Testsuite: $(1): EXCLUDED"; \ |
---|
[258bda3] | 42 | fi; \ |
---|
[900c407] | 43 | fi; |
---|
| 44 | endef |
---|
| 45 | |
---|
| 46 | $(foreach T,$(_SUBDIRS),$(eval $(call TESTDIR,$(strip $(T))))) |
---|
| 47 | |
---|
| 48 | all-local: $(_SUBDIRS) |
---|