Ticket #31845: patch-Makefile.2.diff

File patch-Makefile.2.diff, 24.7 KB (added by nigels.com@…, 11 years ago)

Updated Makefile patch for current Irrlicht release

  • Makefile

    old new  
    1 VERSION_MAJOR = 1
    2 VERSION_MINOR = 8
    3 VERSION_RELEASE = 1
    4 # Irrlicht Engine 1.8.1
    5 # Makefile for Linux
    6 #
    7 # To use, just run:
    8 #
    9 # make
    10 #
    11 # This will compile Irrlicht, create a static lib (libIrrlicht.a), and copy it
    12 # into the subdirectory lib/Linux. That's all.
    13 #
    14 # If you want Irrlicht to be compiled as shared lib (libIrrlicht.so.versionnumber), then run:
    15 #
    16 # make sharedlib
    17 # make install
    18 #
    19 # If you want to compile in release mode run:
    20 #
    21 # make NDEBUG=1
    22 #
    23 # For cross-compilation for Win32 under Linux, just use the win32 targets. You have to set
    24 # at least CXX, CC, and AR to the proper binaries.
    25 #
    26 # For compiling on MinGW you can run it with:
    27 #
    28 # make win32
    29 #
    30 
    31 #List of object files, separated based on engine architecture
    32 IRRMESHLOADER = CBSPMeshFileLoader.o CMD2MeshFileLoader.o CMD3MeshFileLoader.o CMS3DMeshFileLoader.o CB3DMeshFileLoader.o C3DSMeshFileLoader.o COgreMeshFileLoader.o COBJMeshFileLoader.o CColladaFileLoader.o CCSMLoader.o CDMFLoader.o CLMTSMeshFileLoader.o CMY3DMeshFileLoader.o COCTLoader.o CXMeshFileLoader.o CIrrMeshFileLoader.o CSTLMeshFileLoader.o CLWOMeshFileLoader.o CPLYMeshFileLoader.o CSMFMeshFileLoader.o
    33 IRRMESHWRITER = CColladaMeshWriter.o CIrrMeshWriter.o CSTLMeshWriter.o COBJMeshWriter.o CPLYMeshWriter.o
    34 IRRMESHOBJ = $(IRRMESHLOADER) $(IRRMESHWRITER) \
    35         CSkinnedMesh.o CBoneSceneNode.o CMeshSceneNode.o \
    36         CAnimatedMeshSceneNode.o CAnimatedMeshMD2.o CAnimatedMeshMD3.o \
    37         CQ3LevelMesh.o CQuake3ShaderSceneNode.o CAnimatedMeshHalfLife.o
    38 IRROBJ = CBillboardSceneNode.o CCameraSceneNode.o CDummyTransformationSceneNode.o CEmptySceneNode.o CGeometryCreator.o CLightSceneNode.o CMeshManipulator.o CMetaTriangleSelector.o COctreeSceneNode.o COctreeTriangleSelector.o CSceneCollisionManager.o CSceneManager.o CShadowVolumeSceneNode.o CSkyBoxSceneNode.o CSkyDomeSceneNode.o CTerrainSceneNode.o CTerrainTriangleSelector.o CVolumeLightSceneNode.o CCubeSceneNode.o CSphereSceneNode.o CTextSceneNode.o CTriangleBBSelector.o CTriangleSelector.o CWaterSurfaceSceneNode.o CMeshCache.o CDefaultSceneNodeAnimatorFactory.o CDefaultSceneNodeFactory.o CSceneLoaderIrr.o
    39 IRRPARTICLEOBJ = CParticleAnimatedMeshSceneNodeEmitter.o CParticleBoxEmitter.o CParticleCylinderEmitter.o CParticleMeshEmitter.o CParticlePointEmitter.o CParticleRingEmitter.o CParticleSphereEmitter.o CParticleAttractionAffector.o CParticleFadeOutAffector.o CParticleGravityAffector.o CParticleRotationAffector.o CParticleSystemSceneNode.o CParticleScaleAffector.o
    40 IRRANIMOBJ = CSceneNodeAnimatorCameraFPS.o CSceneNodeAnimatorCameraMaya.o CSceneNodeAnimatorCollisionResponse.o CSceneNodeAnimatorDelete.o CSceneNodeAnimatorFlyCircle.o CSceneNodeAnimatorFlyStraight.o CSceneNodeAnimatorFollowSpline.o CSceneNodeAnimatorRotation.o CSceneNodeAnimatorTexture.o
    41 IRRDRVROBJ = CNullDriver.o COpenGLDriver.o COpenGLNormalMapRenderer.o COpenGLParallaxMapRenderer.o COpenGLShaderMaterialRenderer.o COpenGLTexture.o COpenGLSLMaterialRenderer.o COpenGLExtensionHandler.o CD3D8Driver.o CD3D8NormalMapRenderer.o CD3D8ParallaxMapRenderer.o CD3D8ShaderMaterialRenderer.o CD3D8Texture.o CD3D9Driver.o CD3D9HLSLMaterialRenderer.o CD3D9NormalMapRenderer.o CD3D9ParallaxMapRenderer.o CD3D9ShaderMaterialRenderer.o CD3D9Texture.o
    42 IRRIMAGEOBJ = CColorConverter.o CImage.o CImageLoaderBMP.o CImageLoaderDDS.o CImageLoaderJPG.o CImageLoaderPCX.o CImageLoaderPNG.o CImageLoaderPSD.o CImageLoaderTGA.o CImageLoaderPPM.o CImageLoaderWAL.o CImageLoaderRGB.o \
    43         CImageWriterBMP.o CImageWriterJPG.o CImageWriterPCX.o CImageWriterPNG.o CImageWriterPPM.o CImageWriterPSD.o CImageWriterTGA.o
    44 IRRVIDEOOBJ = CVideoModeList.o CFPSCounter.o $(IRRDRVROBJ) $(IRRIMAGEOBJ)
    45 IRRSWRENDEROBJ = CSoftwareDriver.o CSoftwareTexture.o CTRFlat.o CTRFlatWire.o CTRGouraud.o CTRGouraudWire.o CTRNormalMap.o CTRStencilShadow.o CTRTextureFlat.o CTRTextureFlatWire.o CTRTextureGouraud.o CTRTextureGouraudAdd.o CTRTextureGouraudNoZ.o CTRTextureGouraudWire.o CZBuffer.o CTRTextureGouraudVertexAlpha2.o CTRTextureGouraudNoZ2.o CTRTextureLightMap2_M2.o CTRTextureLightMap2_M4.o CTRTextureLightMap2_M1.o CSoftwareDriver2.o CSoftwareTexture2.o CTRTextureGouraud2.o CTRGouraud2.o CTRGouraudAlpha2.o CTRGouraudAlphaNoZ2.o CTRTextureDetailMap2.o CTRTextureGouraudAdd2.o CTRTextureGouraudAddNoZ2.o CTRTextureWire2.o CTRTextureLightMap2_Add.o CTRTextureLightMapGouraud2_M4.o IBurningShader.o CTRTextureBlend.o CTRTextureGouraudAlpha.o CTRTextureGouraudAlphaNoZ.o CDepthBuffer.o CBurningShader_Raster_Reference.o
    46 IRRIOOBJ = CFileList.o CFileSystem.o CLimitReadFile.o CMemoryFile.o CReadFile.o CWriteFile.o CXMLReader.o CXMLWriter.o CWADReader.o CZipReader.o CPakReader.o CNPKReader.o CTarReader.o CMountPointReader.o irrXML.o CAttributes.o lzma/LzmaDec.o
    47 IRROTHEROBJ = CIrrDeviceSDL.o CIrrDeviceLinux.o CIrrDeviceConsole.o CIrrDeviceStub.o CIrrDeviceWin32.o CIrrDeviceFB.o CLogger.o COSOperator.o Irrlicht.o os.o
    48 IRRGUIOBJ = CGUIButton.o CGUICheckBox.o CGUIComboBox.o CGUIContextMenu.o CGUIEditBox.o CGUIEnvironment.o CGUIFileOpenDialog.o CGUIFont.o CGUIImage.o CGUIInOutFader.o CGUIListBox.o CGUIMenu.o CGUIMeshViewer.o CGUIMessageBox.o CGUIModalScreen.o CGUIScrollBar.o CGUISpinBox.o CGUISkin.o CGUIStaticText.o CGUITabControl.o CGUITable.o CGUIToolBar.o CGUIWindow.o CGUIColorSelectDialog.o CDefaultGUIElementFactory.o CGUISpriteBank.o CGUIImageList.o CGUITreeView.o
    49 ZLIBOBJ = zlib/adler32.o zlib/compress.o zlib/crc32.o zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o zlib/uncompr.o zlib/zutil.o
    50 JPEGLIBOBJ = jpeglib/jcapimin.o jpeglib/jcapistd.o jpeglib/jccoefct.o jpeglib/jccolor.o jpeglib/jcdctmgr.o jpeglib/jchuff.o jpeglib/jcinit.o jpeglib/jcmainct.o jpeglib/jcmarker.o jpeglib/jcmaster.o jpeglib/jcomapi.o jpeglib/jcparam.o jpeglib/jcprepct.o jpeglib/jcsample.o jpeglib/jctrans.o jpeglib/jdapimin.o jpeglib/jdapistd.o jpeglib/jdatadst.o jpeglib/jdatasrc.o jpeglib/jdcoefct.o jpeglib/jdcolor.o jpeglib/jddctmgr.o jpeglib/jdhuff.o jpeglib/jdinput.o jpeglib/jdmainct.o jpeglib/jdmarker.o jpeglib/jdmaster.o jpeglib/jdmerge.o jpeglib/jdpostct.o jpeglib/jdsample.o jpeglib/jdtrans.o jpeglib/jerror.o jpeglib/jfdctflt.o jpeglib/jfdctfst.o jpeglib/jfdctint.o jpeglib/jidctflt.o jpeglib/jidctfst.o jpeglib/jidctint.o jpeglib/jmemmgr.o jpeglib/jmemnobs.o jpeglib/jquant1.o jpeglib/jquant2.o jpeglib/jutils.o jpeglib/jcarith.o jpeglib/jdarith.o jpeglib/jaricom.o
    51 LIBPNGOBJ = libpng/png.o libpng/pngerror.o libpng/pngget.o libpng/pngmem.o libpng/pngpread.o libpng/pngread.o libpng/pngrio.o libpng/pngrtran.o libpng/pngrutil.o libpng/pngset.o libpng/pngtrans.o libpng/pngwio.o libpng/pngwrite.o libpng/pngwtran.o libpng/pngwutil.o
    52 LIBAESGM = aesGladman/aescrypt.o aesGladman/aeskey.o aesGladman/aestab.o aesGladman/fileenc.o aesGladman/hmac.o aesGladman/prng.o aesGladman/pwd2key.o aesGladman/sha1.o aesGladman/sha2.o
    53 BZIP2OBJ = bzip2/blocksort.o bzip2/huffman.o bzip2/crctable.o bzip2/randtable.o bzip2/bzcompress.o bzip2/decompress.o bzip2/bzlib.o
    54 
    55 # Next variable is for additional scene nodes etc. of customized Irrlicht versions
    56 EXTRAOBJ =
    57 LINKOBJ = $(IRRMESHOBJ) $(IRROBJ) $(IRRPARTICLEOBJ) $(IRRANIMOBJ) \
    58         $(IRRVIDEOOBJ) $(IRRSWRENDEROBJ) $(IRRIOOBJ) $(IRROTHEROBJ) \
    59         $(IRRGUIOBJ) $(ZLIBOBJ) $(JPEGLIBOBJ) $(LIBPNGOBJ) $(LIBAESGM) \
    60         $(BZIP2OBJ) $(EXTRAOBJ)
    61 
    62 ###############
    63 #Compiler flags
    64 CXXINCS = -I../../include -Izlib -Ijpeglib -Ilibpng
    65 CPPFLAGS += $(CXXINCS) -DIRRLICHT_EXPORTS=1
    66 CXXFLAGS += -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing
    67 ifndef NDEBUG
    68 CXXFLAGS += -g -D_DEBUG
    69 else
    70 CXXFLAGS += -fexpensive-optimizations -O3
    71 endif
    72 ifdef PROFILE
    73 CXXFLAGS += -pg
    74 endif
    75 CFLAGS := -O3 -fexpensive-optimizations -DPNG_THREAD_UNSAFE_OK -DPNG_NO_MMX_CODE -DPNG_NO_MNG_FEATURES
    76 
    77 sharedlib sharedlib_osx: CXXFLAGS += -fPIC
    78 sharedlib sharedlib_osx: CFLAGS += -fPIC
    79 
    80 #multilib handling
    81 ifeq ($(HOSTTYPE), x86_64)
    82 LIBSELECT=64
    83 endif
    84 
    85 #Linux specific options
    86 staticlib sharedlib install: SYSTEM = Linux
    87 STATIC_LIB = libIrrlicht.a
    88 LIB_PATH = ../../lib/$(SYSTEM)
    89 INSTALL_DIR = /usr/local/lib
    90 sharedlib install: SHARED_LIB = libIrrlicht.so
    91 sharedlib: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm
    92 staticlib sharedlib: CXXINCS += -I/usr/X11R6/include
    93 
    94 #OSX specific options
    95 staticlib_osx sharedlib_osx install_osx: SYSTEM = MacOSX
    96 staticlib_osx sharedlib_osx: IRROTHEROBJ += MacOSX/CIrrDeviceMacOSX.o MacOSX/OSXClipboard.o MacOSX/AppDelegate.o
    97 staticlib_osx sharedlib_osx: CXXINCS += -IMacOSX -I/usr/X11R6/include
    98 sharedlib_osx install_osx: SHARED_LIB = libIrrlicht.dylib
    99 staticlib_osx sharedlib_osx: LDFLAGS += --no-export-all-symbols --add-stdcall-alias
    100 sharedlib_osx: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm
    101 # for non-X11 app
    102 #sharedlib_osx: LDFLAGS += -framework cocoa -framework carbon -framework opengl -framework IOKit
    103 
    104 #Windows specific options
    105 IRRLICHT_DLL := ../../bin/Win32-gcc/Irrlicht.dll
    106 sharedlib_win32 staticlib_win32: SYSTEM = Win32-gcc
    107 sharedlib_win32: LDFLAGS += -lgdi32 -lopengl32 -ld3dx9d -lwinmm -Wl,--add-stdcall-alias
    108 #choose either -DIRR_COMPILE_WITH_DX9_DEV_PACK or -DNO_IRR_COMPILE_WITH_DIRECT3D_9_ depending if you need dx9
    109 #sharedlib_win32 staticlib_win32: CPPFLAGS += -DIRR_COMPILE_WITH_DX9_DEV_PACK
    110 sharedlib_win32 staticlib_win32: CPPFLAGS += -DNO_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ -DNO_IRR_COMPILE_WITH_DIRECT3D_9_
    111 sharedlib_win32 staticlib_win32: CPPFLAGS += -DIRR_COMPILE_WITH_DX9_DEV_PACK -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL
    112 staticlib_win32: CPPFLAGS += -D_IRR_STATIC_LIB_
    113 
    114 VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE)
    115 SHARED_FULLNAME = $(SHARED_LIB).$(VERSION)
    116 SONAME = $(SHARED_LIB).$(VERSION_MAJOR).$(VERSION_MINOR)
    117 
    118 ####################
    119 # All target, builds Irrlicht as static lib (libIrrlicht.a) and copies it into lib/Linux
    120 all linux: staticlib
    121 
    122 # Builds Irrlicht as shared lib (libIrrlicht.so.versionNumber) and copies it into lib/Linux
    123 sharedlib: $(LINKOBJ)
    124         $(CXX) $(CPPFLAGS) $(CXXFLAGS) -shared -Wl,-soname,$(SONAME) -o $(SHARED_FULLNAME) $^ $(LDFLAGS)
    125         mkdir -p $(LIB_PATH)
    126         cp $(SHARED_FULLNAME) $(LIB_PATH)
    127 
    128 # Builds Irrlicht as static lib (libIrrlicht.a)
    129 $(STATIC_LIB): $(LINKOBJ)
    130         $(AR) rs $@ $^
    131 
    132 # Copies static lib into lib/Linux
    133 staticlib staticlib_osx: $(STATIC_LIB)
    134         mkdir -p $(LIB_PATH)
    135         cp $^ $(LIB_PATH)
    136 
    137 # Builds Irrlicht as dll (Irrlicht.dll) into ../../bin/Win32-gcc
    138 all_win32 win32: sharedlib_win32
    139 sharedlib_win32: $(IRRLICHT_DLL)
    140 ../../bin/Win32-gcc/Irrlicht.dll: $(LINKOBJ)
    141         $(CXX) $(CPPFLAGS) $(CXXFLAGS) -shared -o $@ $^ $(LDFLAGS) -Wl,--out-implib,../../lib/Win32-gcc/$(STATIC_LIB)
    142 # Copies static lib into /lib/Win32-gcc
    143 staticlib_win32: $(STATIC_LIB)
    144         cp $^ $(LIB_PATH)
    145 
    146 # Builds Irrlicht as shared lib (libIrrlicht.so.versionNumber) and copies it into /lib/MacOSX
    147 sharedlib_osx: $(LINKOBJ)
    148         $(CXX) $(CPPFLAGS) $(CXXFLAGS) -dynamiclib -Wl,-install_name,$(SONAME) -o $(SHARED_FULLNAME) $^ $(LDFLAGS)
    149         cp $(SHARED_FULLNAME) $(LIB_PATH)
    150 
    151 # Installs Irrlicht if it was created as shared lib
    152 install install_osx:
    153         $(RM) -r $(INSTALL_DIR)/../include/irrlicht
    154         mkdir -p $(INSTALL_DIR)/../include/irrlicht
    155         cp ../../include/*.h $(INSTALL_DIR)/../include/irrlicht/
    156         cp $(LIB_PATH)/$(SHARED_FULLNAME) $(INSTALL_DIR)
    157         cd $(INSTALL_DIR) && ln -s -f $(SHARED_FULLNAME) $(SONAME)
    158         cd $(INSTALL_DIR) && ln -s -f $(SONAME) $(SHARED_LIB)
    159 #       ldconfig -n $(INSTALL_DIR)
    160 
    161 TAGS:
    162         ctags *.cpp ../../include/*.h *.h
    163 
    164 # Create dependency files for automatic recompilation
    165 %.d:%.cpp
    166         $(CXX) $(CPPFLAGS) -MM -MF $@ $<
    167 
    168 # Create dependency files for automatic recompilation
    169 %.d:%.c
    170         $(CC) $(CPPFLAGS) -MM -MF $@ $<
    171 
    172 # Create object files from objective-c code
    173 %.o:%.mm
    174         $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
    175 
    176 ifneq ($(MAKECMDGOALS),clean)
    177 -include $(LINKOBJ:.o=.d)
    178 endif
    179 
    180 help:
    181         @echo "Available targets for Irrlicht"
    182         @echo " sharedlib: Build shared library Irrlicht.so for Linux"
    183         @echo " staticlib: Build static library Irrlicht.a for Linux"
    184         @echo " install: Copy shared library to /usr/local/lib"
    185         @echo ""
    186         @echo " sharedlib_win32: Build shared library Irrlicht.dll for Windows"
    187         @echo " staticlib_win32: Build static library Irrlicht.a for Windows"
    188         @echo ""
    189         @echo " clean: Clean up directory"
    190 
    191 # Cleans all temporary files and compilation results.
    192 clean:
    193         $(RM) $(LINKOBJ) $(SHARED_FULLNAME) $(STATIC_LIB) $(LINKOBJ:.o=.d)
    194 
    195 .PHONY: all sharedlib staticlib sharedlib_win32 staticlib_win32 help install clean
    196 
     1VERSION_MAJOR = 1
     2VERSION_MINOR = 8
     3VERSION_RELEASE = 1
     4# Irrlicht Engine 1.8.1
     5# Makefile for Linux
     6#
     7# To use, just run:
     8#
     9# make
     10#
     11# This will compile Irrlicht, create a static lib (libIrrlicht.a), and copy it
     12# into the subdirectory lib/Linux. That's all.
     13#
     14# If you want Irrlicht to be compiled as shared lib (libIrrlicht.so.versionnumber), then run:
     15#
     16# make sharedlib
     17# make install
     18#
     19# If you want to compile in release mode run:
     20#
     21# make NDEBUG=1
     22#
     23# For cross-compilation for Win32 under Linux, just use the win32 targets. You have to set
     24# at least CXX, CC, and AR to the proper binaries.
     25#
     26# For compiling on MinGW you can run it with:
     27#
     28# make win32
     29#
     30
     31#List of object files, separated based on engine architecture
     32IRRMESHLOADER = CBSPMeshFileLoader.o CMD2MeshFileLoader.o CMD3MeshFileLoader.o CMS3DMeshFileLoader.o CB3DMeshFileLoader.o C3DSMeshFileLoader.o COgreMeshFileLoader.o COBJMeshFileLoader.o CColladaFileLoader.o CCSMLoader.o CDMFLoader.o CLMTSMeshFileLoader.o CMY3DMeshFileLoader.o COCTLoader.o CXMeshFileLoader.o CIrrMeshFileLoader.o CSTLMeshFileLoader.o CLWOMeshFileLoader.o CPLYMeshFileLoader.o CSMFMeshFileLoader.o
     33IRRMESHWRITER = CColladaMeshWriter.o CIrrMeshWriter.o CSTLMeshWriter.o COBJMeshWriter.o CPLYMeshWriter.o
     34IRRMESHOBJ = $(IRRMESHLOADER) $(IRRMESHWRITER) \
     35        CSkinnedMesh.o CBoneSceneNode.o CMeshSceneNode.o \
     36        CAnimatedMeshSceneNode.o CAnimatedMeshMD2.o CAnimatedMeshMD3.o \
     37        CQ3LevelMesh.o CQuake3ShaderSceneNode.o CAnimatedMeshHalfLife.o
     38IRROBJ = CBillboardSceneNode.o CCameraSceneNode.o CDummyTransformationSceneNode.o CEmptySceneNode.o CGeometryCreator.o CLightSceneNode.o CMeshManipulator.o CMetaTriangleSelector.o COctreeSceneNode.o COctreeTriangleSelector.o CSceneCollisionManager.o CSceneManager.o CShadowVolumeSceneNode.o CSkyBoxSceneNode.o CSkyDomeSceneNode.o CTerrainSceneNode.o CTerrainTriangleSelector.o CVolumeLightSceneNode.o CCubeSceneNode.o CSphereSceneNode.o CTextSceneNode.o CTriangleBBSelector.o CTriangleSelector.o CWaterSurfaceSceneNode.o CMeshCache.o CDefaultSceneNodeAnimatorFactory.o CDefaultSceneNodeFactory.o CSceneLoaderIrr.o
     39IRRPARTICLEOBJ = CParticleAnimatedMeshSceneNodeEmitter.o CParticleBoxEmitter.o CParticleCylinderEmitter.o CParticleMeshEmitter.o CParticlePointEmitter.o CParticleRingEmitter.o CParticleSphereEmitter.o CParticleAttractionAffector.o CParticleFadeOutAffector.o CParticleGravityAffector.o CParticleRotationAffector.o CParticleSystemSceneNode.o CParticleScaleAffector.o
     40IRRANIMOBJ = CSceneNodeAnimatorCameraFPS.o CSceneNodeAnimatorCameraMaya.o CSceneNodeAnimatorCollisionResponse.o CSceneNodeAnimatorDelete.o CSceneNodeAnimatorFlyCircle.o CSceneNodeAnimatorFlyStraight.o CSceneNodeAnimatorFollowSpline.o CSceneNodeAnimatorRotation.o CSceneNodeAnimatorTexture.o
     41IRRDRVROBJ = CNullDriver.o COpenGLDriver.o COpenGLNormalMapRenderer.o COpenGLParallaxMapRenderer.o COpenGLShaderMaterialRenderer.o COpenGLTexture.o COpenGLSLMaterialRenderer.o COpenGLExtensionHandler.o CD3D8Driver.o CD3D8NormalMapRenderer.o CD3D8ParallaxMapRenderer.o CD3D8ShaderMaterialRenderer.o CD3D8Texture.o CD3D9Driver.o CD3D9HLSLMaterialRenderer.o CD3D9NormalMapRenderer.o CD3D9ParallaxMapRenderer.o CD3D9ShaderMaterialRenderer.o CD3D9Texture.o
     42IRRIMAGEOBJ = CColorConverter.o CImage.o CImageLoaderBMP.o CImageLoaderDDS.o CImageLoaderJPG.o CImageLoaderPCX.o CImageLoaderPNG.o CImageLoaderPSD.o CImageLoaderTGA.o CImageLoaderPPM.o CImageLoaderWAL.o CImageLoaderRGB.o \
     43        CImageWriterBMP.o CImageWriterJPG.o CImageWriterPCX.o CImageWriterPNG.o CImageWriterPPM.o CImageWriterPSD.o CImageWriterTGA.o
     44IRRVIDEOOBJ = CVideoModeList.o CFPSCounter.o $(IRRDRVROBJ) $(IRRIMAGEOBJ)
     45IRRSWRENDEROBJ = CSoftwareDriver.o CSoftwareTexture.o CTRFlat.o CTRFlatWire.o CTRGouraud.o CTRGouraudWire.o CTRNormalMap.o CTRStencilShadow.o CTRTextureFlat.o CTRTextureFlatWire.o CTRTextureGouraud.o CTRTextureGouraudAdd.o CTRTextureGouraudNoZ.o CTRTextureGouraudWire.o CZBuffer.o CTRTextureGouraudVertexAlpha2.o CTRTextureGouraudNoZ2.o CTRTextureLightMap2_M2.o CTRTextureLightMap2_M4.o CTRTextureLightMap2_M1.o CSoftwareDriver2.o CSoftwareTexture2.o CTRTextureGouraud2.o CTRGouraud2.o CTRGouraudAlpha2.o CTRGouraudAlphaNoZ2.o CTRTextureDetailMap2.o CTRTextureGouraudAdd2.o CTRTextureGouraudAddNoZ2.o CTRTextureWire2.o CTRTextureLightMap2_Add.o CTRTextureLightMapGouraud2_M4.o IBurningShader.o CTRTextureBlend.o CTRTextureGouraudAlpha.o CTRTextureGouraudAlphaNoZ.o CDepthBuffer.o CBurningShader_Raster_Reference.o
     46IRRIOOBJ = CFileList.o CFileSystem.o CLimitReadFile.o CMemoryFile.o CReadFile.o CWriteFile.o CXMLReader.o CXMLWriter.o CWADReader.o CZipReader.o CPakReader.o CNPKReader.o CTarReader.o CMountPointReader.o irrXML.o CAttributes.o lzma/LzmaDec.o
     47IRROTHEROBJ = CIrrDeviceSDL.o CIrrDeviceLinux.o CIrrDeviceConsole.o CIrrDeviceStub.o CIrrDeviceWin32.o CIrrDeviceFB.o CLogger.o COSOperator.o Irrlicht.o os.o
     48IRRGUIOBJ = CGUIButton.o CGUICheckBox.o CGUIComboBox.o CGUIContextMenu.o CGUIEditBox.o CGUIEnvironment.o CGUIFileOpenDialog.o CGUIFont.o CGUIImage.o CGUIInOutFader.o CGUIListBox.o CGUIMenu.o CGUIMeshViewer.o CGUIMessageBox.o CGUIModalScreen.o CGUIScrollBar.o CGUISpinBox.o CGUISkin.o CGUIStaticText.o CGUITabControl.o CGUITable.o CGUIToolBar.o CGUIWindow.o CGUIColorSelectDialog.o CDefaultGUIElementFactory.o CGUISpriteBank.o CGUIImageList.o CGUITreeView.o
     49ZLIBOBJ = zlib/adler32.o zlib/compress.o zlib/crc32.o zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o zlib/uncompr.o zlib/zutil.o
     50JPEGLIBOBJ = jpeglib/jcapimin.o jpeglib/jcapistd.o jpeglib/jccoefct.o jpeglib/jccolor.o jpeglib/jcdctmgr.o jpeglib/jchuff.o jpeglib/jcinit.o jpeglib/jcmainct.o jpeglib/jcmarker.o jpeglib/jcmaster.o jpeglib/jcomapi.o jpeglib/jcparam.o jpeglib/jcprepct.o jpeglib/jcsample.o jpeglib/jctrans.o jpeglib/jdapimin.o jpeglib/jdapistd.o jpeglib/jdatadst.o jpeglib/jdatasrc.o jpeglib/jdcoefct.o jpeglib/jdcolor.o jpeglib/jddctmgr.o jpeglib/jdhuff.o jpeglib/jdinput.o jpeglib/jdmainct.o jpeglib/jdmarker.o jpeglib/jdmaster.o jpeglib/jdmerge.o jpeglib/jdpostct.o jpeglib/jdsample.o jpeglib/jdtrans.o jpeglib/jerror.o jpeglib/jfdctflt.o jpeglib/jfdctfst.o jpeglib/jfdctint.o jpeglib/jidctflt.o jpeglib/jidctfst.o jpeglib/jidctint.o jpeglib/jmemmgr.o jpeglib/jmemnobs.o jpeglib/jquant1.o jpeglib/jquant2.o jpeglib/jutils.o jpeglib/jcarith.o jpeglib/jdarith.o jpeglib/jaricom.o
     51LIBPNGOBJ = libpng/png.o libpng/pngerror.o libpng/pngget.o libpng/pngmem.o libpng/pngpread.o libpng/pngread.o libpng/pngrio.o libpng/pngrtran.o libpng/pngrutil.o libpng/pngset.o libpng/pngtrans.o libpng/pngwio.o libpng/pngwrite.o libpng/pngwtran.o libpng/pngwutil.o
     52LIBAESGM = aesGladman/aescrypt.o aesGladman/aeskey.o aesGladman/aestab.o aesGladman/fileenc.o aesGladman/hmac.o aesGladman/prng.o aesGladman/pwd2key.o aesGladman/sha1.o aesGladman/sha2.o
     53BZIP2OBJ = bzip2/blocksort.o bzip2/huffman.o bzip2/crctable.o bzip2/randtable.o bzip2/bzcompress.o bzip2/decompress.o bzip2/bzlib.o
     54
     55# Next variable is for additional scene nodes etc. of customized Irrlicht versions
     56EXTRAOBJ =
     57LINKOBJ = $(IRRMESHOBJ) $(IRROBJ) $(IRRPARTICLEOBJ) $(IRRANIMOBJ) \
     58        $(IRRVIDEOOBJ) $(IRRSWRENDEROBJ) $(IRRIOOBJ) $(IRROTHEROBJ) \
     59        $(IRRGUIOBJ) $(ZLIBOBJ) $(JPEGLIBOBJ) $(LIBPNGOBJ) $(LIBAESGM) \
     60        $(BZIP2OBJ) $(EXTRAOBJ)
     61
     62###############
     63#Compiler flags
     64CXXINCS = -I../../include -Izlib -Ijpeglib -Ilibpng
     65CXXINCS += -IMacOSX -I.
     66CPPFLAGS += $(CXXINCS) -DIRRLICHT_EXPORTS=1
     67CXXFLAGS += -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing
     68ifndef NDEBUG
     69CXXFLAGS += -g -D_DEBUG
     70else
     71CXXFLAGS += -fexpensive-optimizations -O3
     72endif
     73ifdef PROFILE
     74CXXFLAGS += -pg
     75endif
     76CFLAGS := -O3 -fexpensive-optimizations -DPNG_THREAD_UNSAFE_OK -DPNG_NO_MMX_CODE -DPNG_NO_MNG_FEATURES
     77
     78sharedlib sharedlib_osx: CXXFLAGS += -fPIC
     79sharedlib sharedlib_osx: CFLAGS += -fPIC
     80
     81#multilib handling
     82ifeq ($(HOSTTYPE), x86_64)
     83LIBSELECT=64
     84endif
     85
     86#Linux specific options
     87staticlib sharedlib install: SYSTEM = Linux
     88STATIC_LIB = libIrrlicht.a
     89LIB_PATH = ../../lib/$(SYSTEM)
     90INSTALL_DIR = /usr/local/lib
     91sharedlib install: SHARED_LIB = libIrrlicht.so
     92sharedlib: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm
     93staticlib sharedlib: CXXINCS += -I/usr/X11R6/include
     94
     95#OSX specific options
     96staticlib_osx sharedlib_osx install_osx: SYSTEM = MacOSX
     97staticlib_osx sharedlib_osx: IRROTHEROBJ += MacOSX/CIrrDeviceMacOSX.o MacOSX/OSXClipboard.o MacOSX/AppDelegate.o
     98staticlib_osx sharedlib_osx: CXXINCS += -IMacOSX -I/usr/X11R6/include
     99sharedlib_osx install_osx: SHARED_LIB = libIrrlicht.dylib
     100staticlib_osx sharedlib_osx: LDFLAGS += --no-export-all-symbols --add-stdcall-alias
     101sharedlib_osx: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm
     102# for non-X11 app
     103#sharedlib_osx: LDFLAGS += -framework cocoa -framework carbon -framework opengl -framework IOKit
     104
     105#Windows specific options
     106IRRLICHT_DLL := ../../bin/Win32-gcc/Irrlicht.dll
     107sharedlib_win32 staticlib_win32: SYSTEM = Win32-gcc
     108sharedlib_win32: LDFLAGS += -lgdi32 -lopengl32 -ld3dx9d -lwinmm -Wl,--add-stdcall-alias
     109#choose either -DIRR_COMPILE_WITH_DX9_DEV_PACK or -DNO_IRR_COMPILE_WITH_DIRECT3D_9_ depending if you need dx9
     110#sharedlib_win32 staticlib_win32: CPPFLAGS += -DIRR_COMPILE_WITH_DX9_DEV_PACK
     111sharedlib_win32 staticlib_win32: CPPFLAGS += -DNO_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ -DNO_IRR_COMPILE_WITH_DIRECT3D_9_
     112sharedlib_win32 staticlib_win32: CPPFLAGS += -DIRR_COMPILE_WITH_DX9_DEV_PACK -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL
     113staticlib_win32: CPPFLAGS += -D_IRR_STATIC_LIB_
     114
     115VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE)
     116SHARED_FULLNAME = $(SHARED_LIB).$(VERSION)
     117SONAME = $(SHARED_LIB).$(VERSION_MAJOR).$(VERSION_MINOR)
     118
     119####################
     120# All target, builds Irrlicht as static lib (libIrrlicht.a) and copies it into lib/Linux
     121all linux: staticlib
     122
     123# Builds Irrlicht as shared lib (libIrrlicht.so.versionNumber) and copies it into lib/Linux
     124sharedlib: $(LINKOBJ)
     125        $(CXX) $(CPPFLAGS) $(CXXFLAGS) -shared -Wl,-soname,$(SONAME) -o $(SHARED_FULLNAME) $^ $(LDFLAGS)
     126        mkdir -p $(LIB_PATH)
     127        cp $(SHARED_FULLNAME) $(LIB_PATH)
     128
     129# Builds Irrlicht as static lib (libIrrlicht.a)
     130$(STATIC_LIB): $(LINKOBJ)
     131        $(AR) rs $@ $^
     132
     133# Copies static lib into lib/Linux
     134staticlib staticlib_osx: $(STATIC_LIB)
     135        mkdir -p $(LIB_PATH)
     136        cp $^ $(LIB_PATH)
     137
     138# Builds Irrlicht as dll (Irrlicht.dll) into ../../bin/Win32-gcc
     139all_win32 win32: sharedlib_win32
     140sharedlib_win32: $(IRRLICHT_DLL)
     141../../bin/Win32-gcc/Irrlicht.dll: $(LINKOBJ)
     142        $(CXX) $(CPPFLAGS) $(CXXFLAGS) -shared -o $@ $^ $(LDFLAGS) -Wl,--out-implib,../../lib/Win32-gcc/$(STATIC_LIB)
     143# Copies static lib into /lib/Win32-gcc
     144staticlib_win32: $(STATIC_LIB)
     145        cp $^ $(LIB_PATH)
     146
     147# Builds Irrlicht as shared lib (libIrrlicht.so.versionNumber) and copies it into /lib/MacOSX
     148sharedlib_osx: $(LINKOBJ)
     149        $(CXX) $(CPPFLAGS) $(CXXFLAGS) -dynamiclib -Wl,-install_name,$(SONAME) -o $(SHARED_FULLNAME) $^ $(LDFLAGS)
     150        cp $(SHARED_FULLNAME) $(LIB_PATH)
     151
     152# Installs Irrlicht if it was created as shared lib
     153install install_osx:
     154        $(RM) -r $(INSTALL_DIR)/../include/irrlicht
     155        mkdir -p $(INSTALL_DIR)/../include/irrlicht
     156        cp ../../include/*.h $(INSTALL_DIR)/../include/irrlicht/
     157        cp $(LIB_PATH)/$(SHARED_FULLNAME) $(INSTALL_DIR)
     158        cd $(INSTALL_DIR) && ln -s -f $(SHARED_FULLNAME) $(SONAME)
     159        cd $(INSTALL_DIR) && ln -s -f $(SONAME) $(SHARED_LIB)
     160#       ldconfig -n $(INSTALL_DIR)
     161
     162TAGS:
     163        ctags *.cpp ../../include/*.h *.h
     164
     165# Create dependency files for automatic recompilation
     166%.d:%.cpp
     167        $(CXX) $(CPPFLAGS) -MM -MF $@ $<
     168
     169# Create dependency files for automatic recompilation
     170%.d:%.c
     171        $(CC) $(CPPFLAGS) -MM -MF $@ $<
     172
     173# Create object files from objective-c code
     174%.o:%.mm
     175        $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
     176
     177ifneq ($(MAKECMDGOALS),clean)
     178-include $(LINKOBJ:.o=.d)
     179endif
     180
     181help:
     182        @echo "Available targets for Irrlicht"
     183        @echo " sharedlib: Build shared library Irrlicht.so for Linux"
     184        @echo " staticlib: Build static library Irrlicht.a for Linux"
     185        @echo " install: Copy shared library to /usr/local/lib"
     186        @echo ""
     187        @echo " sharedlib_win32: Build shared library Irrlicht.dll for Windows"
     188        @echo " staticlib_win32: Build static library Irrlicht.a for Windows"
     189        @echo ""
     190        @echo " clean: Clean up directory"
     191
     192# Cleans all temporary files and compilation results.
     193clean:
     194        $(RM) $(LINKOBJ) $(SHARED_FULLNAME) $(STATIC_LIB) $(LINKOBJ:.o=.d)
     195
     196.PHONY: all sharedlib staticlib sharedlib_win32 staticlib_win32 help install clean
     197