#
!IFNDEF ESP_ROOT
!ERROR ESP_ROOT must be set -- Please fix the environment...
!ENDIF
!IFNDEF ESP_ARCH
!ERROR ESP_ARCH must be set -- Please fix the environment...
!ENDIF
#

LDIR  = $(ESP_ROOT)\lib

all: $(LDIR)\utils.lib
	@for /D %%D in ("*") do @( \
	  @if /I not "%%D"=="utils" @( \
	   @if exist "%%D\NMakefile" ( \
	    pushd %%D & $(MAKE) -nologo -f NMakefile & popd \
	  ) \
	 ) \
	)

$(LDIR)\utils.lib: utils\*.c utils\*.h
	pushd utils & $(MAKE) -nologo -f NMakefile & popd

test:
	@for /D %%D in ("*") do @( \
	  @if exist "%%D\test\NMakefile" ( \
	    pushd %%D\test & $(MAKE) -nologo -f NMakefile test & popd \
	  ) \
	)

clean:
	@for /D %%D in ("*") do @( \
	 @if exist "%%D\NMakefile" ( \
	  pushd %%D & $(MAKE) -nologo -f NMakefile clean & popd \
	 ) \
	)

cleanall:
	@for /D %%D in ("*") do @( \
	 @if exist "%%D\NMakefile" ( \
	  pushd %%D & $(MAKE) -nologo -f NMakefile cleanall & popd \
	 ) \
	)
