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 | | |
| 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 | CXXINCS += -IMacOSX -I. |
| 66 | CPPFLAGS += $(CXXINCS) -DIRRLICHT_EXPORTS=1 |
| 67 | CXXFLAGS += -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing |
| 68 | ifndef NDEBUG |
| 69 | CXXFLAGS += -g -D_DEBUG |
| 70 | else |
| 71 | CXXFLAGS += -fexpensive-optimizations -O3 |
| 72 | endif |
| 73 | ifdef PROFILE |
| 74 | CXXFLAGS += -pg |
| 75 | endif |
| 76 | CFLAGS := -O3 -fexpensive-optimizations -DPNG_THREAD_UNSAFE_OK -DPNG_NO_MMX_CODE -DPNG_NO_MNG_FEATURES |
| 77 | |
| 78 | sharedlib sharedlib_osx: CXXFLAGS += -fPIC |
| 79 | sharedlib sharedlib_osx: CFLAGS += -fPIC |
| 80 | |
| 81 | #multilib handling |
| 82 | ifeq ($(HOSTTYPE), x86_64) |
| 83 | LIBSELECT=64 |
| 84 | endif |
| 85 | |
| 86 | #Linux specific options |
| 87 | staticlib sharedlib install: SYSTEM = Linux |
| 88 | STATIC_LIB = libIrrlicht.a |
| 89 | LIB_PATH = ../../lib/$(SYSTEM) |
| 90 | INSTALL_DIR = /usr/local/lib |
| 91 | sharedlib install: SHARED_LIB = libIrrlicht.so |
| 92 | sharedlib: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm |
| 93 | staticlib sharedlib: CXXINCS += -I/usr/X11R6/include |
| 94 | |
| 95 | #OSX specific options |
| 96 | staticlib_osx sharedlib_osx install_osx: SYSTEM = MacOSX |
| 97 | staticlib_osx sharedlib_osx: IRROTHEROBJ += MacOSX/CIrrDeviceMacOSX.o MacOSX/OSXClipboard.o MacOSX/AppDelegate.o |
| 98 | staticlib_osx sharedlib_osx: CXXINCS += -IMacOSX -I/usr/X11R6/include |
| 99 | sharedlib_osx install_osx: SHARED_LIB = libIrrlicht.dylib |
| 100 | staticlib_osx sharedlib_osx: LDFLAGS += --no-export-all-symbols --add-stdcall-alias |
| 101 | sharedlib_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 |
| 106 | IRRLICHT_DLL := ../../bin/Win32-gcc/Irrlicht.dll |
| 107 | sharedlib_win32 staticlib_win32: SYSTEM = Win32-gcc |
| 108 | sharedlib_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 |
| 111 | sharedlib_win32 staticlib_win32: CPPFLAGS += -DNO_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ -DNO_IRR_COMPILE_WITH_DIRECT3D_9_ |
| 112 | sharedlib_win32 staticlib_win32: CPPFLAGS += -DIRR_COMPILE_WITH_DX9_DEV_PACK -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL |
| 113 | staticlib_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ |
| 114 | |
| 115 | VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE) |
| 116 | SHARED_FULLNAME = $(SHARED_LIB).$(VERSION) |
| 117 | SONAME = $(SHARED_LIB).$(VERSION_MAJOR).$(VERSION_MINOR) |
| 118 | |
| 119 | #################### |
| 120 | # All target, builds Irrlicht as static lib (libIrrlicht.a) and copies it into lib/Linux |
| 121 | all linux: staticlib |
| 122 | |
| 123 | # Builds Irrlicht as shared lib (libIrrlicht.so.versionNumber) and copies it into lib/Linux |
| 124 | sharedlib: $(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 |
| 134 | staticlib 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 |
| 139 | all_win32 win32: sharedlib_win32 |
| 140 | sharedlib_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 |
| 144 | staticlib_win32: $(STATIC_LIB) |
| 145 | cp $^ $(LIB_PATH) |
| 146 | |
| 147 | # Builds Irrlicht as shared lib (libIrrlicht.so.versionNumber) and copies it into /lib/MacOSX |
| 148 | sharedlib_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 |
| 153 | install 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 | |
| 162 | TAGS: |
| 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 | |
| 177 | ifneq ($(MAKECMDGOALS),clean) |
| 178 | -include $(LINKOBJ:.o=.d) |
| 179 | endif |
| 180 | |
| 181 | help: |
| 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. |
| 193 | clean: |
| 194 | $(RM) $(LINKOBJ) $(SHARED_FULLNAME) $(STATIC_LIB) $(LINKOBJ:.o=.d) |
| 195 | |
| 196 | .PHONY: all sharedlib staticlib sharedlib_win32 staticlib_win32 help install clean |
| 197 | |