TOP = ../..

include $(TOP)/mk/config.mk

SUBDIRS = thread echo

all::
	@(unset MAKEFLAGS; \
          set -e; \
          if [ "$$subdir_makeflags" = "" ]; then \
             subdir_makeflags='$(SUBDIR_MAKEFLAGS)'; \
          fi; \
          if [ "$$subdirs" = "" ]; then \
             subdirs='$(SUBDIRS)'; \
          fi; \
          if [ "$$target" = "" ]; then \
             target='$@'; \
          fi; \
          for i in $$subdirs ; do \
             (cd $$i ; echo "making $$target in $$i..." ; \
              eval make $$subdir_makeflags $$target ) ; \
             if [ $$? != 0 ]; then \
                exit 1; \
             fi; \
          done; \
         )

clean::
	@(unset MAKEFLAGS; \
          set -e; \
          if [ "$$subdir_makeflags" = "" ]; then \
             subdir_makeflags='$(SUBDIR_MAKEFLAGS)'; \
          fi; \
          if [ "$$subdirs" = "" ]; then \
             subdirs='$(SUBDIRS)'; \
          fi; \
          if [ "$$target" = "" ]; then \
             target='$@'; \
          fi; \
          for i in $$subdirs ; do \
             (cd $$i ; echo "making $$target in $$i..." ; \
              eval make $$subdir_makeflags $$target ) ; \
             if [ $$? != 0 ]; then \
                exit 1; \
             fi; \
          done; \
         )


install::
	@(unset MAKEFLAGS; \
          set -e; \
          if [ "$$subdir_makeflags" = "" ]; then \
             subdir_makeflags='$(SUBDIR_MAKEFLAGS)'; \
          fi; \
          if [ "$$subdirs" = "" ]; then \
             subdirs='$(SUBDIRS)'; \
          fi; \
          if [ "$$target" = "" ]; then \
             target='$@'; \
          fi; \
          for i in $$subdirs ; do \
             (cd $$i ; echo "making $$target in $$i..." ; \
              eval make $$subdir_makeflags $$target ) ; \
             if [ $$? != 0 ]; then \
                exit 1; \
             fi; \
          done; \
         )

