diff options
Diffstat (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/Makefile')
-rw-r--r-- | src/others/irrlicht-1.8.1/source/Irrlicht/Makefile | 203 |
1 files changed, 203 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/Makefile b/src/others/irrlicht-1.8.1/source/Irrlicht/Makefile new file mode 100644 index 0000000..5ba4ced --- /dev/null +++ b/src/others/irrlicht-1.8.1/source/Irrlicht/Makefile | |||
@@ -0,0 +1,203 @@ | |||
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 | # onefang changes start | ||
58 | #LINKOBJ = $(IRRMESHOBJ) $(IRROBJ) $(IRRPARTICLEOBJ) $(IRRANIMOBJ) \ | ||
59 | # $(IRRVIDEOOBJ) $(IRRSWRENDEROBJ) $(IRRIOOBJ) $(IRROTHEROBJ) \ | ||
60 | # $(IRRGUIOBJ) $(ZLIBOBJ) $(JPEGLIBOBJ) $(LIBPNGOBJ) $(LIBAESGM) \ | ||
61 | # $(BZIP2OBJ) $(EXTRAOBJ) | ||
62 | LINKOBJ = $(IRRMESHOBJ) $(IRROBJ) $(IRRPARTICLEOBJ) $(IRRANIMOBJ) $(IRRVIDEOOBJ) $(IRRSWRENDEROBJ) $(IRRIOOBJ) $(IRROTHEROBJ) $(LIBAESGM) $(EXTRAOBJ) | ||
63 | # onefang changes end | ||
64 | |||
65 | ############### | ||
66 | #Compiler flags | ||
67 | # onefang changes start | ||
68 | #CXXINCS = -I../../include -Izlib -Ijpeglib -Ilibpng | ||
69 | #CPPFLAGS += $(CXXINCS) -DIRRLICHT_EXPORTS=1 | ||
70 | CXXINCS = -I../../include | ||
71 | CPPFLAGS += $(CXXINCS) -DIRRLICHT_EXPORTS=1 -DNO_IRR_COMPILE_WITH_GUI_=1 -DNO_IRR_USE_NON_SYSTEM_JPEG_LIB_=1 -DNO_IRR_USE_NON_SYSTEM_LIB_PNG_=1 -DNO_IRR_USE_NON_SYSTEM_BZIP2_=1 -DNO_IRR_USE_NON_SYSTEM_ZLIB_=1 | ||
72 | # onefang changes end | ||
73 | CXXFLAGS += -Wall -pipe -fno-exceptions -fno-rtti -fstrict-aliasing | ||
74 | ifndef NDEBUG | ||
75 | CXXFLAGS += -g -D_DEBUG | ||
76 | else | ||
77 | CXXFLAGS += -fexpensive-optimizations -O3 | ||
78 | endif | ||
79 | ifdef PROFILE | ||
80 | CXXFLAGS += -pg | ||
81 | endif | ||
82 | CFLAGS := -O3 -fexpensive-optimizations -DPNG_THREAD_UNSAFE_OK -DPNG_NO_MMX_CODE -DPNG_NO_MNG_FEATURES | ||
83 | |||
84 | sharedlib sharedlib_osx: CXXFLAGS += -fPIC | ||
85 | sharedlib sharedlib_osx: CFLAGS += -fPIC | ||
86 | |||
87 | #multilib handling | ||
88 | ifeq ($(HOSTTYPE), x86_64) | ||
89 | LIBSELECT=64 | ||
90 | endif | ||
91 | |||
92 | #Linux specific options | ||
93 | staticlib sharedlib install: SYSTEM = Linux | ||
94 | STATIC_LIB = libIrrlicht.a | ||
95 | LIB_PATH = ../../lib/$(SYSTEM) | ||
96 | INSTALL_DIR = /usr/local/lib | ||
97 | sharedlib install: SHARED_LIB = libIrrlicht.so | ||
98 | sharedlib: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm | ||
99 | staticlib sharedlib: CXXINCS += -I/usr/X11R6/include | ||
100 | |||
101 | #OSX specific options | ||
102 | staticlib_osx sharedlib_osx install_osx: SYSTEM = MacOSX | ||
103 | staticlib_osx sharedlib_osx: IRROTHEROBJ += MacOSX/CIrrDeviceMacOSX.o MacOSX/OSXClipboard.o MacOSX/AppDelegate.o | ||
104 | staticlib_osx sharedlib_osx: CXXINCS += -IMacOSX -I/usr/X11R6/include | ||
105 | sharedlib_osx install_osx: SHARED_LIB = libIrrlicht.dylib | ||
106 | staticlib_osx sharedlib_osx: LDFLAGS += --no-export-all-symbols --add-stdcall-alias | ||
107 | sharedlib_osx: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm | ||
108 | # for non-X11 app | ||
109 | #sharedlib_osx: LDFLAGS += -framework cocoa -framework carbon -framework opengl -framework IOKit | ||
110 | |||
111 | #Windows specific options | ||
112 | IRRLICHT_DLL := ../../bin/Win32-gcc/Irrlicht.dll | ||
113 | sharedlib_win32 staticlib_win32: SYSTEM = Win32-gcc | ||
114 | sharedlib_win32: LDFLAGS += -lgdi32 -lopengl32 -ld3dx9d -lwinmm -Wl,--add-stdcall-alias | ||
115 | #choose either -DIRR_COMPILE_WITH_DX9_DEV_PACK or -DNO_IRR_COMPILE_WITH_DIRECT3D_9_ depending if you need dx9 | ||
116 | #sharedlib_win32 staticlib_win32: CPPFLAGS += -DIRR_COMPILE_WITH_DX9_DEV_PACK | ||
117 | sharedlib_win32 staticlib_win32: CPPFLAGS += -DNO_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ -DNO_IRR_COMPILE_WITH_DIRECT3D_9_ | ||
118 | sharedlib_win32 staticlib_win32: CPPFLAGS += -DIRR_COMPILE_WITH_DX9_DEV_PACK -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL | ||
119 | staticlib_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ | ||
120 | |||
121 | VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE) | ||
122 | SHARED_FULLNAME = $(SHARED_LIB).$(VERSION) | ||
123 | SONAME = $(SHARED_LIB).$(VERSION_MAJOR).$(VERSION_MINOR) | ||
124 | |||
125 | #################### | ||
126 | # All target, builds Irrlicht as static lib (libIrrlicht.a) and copies it into lib/Linux | ||
127 | all linux: staticlib | ||
128 | |||
129 | # Builds Irrlicht as shared lib (libIrrlicht.so.versionNumber) and copies it into lib/Linux | ||
130 | sharedlib: $(LINKOBJ) | ||
131 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -shared -Wl,-soname,$(SONAME) -o $(SHARED_FULLNAME) $^ $(LDFLAGS) | ||
132 | mkdir -p $(LIB_PATH) | ||
133 | cp $(SHARED_FULLNAME) $(LIB_PATH) | ||
134 | |||
135 | # Builds Irrlicht as static lib (libIrrlicht.a) | ||
136 | $(STATIC_LIB): $(LINKOBJ) | ||
137 | $(AR) rs $@ $^ | ||
138 | |||
139 | # Copies static lib into lib/Linux | ||
140 | staticlib staticlib_osx: $(STATIC_LIB) | ||
141 | mkdir -p $(LIB_PATH) | ||
142 | cp $^ $(LIB_PATH) | ||
143 | |||
144 | # Builds Irrlicht as dll (Irrlicht.dll) into ../../bin/Win32-gcc | ||
145 | all_win32 win32: sharedlib_win32 | ||
146 | sharedlib_win32: $(IRRLICHT_DLL) | ||
147 | ../../bin/Win32-gcc/Irrlicht.dll: $(LINKOBJ) | ||
148 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -shared -o $@ $^ $(LDFLAGS) -Wl,--out-implib,../../lib/Win32-gcc/$(STATIC_LIB) | ||
149 | # Copies static lib into /lib/Win32-gcc | ||
150 | staticlib_win32: $(STATIC_LIB) | ||
151 | cp $^ $(LIB_PATH) | ||
152 | |||
153 | # Builds Irrlicht as shared lib (libIrrlicht.so.versionNumber) and copies it into /lib/MacOSX | ||
154 | sharedlib_osx: $(LINKOBJ) | ||
155 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -dynamiclib -Wl,-install_name,$(SONAME) -o $(SHARED_FULLNAME) $^ $(LDFLAGS) | ||
156 | cp $(SHARED_FULLNAME) $(LIB_PATH) | ||
157 | |||
158 | # Installs Irrlicht if it was created as shared lib | ||
159 | install install_osx: | ||
160 | $(RM) -r $(INSTALL_DIR)/../include/irrlicht | ||
161 | mkdir -p $(INSTALL_DIR)/../include/irrlicht | ||
162 | cp ../../include/*.h $(INSTALL_DIR)/../include/irrlicht/ | ||
163 | cp $(LIB_PATH)/$(SHARED_FULLNAME) $(INSTALL_DIR) | ||
164 | cd $(INSTALL_DIR) && ln -s -f $(SHARED_FULLNAME) $(SONAME) | ||
165 | cd $(INSTALL_DIR) && ln -s -f $(SONAME) $(SHARED_LIB) | ||
166 | # ldconfig -n $(INSTALL_DIR) | ||
167 | |||
168 | TAGS: | ||
169 | ctags *.cpp ../../include/*.h *.h | ||
170 | |||
171 | # Create dependency files for automatic recompilation | ||
172 | %.d:%.cpp | ||
173 | $(CXX) $(CPPFLAGS) -MM -MF $@ $< | ||
174 | |||
175 | # Create dependency files for automatic recompilation | ||
176 | %.d:%.c | ||
177 | $(CC) $(CPPFLAGS) -MM -MF $@ $< | ||
178 | |||
179 | # Create object files from objective-c code | ||
180 | %.o:%.mm | ||
181 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< | ||
182 | |||
183 | ifneq ($(MAKECMDGOALS),clean) | ||
184 | -include $(LINKOBJ:.o=.d) | ||
185 | endif | ||
186 | |||
187 | help: | ||
188 | @echo "Available targets for Irrlicht" | ||
189 | @echo " sharedlib: Build shared library Irrlicht.so for Linux" | ||
190 | @echo " staticlib: Build static library Irrlicht.a for Linux" | ||
191 | @echo " install: Copy shared library to /usr/local/lib" | ||
192 | @echo "" | ||
193 | @echo " sharedlib_win32: Build shared library Irrlicht.dll for Windows" | ||
194 | @echo " staticlib_win32: Build static library Irrlicht.a for Windows" | ||
195 | @echo "" | ||
196 | @echo " clean: Clean up directory" | ||
197 | |||
198 | # Cleans all temporary files and compilation results. | ||
199 | clean: | ||
200 | $(RM) $(LINKOBJ) $(SHARED_FULLNAME) $(STATIC_LIB) $(LINKOBJ:.o=.d) | ||
201 | |||
202 | .PHONY: all sharedlib staticlib sharedlib_win32 staticlib_win32 help install clean | ||
203 | |||