Explorar el Código

- A few changes in the build system. Now SDL is taken from the official repos instead of distro

Panagiotis Christopoulos Charitos hace 15 años
padre
commit
dec77e53c9
Se han modificado 3 ficheros con 68 adiciones y 33 borrados
  1. 52 22
      build/README
  2. 13 8
      build/debug/Makefile
  3. 3 3
      build/debug/gen.cfg.py

+ 52 - 22
build/README

@@ -1,34 +1,64 @@
----------------------------------------------------------------------------------------------------------------------------------------
-HOW TO GENERATE MAKEFILES
----------------------------------------------------------------------------------------------------------------------------------------
 
-There are 4 build targets in this folder. There is also a build system that generates GNU makefiles. If you want to generate the makefile for the debug target (for example) do the following:
+AnKi build system is very Linux specific (GNU make only) at the moment. It
+also requires a few extra development libraries. You can also find a custom
+build system that generates GNU makefiles.
 
-cd <path to anki>/build/debug
-../genmakefile.py
 
-This will generate a "Makefile". To build just type:
+1) Required libraries
 
-make
+	AnKi requires a few up to date versions of some libraries. The libraries are:
+	- Bullet Physics
+	- SDL 1.3
 
-And the build will begin. 
+	So before generating makefiles or building AnKi you have to download from
+	their repositories and build the above libraries. Instructions follow:
+	
 
-WARNING: Sometimes I forget to update all the targets. The debug is always updated though
+1.1) Bullet Physics Library
 
-The gen.cfg.py files contain the build options of every target. Their format is pretty straightforward and minimal
+	From now on the AnKi requires the Bullet physics library. You need CMake and
+	SVN installed.
 
+	1) Go to the root AnKi path (where src, shaders and blenderscripts are)
+	2) cd ..
+	3) svn checkout http://bullet.googlecode.com/svn/trunk/ bullet_svn
+	4) cd bullet_svn
+	5) cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release
+	6) make
 
----------------------------------------------------------------------------------------------------------------------------------------
-HOW TO BUILD BULLET PHYSICS
----------------------------------------------------------------------------------------------------------------------------------------
 
-From now on the AnKi requires the Bullet Physics library. Bullet dev files do not ship with any Linux distribution, for now, so you have to download it manually and build it. Here is how:
+1.2) SDL ver 1.3
 
-1) Go to the root AnKi path (where src, shaders and blenderscripts are)
-2) cd ..
-3) svn checkout http://bullet.googlecode.com/svn/trunk/ bullet_svn
-4) cd bullet_svn
-5) cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release
-6) make
+	We need SDL ver 1.3 for creating OpenGL 3.x context. You need to have the
+	Mercurial and autoconf installed.
 
-The above steps build Bullet statically. If you want to download bullet in a different dir then make the apropriate changes in the gen.cfg.py files
+	1) Go to the root AnKi path (where src, shaders and blenderscripts are)
+	2) cd ..
+	3) hg clone http://hg.libsdl.org/SDL SDL-hg
+	4) cd SDL-hg
+	5) ./autogen.sh
+	6) ./configure
+	7) make
+
+
+2) Generating makefiles and building AnKi
+
+	There are 4 build targets in this folder. There is also a build system that
+	generates GNU makefiles (it requires Python 3 installed). If you want to 
+	generate the makefile for the debug target (for example) do the following:
+
+	1) cd <path to anki>/build/debug
+	3) ../genmakefile.py
+	
+	Now there is an updated "Makefile". To build just type:
+	
+	1) make
+
+	And the build process will begin. 
+
+	WARNING: Sometimes I forget to update all the targets. The debug is always
+	updated though.
+
+	The gen.cfg.py files contain the build options of every target. Their format
+	is pretty straightforward and minimal.
+	

+ 13 - 8
build/debug/Makefile

@@ -1,12 +1,12 @@
 CXX = g++
 COMMONFLAGS = 
-CFLAGS = $(COMMONFLAGS) -c -pedantic-errors -pedantic -ansi -Wall -Wextra -W -pipe -O0 -g3 -pg `sdl-config --cflags` -fsingle-precision-constant -D_DEBUG_ -D_TERMINAL_COLORING__ -D_PLATFORM_LINUX_ -DREVISION=\"`svnversion -c ../..`\" 
+CFLAGS = $(COMMONFLAGS) -c -pedantic-errors -pedantic -ansi -Wall -Wextra -W -pipe -O0 -g3 -pg -fsingle-precision-constant -D_DEBUG_ -D_TERMINAL_COLORING__ -D_PLATFORM_LINUX_ -DPLATFORM=LINUX -DREVISION=\"`svnversion -c ../..`\" 
 PHFLAGS = $(CFLAGS) -x c++-header
-LFLAGS = $(COMMONFLAGS) -rdynamic -L../../../bullet_svn/src/BulletSoftBody -L../../../bullet_svn/src/BulletDynamics -L../../../bullet_svn/src/BulletCollision -L../../../bullet_svn/src/LinearMath -Wl,-Bstatic -lBulletSoftBody -lBulletDynamics -lBulletCollision -lLinearMath -lGLEW -lSDL_image -lGLU -Wl,-Bdynamic -lSDL -lGL -ljpeg -lpng -ltiff
+LFLAGS = $(COMMONFLAGS) -rdynamic -L../../../SDL-hg/build/.libs -L../../../bullet_svn/src/BulletSoftBody -L../../../bullet_svn/src/BulletDynamics -L../../../bullet_svn/src/BulletCollision -L../../../bullet_svn/src/LinearMath -Wl,-Bstatic -lBulletSoftBody -lBulletDynamics -lBulletCollision -lLinearMath -lGLEW -lSDL_image -lGLU -lSDL -Wl,-Bdynamic -lGL -ljpeg -lpng -ltiff
 EXECUTABLE = AnKi.bin
-INCPATH = -I../../src/Math/ -I../../src/Util/Tokenizer/ -I../../src/Misc/ -I../../src/ -I../../src/Renderer/ -I../../src/Scene/ -I../../src/Ui/ -I../../src/Resources/ -I../../src/Util/ -I../../src/Scene/Controllers/ -I../../src/Physics/ -I../../src/Renderer/BufferObjects/ -I../../src/Renderer2/ -I../../../bullet_svn/src/ 
-SOURCES = ../../src/Util/Tokenizer//Scanner.cpp ../../src/Misc//skybox.cpp ../../src/Misc//particles.cpp ../../src/Misc//memory.cpp ../../src/Misc//collision.cpp ../../src/Misc//map.cpp ../../src//Main.cpp ../../src/Renderer//PpsHdr.cpp ../../src/Renderer//Pps.cpp ../../src/Renderer//Bs.cpp ../../src/Renderer//IsShadows.cpp ../../src/Renderer//MsEarlyz.cpp ../../src/Renderer//Renderer.cpp ../../src/Renderer//Is.cpp ../../src/Renderer//PpsLscatt.cpp ../../src/Renderer//Ms.cpp ../../src/Renderer//BulletDebuger.cpp ../../src/Renderer//Bs2.cpp ../../src/Renderer//PpsSsao.cpp ../../src/Renderer//Dbg.cpp ../../src/Scene//MeshNode.cpp ../../src/Scene//SkelNode.cpp ../../src/Scene//SkelModelNode.cpp ../../src/Scene//Light.cpp ../../src/Scene//Camera.cpp ../../src/Scene//Scene.cpp ../../src/Scene//ParticleEmitter.cpp ../../src/Scene//SceneNode.cpp ../../src/Ui//Ui.cpp ../../src/Resources//Material.cpp ../../src/Resources//ShaderProg.cpp ../../src/Resources//Texture.cpp ../../src/Resources//SkelAnim.cpp ../../src/Resources//Extension.cpp ../../src/Resources//Skeleton.cpp ../../src/Resources//ShaderPrePreprocessor.cpp ../../src/Resources//Resource.cpp ../../src/Resources//LightProps.cpp ../../src/Resources//Mesh.cpp ../../src/Util//Input.cpp ../../src/Util//App.cpp ../../src/Util//Common.cpp ../../src/Util//Util.cpp ../../src/Scene/Controllers//Controller.cpp ../../src/Scene/Controllers//SkelAnimCtrl.cpp ../../src/Physics//PhyWorld.cpp ../../src/Renderer2//Ms.cpp 
-OBJECTS = Scanner.o skybox.o particles.o memory.o collision.o map.o Main.o PpsHdr.o Pps.o Bs.o IsShadows.o MsEarlyz.o Renderer.o Is.o PpsLscatt.o Ms.o BulletDebuger.o Bs2.o PpsSsao.o Dbg.o MeshNode.o SkelNode.o SkelModelNode.o Light.o Camera.o Scene.o ParticleEmitter.o SceneNode.o Ui.o Material.o ShaderProg.o Texture.o SkelAnim.o Extension.o Skeleton.o ShaderPrePreprocessor.o Resource.o LightProps.o Mesh.o Input.o App.o Common.o Util.o Controller.o SkelAnimCtrl.o PhyWorld.o 25.Ms.o 
+INCPATH = -I../../src/Math/ -I../../src/Util/Tokenizer/ -I../../src/Misc/ -I../../src/ -I../../src/Renderer/ -I../../src/Scene/ -I../../src/Ui/ -I../../src/Resources/ -I../../src/Util/ -I../../src/Scene/Controllers/ -I../../src/Physics/ -I../../src/Renderer/BufferObjects/ -I../../src/Renderer2/ -I../../../bullet_svn/src/ -I../../../SDL-hg/include 
+SOURCES = ../../src/Util/Tokenizer//Scanner.cpp ../../src/Misc//skybox.cpp ../../src/Misc//particles.cpp ../../src/Misc//memory.cpp ../../src/Misc//collision.cpp ../../src/Misc//map.cpp ../../src//Main.cpp ../../src/Renderer//PpsHdr.cpp ../../src/Renderer//Pps.cpp ../../src/Renderer//Bs.cpp ../../src/Renderer//IsShadows.cpp ../../src/Renderer//MsEarlyz.cpp ../../src/Renderer//Renderer.cpp ../../src/Renderer//Is.cpp ../../src/Renderer//PpsLscatt.cpp ../../src/Renderer//Ms.cpp ../../src/Renderer//BulletDebuger.cpp ../../src/Renderer//Bs2.cpp ../../src/Renderer//PpsSsao.cpp ../../src/Renderer//Dbg.cpp ../../src/Scene//MeshNode.cpp ../../src/Scene//SkelNode.cpp ../../src/Scene//SkelModelNode.cpp ../../src/Scene//Light.cpp ../../src/Scene//Camera.cpp ../../src/Scene//Scene.cpp ../../src/Scene//ParticleEmitter.cpp ../../src/Scene//SceneNode.cpp ../../src/Ui//Ui.cpp ../../src/Resources//Material.cpp ../../src/Resources//ShaderProg.cpp ../../src/Resources//Texture.cpp ../../src/Resources//SkelAnim.cpp ../../src/Resources//Extension.cpp ../../src/Resources//Skeleton.cpp ../../src/Resources//ShaderPrePreprocessor.cpp ../../src/Resources//Resource.cpp ../../src/Resources//LightProps.cpp ../../src/Resources//Mesh.cpp ../../src/Util//Input.cpp ../../src/Util//App.cpp ../../src/Util//Common.cpp ../../src/Util//Util.cpp ../../src/Scene/Controllers//Controller.cpp ../../src/Scene/Controllers//SkelAnimCtrl.cpp ../../src/Physics//PhyWorld.cpp ../../src/Renderer2//Ms.cpp ../../src/Renderer2//Hdr.cpp 
+OBJECTS = Scanner.o skybox.o particles.o memory.o collision.o map.o Main.o PpsHdr.o Pps.o Bs.o IsShadows.o MsEarlyz.o Renderer.o Is.o PpsLscatt.o Ms.o BulletDebuger.o Bs2.o PpsSsao.o Dbg.o MeshNode.o SkelNode.o SkelModelNode.o Light.o Camera.o Scene.o ParticleEmitter.o SceneNode.o Ui.o Material.o ShaderProg.o Texture.o SkelAnim.o Extension.o Skeleton.o ShaderPrePreprocessor.o Resource.o LightProps.o Mesh.o Input.o App.o Common.o Util.o Controller.o SkelAnimCtrl.o PhyWorld.o 67.Ms.o Hdr.o 
 PRECOMPILED_HEADERS = 
 
 all: $(PRECOMPILED_HEADERS) $(SOURCES) $(EXECUTABLE)
@@ -3522,7 +3522,7 @@ PhyWorld.o: ../../src/Physics//PhyWorld.cpp ../../src/Physics//PhyWorld.h \
 	@echo Compiling ../../src/Physics//PhyWorld.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Physics//PhyWorld.cpp -o PhyWorld.o
 
-25.Ms.o: ../../src/Renderer2//Ms.cpp ../../src/Renderer2//Renderer.hpp \
+67.Ms.o: ../../src/Renderer2//Ms.cpp ../../src/Renderer2//Renderer.hpp \
  ../../src/Util/Common.h ../../src/Misc/memory.h ../../src/Math/Math.h \
  ../../src/Math/Vec2.h ../../src/Math/MathForwardDecls.h \
  ../../src/Math/Vec2.inl.h ../../src/Math/MathDfltHeader.h \
@@ -3675,9 +3675,14 @@ PhyWorld.o: ../../src/Physics//PhyWorld.cpp ../../src/Physics//PhyWorld.h \
  ../../src/Physics/PhyConversions.h ../../src/Physics/MotionState.h \
  ../../src/Scene/SceneNode.h ../../src/Physics/PhyWorld.h \
  ../../src/Scene/Camera.h ../../src/Misc/collision.h \
- ../../src/Scene/SceneNode.h
+ ../../src/Scene/SceneNode.h ../../src/Scene/MeshNode.h \
+ ../../src/Resources/Material.h ../../src/Resources/ShaderProg.h
 	@echo Compiling ../../src/Renderer2//Ms.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Renderer2//Ms.cpp -o 25.Ms.o
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Renderer2//Ms.cpp -o 67.Ms.o
+
+Hdr.o: ../../src/Renderer2//Hdr.cpp
+	@echo Compiling ../../src/Renderer2//Hdr.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Renderer2//Hdr.cpp -o Hdr.o
 
 clean:
 	rm -f *.o

+ 3 - 3
build/debug/gen.cfg.py

@@ -1,12 +1,12 @@
 sourcePaths = [ "../../src/Math/", "../../src/Util/Tokenizer/", "../../src/Misc/", "../../src/", "../../src/Renderer/", "../../src/Scene/", "../../src/Ui/", "../../src/Resources/", "../../src/Util/", "../../src/Scene/Controllers/", "../../src/Physics/", "../../src/Renderer/BufferObjects/", "../../src/Renderer2/" ]
 
 includePaths = list(sourcePaths)
-includePaths.extend( [ "../../../bullet_svn/src/" ] ) # the bullet svn path
+includePaths.extend( [ "../../../bullet_svn/src/", "../../../SDL-hg/include" ] ) # the extra libs paths
 
 precompiledHeaders = []
 executableName = "AnKi.bin"
 compiler = "g++"
 commonFlags = ""
-compilerFlags = "-c -pedantic-errors -pedantic -ansi -Wall -Wextra -W -pipe -O0 -g3 -pg `sdl-config --cflags` -fsingle-precision-constant -D_DEBUG_ -D_TERMINAL_COLORING__ -D_PLATFORM_LINUX_ -DREVISION=\\\"`svnversion -c ../..`\\\" "
+compilerFlags = "-c -pedantic-errors -pedantic -ansi -Wall -Wextra -W -pipe -O0 -g3 -pg -fsingle-precision-constant -D_DEBUG_ -D_TERMINAL_COLORING__ -D_PLATFORM_LINUX_ -DPLATFORM=LINUX -DREVISION=\\\"`svnversion -c ../..`\\\" "
 precompiledHeadersFlags = "-x c++-header"
-linkerFlags = "-rdynamic -L../../../bullet_svn/src/BulletSoftBody -L../../../bullet_svn/src/BulletDynamics -L../../../bullet_svn/src/BulletCollision -L../../../bullet_svn/src/LinearMath -Wl,-Bstatic -lBulletSoftBody -lBulletDynamics -lBulletCollision -lLinearMath -lGLEW -lSDL_image -lGLU -Wl,-Bdynamic -lSDL -lGL -ljpeg -lpng -ltiff" # a few libs are now static
+linkerFlags = "-rdynamic -L../../../SDL-hg/build/.libs -L../../../bullet_svn/src/BulletSoftBody -L../../../bullet_svn/src/BulletDynamics -L../../../bullet_svn/src/BulletCollision -L../../../bullet_svn/src/LinearMath -Wl,-Bstatic -lBulletSoftBody -lBulletDynamics -lBulletCollision -lLinearMath -lGLEW -lSDL_image -lGLU -lSDL -Wl,-Bdynamic -lGL -ljpeg -lpng -ltiff" # a few libs are now static