Skip to content

Commit

Permalink
Got Linux Makefiles working; updated build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Van Verth committed Aug 14, 2015
1 parent 1e9afe8 commit 900f9ac
Show file tree
Hide file tree
Showing 883 changed files with 52,928 additions and 34 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
*.sdf
*.suo
*.exe
*.elf
*.ilk
Debug.txt
Debug\ D3D11
Release\ D3D11
Debug\ OGL
Release\ OGL
LinuxRelease
LinuxDebug
*.vcxproj.user
Win32Debug
Win32Release
Expand Down
2 changes: 1 addition & 1 deletion src/Examples/Ch04-Xforms/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Chapter: FORCE
cd 'Transforms-02-Centered' && $(MAKE) $(BUILD)
cd 'Transforms-03-Separate' && $(MAKE) $(BUILD)
cd 'Transforms-04-Tank' && $(MAKE) $(BUILD)
cd 'Transforms-05-SceneGraph' && $(MAKE) $(BUILD)
cd 'Transforms-05-Hierarchy' && $(MAKE) $(BUILD)

FORCE:

Expand Down
3 changes: 2 additions & 1 deletion src/Examples/Ch13-Simulation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Chapter: FORCE
cd 'Simulation-03-Torque' && $(MAKE) $(BUILD)
cd 'Simulation-04-Tank' && $(MAKE) $(BUILD)
cd 'Simulation-05-LinCollision' && $(MAKE) $(BUILD)
cd 'Simulation-06-AngCollision' && $(MAKE) $(BUILD)
cd 'Simulation-06-RotCollision' && $(MAKE) $(BUILD)
cd 'Simulation-07-Friction' && $(MAKE) $(BUILD)

FORCE:

Expand Down
10 changes: 5 additions & 5 deletions src/Examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ Book: FORCE
cd 'Ch04-Xforms' && $(MAKE) $(BUILD)
cd 'Ch05-Orientation' && $(MAKE) $(BUILD)
cd 'Ch06-Viewing' && $(MAKE) $(BUILD)
cd 'Ch07-GeometryColoring' && $(MAKE) $(BUILD)
cd 'Ch08-Lighting' && $(MAKE) $(BUILD)
cd 'Ch09-Raster' && $(MAKE) $(BUILD)
cd 'Ch10-Interpolation' && $(MAKE) $(BUILD)
cd 'Ch12-Collision' && $(MAKE) $(BUILD)
cd 'Ch07-Interpolation' && $(MAKE) $(BUILD)
cd 'Ch08-GeometryColoring' && $(MAKE) $(BUILD)
cd 'Ch09-Lighting' && $(MAKE) $(BUILD)
cd 'Ch10-Raster' && $(MAKE) $(BUILD)
cd 'Ch11-RandomNumbers' && $(MAKE) $(BUILD)
cd 'Ch12-Collision' && $(MAKE) $(BUILD)
cd 'Ch13-Simulation' && $(MAKE) $(BUILD)

FORCE:
Expand Down
22 changes: 3 additions & 19 deletions src/Examples/MakefileExamples
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
PLATFORM = Linux

ifeq ($(PLATFORM),Linux)
CFLAGS_EXT = -ffriend-injection
CFLAGS_EXT = -ffriend-injection -std=c++11
TARGET_RELEASE = Example.elf
TARGET_DEBUG = ExampleD.elf
SYSLIBS = -lGLEW -lglut -lGLU -lGL
SYSLPATH = -L/usr/X11R6/lib
endif

ifeq ($(PLATFORM),OSX)
CFLAGS_EXT = -fvisibility-inlines-hidden
TARGET_RELEASE = Example
TARGET_DEBUG = ExampleD
SYSLIBS = -framework GLUT -framework OpenGL -framework Foundation -framework AppKit
SYSLPATH =
endif

ifeq ($(PLATFORM),MinGW)
CFLAGS_EXT =
TARGET_RELEASE = Example.exe
TARGET_DEBUG = ExampleD.exe
SYSLIBS = -lglew32s -lglut32 -lglu32 -lopengl32
SYSLPATH = -L../../../../glew/lib -L../../../../gl
SYSLIBS = -lGLEW -lglfw3 -lGLU -lGL -lX11 -lXxf86vm -lXrandr -lpthread -lXinerama -lXi -lXcursor
SYSLPATH = -L../../../../glfw-3.1.1/src
endif

LIBRARIES = $(SYSLIBS) $(EXTRAIVLIBS) -lIvEngineOGL -lIvEngine -lIvGraphicsOGL -lIvGraphics -lIvMath -lIvUtility $(SYSLIBS)
Expand Down
26 changes: 18 additions & 8 deletions src/README_LINUX.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ If you have not already done so, please read the all-platform introductory file,
***********************************************************************
*** System Requirements / Installation ***

* This code distribution supports Linux. This CDROM was built and tested using Ubuntu Linux 7.04 (Feisty Fawn).
* This code distribution supports Linux. It was built and tested using Ubuntu Linux 15.04 (Vivid Vervet).

* The contents of the book's CDROM must be copied (keeping the hierarchy) to the local machine, as described in README_FIRST.TXT
* The contents of the distribution must be copied (keeping the hierarchy) to the local machine, as described in README_FIRST.TXT

* Packages for OpenGL, GLU, GLUT, and GLEW must be installed - see the section "OpenGL Specifics" below for details
* Packages for OpenGL and GLEW must be installed, and the GLFW library must be built - see the section "OpenGL Specifics" below for details

* Before building examples you will need to create the necessary libraries.
See "Building Libraries and Demo Applications", for more details.
Expand All @@ -20,17 +20,27 @@ See "Building Libraries and Demo Applications", for more details.
***********************************************************************
*** OpenGL Specifics ***

The system must have development packages for OpenGL, GLU, and GLUT installed. These should be part of a standard Linux distribution, although they may not be installed by default. For example, under Ubuntu, you may need to use the package manager to install them.
The system must have development packages for OpenGL and GLEW installed. These should be part of a standard Linux distribution, although they may not be installed by default. For example, under Ubuntu, you may need to use the package manager to install them:

The path to OpenGL, GLU, GLUT, and GLEW include and library files may be different on your system. If so, you will need to change the SYSIPATH variable in /common/MakefileCommon, and the SYSLPATH variable in /Examples/MakefileExamples.
sudo apt-get install mesa-common-dev libglew-dev

You should be sure that you are using the correct drivers for your video card. With some cards the Ubuntu default drivers, for one, do not support the necessary OpenGL features.
The path to OpenGL and GLEW include and library files may be different on your system. If so, you will need to change the SYSIPATH variable in /common/MakefileCommon, and the SYSLPATH variable in /Examples/MakefileExamples. If GLEW is not available on your system, the necessary build files can be found in src/glew-1.12.0/.

In addition, you will need to build the GLFW library. Again, the necessary dependencies may not be installed, namely Cmake and the xorg libraries. The following will build GLFW under Ubuntu:

sudo apt-get install cmake xorg-dev
cd src/glfw-3.1.1
cmake .
make

However it is built, the Makefiles are expecting to find libglfw3.a in src/glfw-3.1.1/src/.

Finally, you should be sure that you are using the correct drivers for your video card.

***********************************************************************
*** Building Libraries and Demo Applications ***

The libraries and applications use the OpenGL GLUT and GLEW systems. As mentioned, for best results you will need to make sure these are installed on your system.
The libraries and applications use the OpenGL GLFW and GLEW systems. As mentioned, for best results you will need to make sure these are installed on your system.

The Linux platform uses "make" from a command prompt to build any or all of the libraries and demo applications. A hierarchical build system allows the user to rebuild at any desired level in the code hierarchy.

Expand All @@ -48,7 +58,7 @@ To build, open a command prompt and change directory to the desired directory:

* To rebuild a specific demo application, change directories to that demo's subdirectory under /Examples/Ch* and build as described below.

* To build, note that Linux is the default platform. To build any part of the code for Linux, use the following commands in the desired build directory:
* To build any part of the code for Linux, use the following commands in the desired build directory:

* For release builds:

Expand Down
1 change: 1 addition & 0 deletions src/common/IvEngine/IvEventHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
//-------------------------------------------------------------------------------
//-- Dependencies ---------------------------------------------------------------
//-------------------------------------------------------------------------------
#include <string.h>
#include "IvWriter.h"

//-------------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 900f9ac

Please sign in to comment.