# Makefile for jpeglib

CC=cl
LD=link
O=.obj
RM=del
RMDIR=rd /s
MKDIR=md
CHDIR=cd
ECHO=echo
CP=copy
S=^\

!IF ( "$(CONFIG)" == "Debug" )

LIBDIR=Debug
CFLAGS=-Zi -nologo -MDd -Y- -Iinclude
LDFLAGS=-NOLOGO -DEBUG -DLL

!ELSE

LIBDIR=Release
CFLAGS=-Ox -nologo -MD -Y- -Iinclude -I..$(S)Dependencies$(S)
LDFLAGS=-NOLOGO -DLL

!ENDIF

#uncomment next to put error messages in a file
#ERRFILE= >> ogremainerrs

# variables
SRCDIR = src
OBJDIR = obj$(S)$(LIBDIR)
HDRDIR = include

OBJ = \
$(OBJDIR)$(S)OgreArchiveEx$(O) \
$(OBJDIR)$(S)OgreArchiveManager$(O) \
$(OBJDIR)$(S)OgreAxisAlignedBox$(O) \
$(OBJDIR)$(S)OgreBillboard$(O) \
$(OBJDIR)$(S)OgreBillboardSet$(O) \
$(OBJDIR)$(S)OgreBitwise$(O) \
$(OBJDIR)$(S)OgreCamera$(O) \
$(OBJDIR)$(S)OgreColourValue$(O) \
$(OBJDIR)$(S)OgreConfigFile$(O) \
$(OBJDIR)$(S)OgreConfigOptionMap$(O) \
$(OBJDIR)$(S)OgreController$(O) \
$(OBJDIR)$(S)OgreControllerManager$(O) \
$(OBJDIR)$(S)OgreDataChunk$(O) \
$(OBJDIR)$(S)OgreDynLib$(O) \
$(OBJDIR)$(S)OgreDynLibManager$(O) \
$(OBJDIR)$(S)OgreEntity$(O) \
$(OBJDIR)$(S)OgreException$(O) \
$(OBJDIR)$(S)OgreImage$(O) \
$(OBJDIR)$(S)OgreInput$(O) \
$(OBJDIR)$(S)OgreLight$(O) \
$(OBJDIR)$(S)OgreLog$(O) \
$(OBJDIR)$(S)OgreLogManager$(O) \
$(OBJDIR)$(S)OgreMaterial$(O) \
$(OBJDIR)$(S)OgreMaterialManager$(O) \
$(OBJDIR)$(S)OgreMath$(O) \
$(OBJDIR)$(S)OgreMatrix3$(O) \
$(OBJDIR)$(S)OgreMatrix4$(O) \
$(OBJDIR)$(S)OgreMesh$(O) \
$(OBJDIR)$(S)OgreMeshManager$(O) \
$(OBJDIR)$(S)OgreMovableObject$(O) \
$(OBJDIR)$(S)OgreOofModelFile$(O) \
$(OBJDIR)$(S)OgreParticleEmitter$(O) \
$(OBJDIR)$(S)OgreParticleEmitterCommands$(O) \
$(OBJDIR)$(S)OgreParticleIterator$(O) \
$(OBJDIR)$(S)OgreParticleSystem$(O) \
$(OBJDIR)$(S)OgreParticleSystemManager$(O) \
$(OBJDIR)$(S)OgrePatchSurface$(O) \
$(OBJDIR)$(S)OgrePlane$(O) \
$(OBJDIR)$(S)OgrePlatformManager$(O) \
$(OBJDIR)$(S)OgrePredefinedControllers$(O) \
$(OBJDIR)$(S)OgreQuaternion$(O) \
$(OBJDIR)$(S)OgreRenderQueue$(O) \
$(OBJDIR)$(S)OgreRenderSystem$(O) \
$(OBJDIR)$(S)OgreRenderTarget$(O) \
$(OBJDIR)$(S)OgreRenderWindow$(O) \
$(OBJDIR)$(S)OgreRenderWindowMap$(O) \
$(OBJDIR)$(S)OgreResourceManager$(O) \
$(OBJDIR)$(S)OgreResourceMap$(O) \
$(OBJDIR)$(S)OgreRoot$(O) \
$(OBJDIR)$(S)OgreSceneManager$(O) \
$(OBJDIR)$(S)OgreSceneManagerEnumerator$(O) \
$(OBJDIR)$(S)OgreSceneNode$(O) \
$(OBJDIR)$(S)OgreSDDataChunk$(O) \
$(OBJDIR)$(S)OgreSimpleRenderable$(O) \
$(OBJDIR)$(S)OgreSingleton$(O) \
$(OBJDIR)$(S)OgreString$(O) \
$(OBJDIR)$(S)OgreStringConverter$(O) \
$(OBJDIR)$(S)OgreStringInterface$(O) \
$(OBJDIR)$(S)OgreStringVector$(O) \
$(OBJDIR)$(S)OgreSubEntity$(O) \
$(OBJDIR)$(S)OgreSubMesh$(O) \
$(OBJDIR)$(S)OgreTextureLayer$(O) \
$(OBJDIR)$(S)OgreTextureManager$(O) \
$(OBJDIR)$(S)OgreUnzip$(O) \
$(OBJDIR)$(S)OgreVector3$(O) \
$(OBJDIR)$(S)OgreViewport$(O) \
$(OBJDIR)$(S)OgreZip$(O) \
$(OBJDIR)$(S)OgreZipArchiveFactory$(O)

SRC = \
src$(S)OgreArchiveEx.cpp \
src$(S)OgreArchiveManager.cpp \
src$(S)OgreAxisAlignedBox.cpp \
src$(S)OgreBillboard.cpp \
src$(S)OgreBillboardSet.cpp \
src$(S)OgreBitwise.cpp \
src$(S)OgreCamera.cpp \
src$(S)OgreColourValue.cpp \
src$(S)OgreConfigFile.cpp \
src$(S)OgreConfigOptionMap.cpp \
src$(S)OgreController.cpp \
src$(S)OgreControllerManager.cpp \
src$(S)OgreDataChunk.cpp \
src$(S)OgreDynLib.cpp \
src$(S)OgreDynLibManager.cpp \
src$(S)OgreEntity.cpp \
src$(S)OgreException.cpp \
src$(S)OgreImage.cpp \
src$(S)OgreInput.cpp \
src$(S)OgreLight.cpp \
src$(S)OgreLog.cpp \
src$(S)OgreLogManager.cpp \
src$(S)OgreMaterial.cpp \
src$(S)OgreMaterialManager.cpp \
src$(S)OgreMath.cpp \
src$(S)OgreMatrix3.cpp \
src$(S)OgreMatrix4.cpp \
src$(S)OgreMesh.cpp \
src$(S)OgreMeshManager.cpp \
src$(S)OgreMovableObject.cpp \
src$(S)OgreOofModelFile.cpp \
src$(S)OgreParticleEmitter.cpp \
src$(S)OgreParticleEmitterCommands.cpp \
src$(S)OgreParticleIterator.cpp \
src$(S)OgreParticleSystem.cpp \
src$(S)OgreParticleSystemManager.cpp \
src$(S)OgrePatchSurface.cpp \
src$(S)OgrePlane.cpp \
src$(S)OgrePlatformManager.cpp \
src$(S)OgrePredefinedControllers.cpp \
src$(S)OgreQuaternion.cpp \
src$(S)OgreRenderQueue.cpp \
src$(S)OgreRenderSystem.cpp \
src$(S)OgreRenderTarget.cpp \
src$(S)OgreRenderWindow.cpp \
src$(S)OgreRenderWindowMap.cpp \
src$(S)OgreResourceManager.cpp \
src$(S)OgreResourceMap.cpp \
src$(S)OgreRoot.cpp \
src$(S)OgreSceneManager.cpp \
src$(S)OgreSceneManagerEnumerator.cpp \
src$(S)OgreSceneNode.cpp \
src$(S)OgreSDDataChunk.cpp \
src$(S)OgreSimpleRenderable.cpp \
src$(S)OgreSingleton.cpp \
src$(S)OgreString.cpp \
src$(S)OgreStringConverter.cpp \
src$(S)OgreStringInterface.cpp \
src$(S)OgreStringVector.cpp \
src$(S)OgreSubEntity.cpp \
src$(S)OgreSubMesh.cpp \
src$(S)OgreTextureLayer.cpp \
src$(S)OgreTextureManager.cpp \
src$(S)OgreUnzip.c \
src$(S)OgreVector3.cpp \
src$(S)OgreViewport.cpp \
src$(S)OgreZip.cpp \
src$(S)OgreZipArchiveFactory.cpp

HDR = 

OUTLIB=lib$(S)$(LIBDIR)$(S)OgreMain.dll

all: $(OUTLIB)

$(OUTLIB): config $(OBJ)
	$(LD) $(OBJ) $(LDFLAGS) -OUT:$(OUTLIB)


{$(SRCDIR)}.c{$(OBJDIR)}$(O):
	$(CC) -c $(CFLAGS) -Fo$*$(O) $<

{$(SRCDIR)}.cpp{$(OBJDIR)}$(O):
	$(CC) -c $(CFLAGS) -Fo$*$(O) $<

$(OBJ):

config:
	$(CHDIR) ..$(S)Dependencies
	
	$(CHDIR) zlib
	$(MAKE) -f scripts$(S)makefile.vc6 CONFIG=$(CONFIG)
	$(CHDIR) ..

	$(CHDIR) libpng
	$(MAKE) -f scripts$(S)makefile.vc6 CONFIG=$(CONFIG)
	$(CHDIR) ..

	$(CHDIR) jpeglib
	$(MAKE) -f scripts$(S)makefile.vc6 CONFIG=$(CONFIG)
	$(CHDIR) ..

clean:
	-$(RM) $(OBJ)
	-$(RM) $(OUTLIB)
