#------------------------------------------------------------------------------
#	makefile
#------------------------------------------------------------------------------

.SILENT :

TARGET	= $(TARGET)

build:
        $(MAKE) /$(MAKEFLAGS) build_project TARGET=Cache
        $(MAKE) /$(MAKEFLAGS) build_project TARGET=Draw2D
        $(MAKE) /$(MAKEFLAGS) build_project TARGET=Draw3D
        $(MAKE) /$(MAKEFLAGS) build_project TARGET=Light
        $(MAKE) /$(MAKEFLAGS) build_project TARGET=Logo
        $(MAKE) /$(MAKEFLAGS) build_project TARGET=Map
        $(MAKE) /$(MAKEFLAGS) build_project TARGET=Motlink
        $(MAKE) /$(MAKEFLAGS) build_project TARGET=Scroll
        $(MAKE) /$(MAKEFLAGS) build_project TARGET=Shape
        $(MAKE) /$(MAKEFLAGS) build_project TARGET=Sprite
        $(MAKE) /$(MAKEFLAGS) build_project TARGET=Teapot
        $(MAKE) /$(MAKEFLAGS) build_project TARGET=Temjin
        $(MAKE) /$(MAKEFLAGS) build_project TARGET=Texture
        $(MAKE) /$(MAKEFLAGS) build_project TARGET=Torus

build_project:
	echo Building...$(TARGET)
	cd .\$(TARGET)
	$(MAKE) /$(MAKEFLAGS) /f$(TARGET).mak
	cd ..

clean:
        $(MAKE) /$(MAKEFLAGS) clean_project TARGET=Cache
        $(MAKE) /$(MAKEFLAGS) clean_project TARGET=Draw2D
        $(MAKE) /$(MAKEFLAGS) clean_project TARGET=Draw3D
        $(MAKE) /$(MAKEFLAGS) clean_project TARGET=Light
        $(MAKE) /$(MAKEFLAGS) clean_project TARGET=Logo
        $(MAKE) /$(MAKEFLAGS) clean_project TARGET=Map
        $(MAKE) /$(MAKEFLAGS) clean_project TARGET=Motlink
        $(MAKE) /$(MAKEFLAGS) clean_project TARGET=Scroll
        $(MAKE) /$(MAKEFLAGS) clean_project TARGET=Shape
        $(MAKE) /$(MAKEFLAGS) clean_project TARGET=Sprite
        $(MAKE) /$(MAKEFLAGS) clean_project TARGET=Teapot
        $(MAKE) /$(MAKEFLAGS) clean_project TARGET=Temjin
        $(MAKE) /$(MAKEFLAGS) clean_project TARGET=Texture
        $(MAKE) /$(MAKEFLAGS) clean_project TARGET=Torus

clean_project:
	echo Cleaning...$(TARGET)
	cd .\$(TARGET)
	$(MAKE) /$(MAKEFLAGS) /f$(TARGET).mak clean
	cd ..