]> git.jsancho.org Git - lugaru.git/commitdiff
Resolved merges of FindOggVorbis.cmake and CMakeLists.txt
authorNeal Gompa <ngompa13@gmail.com>
Wed, 12 May 2010 03:09:34 +0000 (22:09 -0500)
committerNeal Gompa <ngompa13@gmail.com>
Wed, 12 May 2010 03:09:34 +0000 (22:09 -0500)
CMakeLists.txt
Lugaru.sln [deleted file]
Lugaru.vcproj [deleted file]
cmake/FindVorbis.cmake [deleted file]
cmake/Modules/FindOggVorbis.cmake [new file with mode: 0644]
makefile.old [new file with mode: 0644]
makefile.orig [deleted file]
makemac.sh

index 910e1275df12c2d5845c4b0b8643f0a9a82b93da..0ea8c4708004ab9c050bf1bcd89c98d638b8905c 100644 (file)
@@ -2,8 +2,30 @@ project(lugaru)
 
 cmake_minimum_required(VERSION 2.6)
 
-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+if(NOT CMAKE_BUILD_TYPE)\r
+  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING\r
+      "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel"\r
+      FORCE)\r
+endif(NOT CMAKE_BUILD_TYPE)
 
+if(NOT LUGARU_INSTALL_PREFIX)
+  if(WIN32)
+     set(LUGARU_INSTALL_PREFIX C:\Lugaru CACHE PATH
+     "LUGARU_INSTALL_PREFIX: Install path prefix, prepended onto install directories."
+      FORCE)
+  else(WIN32)
+     set(LUGARU_INSTALL_PREFIX /usr/local/lugaru CACHE PATH
+     "CMAKE_INSTALL_PREFIX: Install path prefix, prepended onto install directories."
+      FORCE)
+  endif(WIN32)
+endif(NOT LUGARU_INSTALL_PREFIX)
+
+set(CMAKE_INSTALL_PREFIX "${LUGARU_INSTALL_PREFIX}" CACHE INTERNAL "Prefix
+prepended to install directories" FORCE)
+
+
+
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
 find_package(OpenAL REQUIRED)
 find_package(BZip2 REQUIRED)
 find_package(PNG REQUIRED)
@@ -12,7 +34,7 @@ find_package(ZLIB REQUIRED)
 find_package(OpenGL REQUIRED)
 find_package(GLU REQUIRED)
 find_package(SDL REQUIRED)
-find_package(Vorbis REQUIRED)
+find_package(OggVorbis REQUIRED)
 
 include_directories(
        ${OPENAL_INCLUDES}
@@ -23,10 +45,20 @@ include_directories(
        ${OPENGL_INCLUDE_DIR}
        ${GLU_INCLUDE_DIR}
        ${SDL_INCLUDE_DIR}
-       ${VORBIS_INCLUDE_DIR}
+       ${VORBISFILE_INCLUDE_DIR}
        ${OGG_INCLUDE_DIR}
        ${CMAKE_SOURCE_DIR}/Source)
 
-set(LUGARU_LIBS ${OPENAL_LIBRARY} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} ${SDL_LIBRARY} ${GLU_LIBRARY} ${OPENGL_LIBRARY} ${VORBISFILE_LIBRARY} ${OGG_LIBRARY})
+set(LUGARU_LIBS ${OPENAL_LIBRARY} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} ${SDL_LIBRARY} ${GLU_LIBRARY} ${OPENGL_LIBRARY} ${VORBISFILE_LIBS} ${OGG_LIBS})
 
 add_subdirectory(Source)
+
+# Install target
+if(WIN32)
+       install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/Source/lugaru.exe DESTINATION ${CMAKE_INSTALL_PREFIX})
+else(WIN32)
+       install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/Source/lugaru DESTINATION ${CMAKE_INSTALL_PREFIX})
+endif(WIN32)
+
+install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data DESTINATION ${CMAKE_INSTALL_PREFIX})
+
diff --git a/Lugaru.sln b/Lugaru.sln
deleted file mode 100644 (file)
index cd2144e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 8.00\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lugaru", "Lugaru.vcproj", "{71D87E45-76A7-497F-9176-DA2600007A65}"\r
-       ProjectSection(ProjectDependencies) = postProject\r
-       EndProjectSection\r
-EndProject\r
-Global\r
-       GlobalSection(SolutionConfiguration) = preSolution\r
-               Debug = Debug\r
-               Release = Release\r
-       EndGlobalSection\r
-       GlobalSection(ProjectConfiguration) = postSolution\r
-               {71D87E45-76A7-497F-9176-DA2600007A65}.Debug.ActiveCfg = Debug|Win32\r
-               {71D87E45-76A7-497F-9176-DA2600007A65}.Debug.Build.0 = Debug|Win32\r
-               {71D87E45-76A7-497F-9176-DA2600007A65}.Release.ActiveCfg = Release|Win32\r
-               {71D87E45-76A7-497F-9176-DA2600007A65}.Release.Build.0 = Release|Win32\r
-       EndGlobalSection\r
-       GlobalSection(ExtensibilityGlobals) = postSolution\r
-       EndGlobalSection\r
-       GlobalSection(ExtensibilityAddIns) = postSolution\r
-       EndGlobalSection\r
-EndGlobal\r
diff --git a/Lugaru.vcproj b/Lugaru.vcproj
deleted file mode 100644 (file)
index 7661834..0000000
+++ /dev/null
@@ -1,360 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>\r
-<VisualStudioProject\r
-       ProjectType="Visual C++"\r
-       Version="7.10"\r
-       Name="Lugaru"\r
-       ProjectGUID="{71D87E45-76A7-497F-9176-DA2600007A65}"\r
-       RootNamespace="Lugaru"\r
-       Keyword="Win32Proj">\r
-       <Platforms>\r
-               <Platform\r
-                       Name="Win32"/>\r
-       </Platforms>\r
-       <Configurations>\r
-               <Configuration\r
-                       Name="Debug|Win32"\r
-                       OutputDirectory="Debug"\r
-                       IntermediateDirectory="Debug"\r
-                       ConfigurationType="1"\r
-                       CharacterSet="2">\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               Optimization="0"\r
-                               AdditionalIncludeDirectories="./Source;./Source/devil/include"\r
-                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"\r
-                               MinimalRebuild="TRUE"\r
-                               BasicRuntimeChecks="3"\r
-                               RuntimeLibrary="5"\r
-                               BufferSecurityCheck="TRUE"\r
-                               UsePrecompiledHeader="0"\r
-                               WarningLevel="3"\r
-                               Detect64BitPortabilityProblems="FALSE"\r
-                               DebugInformationFormat="4"/>\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"/>\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               OutputFile="$(OutDir)/Lugaru.exe"\r
-                               LinkIncremental="2"\r
-                               GenerateDebugInformation="TRUE"\r
-                               ProgramDatabaseFile="$(OutDir)/Lugaru.pdb"\r
-                               SubSystem="2"\r
-                               TargetMachine="1"/>\r
-                       <Tool\r
-                               Name="VCMIDLTool"/>\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"/>\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"/>\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"/>\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"/>\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"/>\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"/>\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"/>\r
-                       <Tool\r
-                               Name="VCManagedWrapperGeneratorTool"/>\r
-                       <Tool\r
-                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|Win32"\r
-                       OutputDirectory="Release"\r
-                       IntermediateDirectory="Release"\r
-                       ConfigurationType="1"\r
-                       CharacterSet="2">\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               AdditionalIncludeDirectories="./Source;./Source/devil/include"\r
-                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"\r
-                               BasicRuntimeChecks="0"\r
-                               RuntimeLibrary="4"\r
-                               UsePrecompiledHeader="0"\r
-                               WarningLevel="3"\r
-                               Detect64BitPortabilityProblems="FALSE"\r
-                               DebugInformationFormat="3"/>\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"/>\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               OutputFile="$(OutDir)/Lugaru.exe"\r
-                               LinkIncremental="1"\r
-                               GenerateDebugInformation="TRUE"\r
-                               SubSystem="2"\r
-                               OptimizeReferences="2"\r
-                               EnableCOMDATFolding="2"\r
-                               TargetMachine="1"/>\r
-                       <Tool\r
-                               Name="VCMIDLTool"/>\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"/>\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"/>\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"/>\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"/>\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"/>\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"/>\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"/>\r
-                       <Tool\r
-                               Name="VCManagedWrapperGeneratorTool"/>\r
-                       <Tool\r
-                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
-               </Configuration>\r
-       </Configurations>\r
-       <References>\r
-       </References>\r
-       <Files>\r
-               <Filter\r
-                       Name="Source Files"\r
-                       Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">\r
-                       <File\r
-                               RelativePath=".\Source\Frustum.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\GameDraw.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\GameInitDispose.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\GameTick.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Globals.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Lights.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Models.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Objects.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\OpenGL_Windows.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\pack.c">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\pack_private.c">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Person.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\private.c">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Quaternions.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Random.c">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Skeleton.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Skybox.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Sprites.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Terrain.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Text.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\TGALoader.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\unpack.c">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\unpack_private.c">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Weapons.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\WinDefs.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\WinInput.cpp">\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Header Files"\r
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">\r
-                       <File\r
-                               RelativePath=".\Source\binio.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Constants.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Frustum.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Game.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\gl.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Lights.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\LinkedList.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\md5.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Models.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Objects.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\pack_private.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Person.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\PhysicsMath.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Pointer.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\private.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Quaternions.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Random.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Skeleton.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Skybox.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Sprites.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Terrain.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Text.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\TGALoader.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\unpack_private.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\Weapons.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\wincompat.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\WinDefs.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\WinInput.h">\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Resource Files"\r
-                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"\r
-                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">\r
-                       <File\r
-                               RelativePath=".\Source\res\lugaru.ico">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\res\Lugaru.rc">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\res\resource.h">\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="fmod"\r
-                       Filter="">\r
-                       <File\r
-                               RelativePath=".\Source\fmod.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\fmod_errors.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\fmod_header.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\fmoddyn.h">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\fmodvc.lib">\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="devil"\r
-                       Filter="">\r
-                       <Filter\r
-                               Name="lib"\r
-                               Filter="">\r
-                               <File\r
-                                       RelativePath=".\Source\devil\lib\DevIL.lib">\r
-                               </File>\r
-                               <File\r
-                                       RelativePath=".\Source\devil\lib\ILU.lib">\r
-                               </File>\r
-                               <File\r
-                                       RelativePath=".\Source\devil\lib\ILUT.lib">\r
-                               </File>\r
-                       </Filter>\r
-               </Filter>\r
-               <Filter\r
-                       Name="logger"\r
-                       Filter="">\r
-                       <File\r
-                               RelativePath=".\Source\logger\logger.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Source\logger\logger.h">\r
-                       </File>\r
-               </Filter>\r
-               <File\r
-                       RelativePath=".\Data\config.txt">\r
-               </File>\r
-               <File\r
-                       RelativePath=".\Source\Driver.cc">\r
-               </File>\r
-               <File\r
-                       RelativePath=".\Source\Md5.cc">\r
-               </File>\r
-       </Files>\r
-       <Globals>\r
-       </Globals>\r
-</VisualStudioProject>\r
diff --git a/cmake/FindVorbis.cmake b/cmake/FindVorbis.cmake
deleted file mode 100644 (file)
index e0cb2c1..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-# - Find vorbis
-# Find the native vorbis includes and libraries
-#
-#  VORBIS_INCLUDE_DIR - where to find vorbis.h, etc.
-#  VORBIS_LIBRARIES   - List of libraries when using vorbis(file).
-#  VORBIS_FOUND       - True if vorbis found.
-
-if(NOT GP2XWIZ)
-    if(VORBIS_INCLUDE_DIR)
-        # Already in cache, be silent
-        set(VORBIS_FIND_QUIETLY TRUE)
-    endif(VORBIS_INCLUDE_DIR)
-    find_path(OGG_INCLUDE_DIR ogg/ogg.h)
-    find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
-    # MSVC built ogg/vorbis may be named ogg_static and vorbis_static
-    find_library(OGG_LIBRARY NAMES ogg ogg_static)
-    find_library(VORBIS_LIBRARY NAMES vorbis vorbis_static)
-    find_library(VORBISFILE_LIBRARY NAMES vorbisfile vorbisfile_static)
-    # Handle the QUIETLY and REQUIRED arguments and set VORBIS_FOUND
-    # to TRUE if all listed variables are TRUE.
-    include(FindPackageHandleStandardArgs)
-    find_package_handle_standard_args(VORBIS DEFAULT_MSG
-        OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR
-        OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)
-else(NOT GP2XWIZ)
-    find_path(VORBIS_INCLUDE_DIR tremor/ivorbisfile.h)
-    find_library(VORBIS_LIBRARY NAMES vorbis_dec)
-    find_package_handle_standard_args(VORBIS DEFAULT_MSG
-        VORBIS_INCLUDE_DIR VORBIS_LIBRARY)
-endif(NOT GP2XWIZ)
-    
-if(VORBIS_FOUND)
-  if(NOT GP2XWIZ)
-     set(VORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY}
-           ${OGG_LIBRARY})
-  else(NOT GP2XWIZ)
-     set(VORBIS_LIBRARIES ${VORBIS_LIBRARY})
-  endif(NOT GP2XWIZ)
-else(VORBIS_FOUND)
-  set(VORBIS_LIBRARIES)
-endif(VORBIS_FOUND)
-
-mark_as_advanced(OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR)
-mark_as_advanced(OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)
-
diff --git a/cmake/Modules/FindOggVorbis.cmake b/cmake/Modules/FindOggVorbis.cmake
new file mode 100644 (file)
index 0000000..46ec694
--- /dev/null
@@ -0,0 +1,91 @@
+# - Try to find the OggVorbis libraries
+# Once done this will define
+#
+#  OGGVORBIS_FOUND - system has OggVorbis
+#  OGGVORBIS_VERSION - set either to 1 or 2
+#  OGGVORBIS_INCLUDE_DIR - the OggVorbis include directory
+#  OGGVORBIS_LIBRARIES - The libraries needed to use OggVorbis
+#  OGG_LIBRARY         - The Ogg library
+#  VORBIS_LIBRARY      - The Vorbis library
+#  VORBISFILE_LIBRARY  - The VorbisFile library
+#  VORBISENC_LIBRARY   - The VorbisEnc library
+
+# Copyright (c) 2006, Richard Laerkaeng, <richard@goteborg.utfors.se>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+include (CheckLibraryExists)
+
+find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
+find_path(OGG_INCLUDE_DIR ogg/ogg.h)
+
+find_library(OGG_LIBRARY NAMES ogg)
+find_library(VORBIS_LIBRARY NAMES vorbis)
+find_library(VORBISFILE_LIBRARY NAMES vorbisfile)
+find_library(VORBISENC_LIBRARY NAMES vorbisenc)
+
+mark_as_advanced(VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR
+                 OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY)
+
+
+if (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
+   set(OGGVORBIS_FOUND TRUE)
+
+   set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBISENC_LIBRARY})
+
+   set(_CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES})
+   set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${OGGVORBIS_LIBRARIES})
+   check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2)
+   set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_TMP})
+
+   if (HAVE_LIBVORBISENC2)
+      set (OGGVORBIS_VERSION 2)
+   else (HAVE_LIBVORBISENC2)
+      set (OGGVORBIS_VERSION 1)
+   endif (HAVE_LIBVORBISENC2)
+
+else (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
+   set (OGGVORBIS_VERSION)
+   set(OGGVORBIS_FOUND FALSE)
+endif (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
+
+
+if (OGGVORBIS_FOUND)
+   if (NOT OggVorbis_FIND_QUIETLY)
+      message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}")
+   endif (NOT OggVorbis_FIND_QUIETLY)
+else (OGGVORBIS_FOUND)
+   if (OggVorbis_FIND_REQUIRED)
+      message(FATAL_ERROR "Could NOT find OggVorbis libraries")
+   endif (OggVorbis_FIND_REQUIRED)
+   if (NOT OggVorbis_FIND_QUITELY)
+      message(STATUS "Could NOT find OggVorbis libraries")
+   endif (NOT OggVorbis_FIND_QUITELY)
+endif (OGGVORBIS_FOUND)
+
+check_include_files(vorbis/vorbisfile.h HAVE_VORBISFILE_H)
+check_library_exists(ogg ogg_page_version "" HAVE_LIBOGG)
+check_library_exists(vorbis vorbis_info_init "" HAVE_LIBVORBIS)
+check_library_exists(vorbisfile ov_open "" HAVE_LIBVORBISFILE)
+check_library_exists(vorbisenc vorbis_info_clear "" HAVE_LIBVORBISENC)
+check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2)
+
+if (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
+    message(STATUS "Ogg/Vorbis found")
+    set (VORBIS_LIBS "-lvorbis")
+    set (OGG_LIBS "-logg")
+    set (VORBISFILE_LIBS "-lvorbisfile")
+    set (VORBISENC_LIBS "-lvorbisenc")
+    set (OGGVORBIS_FOUND TRUE)
+    if (HAVE_LIBVORBISENC2)
+        set (HAVE_VORBIS 2)
+    else (HAVE_LIBVORBISENC2)
+        set (HAVE_VORBIS 1)
+    endif (HAVE_LIBVORBISENC2)
+else (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
+    message(STATUS "Ogg/Vorbis not found")
+endif (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
+
+
diff --git a/makefile.old b/makefile.old
new file mode 100644 (file)
index 0000000..223e3b8
--- /dev/null
@@ -0,0 +1,393 @@
+
+macosx := false
+use_devil := false
+use_fmod := false
+
+ifeq ($(strip $(shell uname -s)),Darwin)
+       macosx := true
+endif
+
+#OPT += -O0
+OPT += -O3 -fno-strict-aliasing -falign-loops=16 -fno-math-errno
+#OPT += -Os -fno-strict-aliasing
+
+BINDIR := bin
+RUNDIR := Data
+SRCDIR := Source
+SDLDIR := SDL12
+LIBPNGDIR := libpng-1.2.8
+JPEGLIBDIR := jpeg-6b
+ZLIBDIR := zlib-1.2.3
+OPENALDIR := OpenAL
+GLUDIR := GLU
+LIBOGGDIR := libogg-1.0
+LIBVORBISDIR := libvorbis-1.0.1
+
+ifeq ($(strip $(macosx)),true)
+       CXX := g++-4.0
+       CC := gcc-4.0
+       LD := g++-4.0
+
+       ifeq ($(strip $(use_devil)),true)
+        $(error DEVIL isn't supported in the Mac OS X builds right now.)
+    endif
+
+       ifeq ($(strip $(use_fmod)),true)
+        $(error FMOD isn't supported in the Mac OS X builds right now.)
+    endif
+
+       ifeq ($(strip $(XCODE_DIR)),)
+        XCODE_DIR := /Developer
+    endif
+
+       ifeq ($(strip $(macosx_arch)),)
+               macosx_arch := $(shell uname -m)
+       endif
+
+       ifeq ($(strip $(macosx_arch)),ppc)
+        macosx_arch_okay := true
+        macosx_version_min := 10.4
+        macosx_version_min_required := 1040
+               macosx_sdk_dir := MacOSX10.4u.sdk
+               macosx_gcc_dir := powerpc-apple-darwin10/4.0.1
+               macosx_gcc_libdir := $(macosx_gcc_dir)
+               macosx_cxx_dir := powerpc-apple-darwin8
+    endif
+
+       ifeq ($(strip $(macosx_arch)),i386)
+        macosx_arch_okay := true
+        macosx_version_min := 10.4
+        macosx_version_min_required := 1040
+               macosx_sdk_dir := MacOSX10.4u.sdk
+               macosx_gcc_dir := i686-apple-darwin10/4.0.1
+               macosx_gcc_libdir := $(macosx_gcc_dir)
+               macosx_cxx_dir := i686-apple-darwin8
+    endif
+
+       ifeq ($(strip $(macosx_arch)),x86_64)
+        macosx_arch_okay := true
+        macosx_version_min := 10.6
+        macosx_version_min_required := 1060
+               macosx_sdk_dir := MacOSX10.6.sdk
+               macosx_gcc_dir := i686-apple-darwin10/4.0.1
+               macosx_gcc_libdir := $(macosx_gcc_dir)/x86_64
+               macosx_cxx_dir := x86_64-apple-darwin8
+    endif
+
+       ifneq ($(strip $(macosx_arch_okay)),true)
+        $(error Unknown Mac OS X architecture. Please update the makefile.)
+    endif
+
+       EXEEXT := $(macosx_arch)
+
+    CFLAGS += -arch $(macosx_arch)
+    CFLAGS += -mmacosx-version-min=$(macosx_version_min)
+    CFLAGS += -DMAC_OS_X_VERSION_MIN_REQUIRED=$(macosx_version_min_required)
+    CFLAGS += -nostdinc
+    CFLAGS += -F$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/System/Library/Frameworks
+    CFLAGS += -I$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/lib/gcc/$(macosx_gcc_dir)/include
+    CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include
+    CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0
+    CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0/$(macosx_cxx_dir)
+    CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0/$(macosx_cxx_dir)/bits
+    CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0/backward
+       CFLAGS += -mdynamic-no-pic
+
+    LDFLAGS += -arch $(macosx_arch)
+    LDFLAGS += -mmacosx-version-min=$(macosx_version_min)
+    LDFLAGS += -F$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/System/Library/Frameworks
+    LDFLAGS += -L$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/lib/gcc/$(macosx_gcc_libdir)
+    LDFLAGS += -Wl,-syslibroot,$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)
+       LDFLAGS += -framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation -framework Carbon -framework OpenAL
+       LDFLAGS += ./libSDL-1.2.0.dylib ./libSDLmain-osx.a
+else
+       CXX := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/g++
+       CC := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/gcc
+       LD := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/g++
+
+       CFLAGS += -DPLATFORM_LINUX=1
+       LDFLAGS += ./libSDL-1.2.so.0 -Wl,-rpath,\$$ORIGIN
+
+       ifeq ($(strip $(use_devil)),true)
+       LDFLAGS += ./libIL.so.1 ./libILU.so.1 ./libILUT.so.1
+       endif
+
+       ifeq ($(strip $(use_fmod)),true)
+       POSTLDFLAGS += -lpthread ./libfmod-linux-x86.a
+       else
+       LDFLAGS += ./libopenal.so.1
+       endif
+endif
+
+DEFINES += \
+       -DPLATFORM_UNIX=1 \
+       -DUSE_SDL=1 \
+       -DTRUE=1 \
+       -DFALSE=0 \
+       -Dstricmp=strcasecmp \
+       -DBinIO_STDINT_HEADER="<stdint.h>" \
+
+INCLUDES += \
+                       -I$(SRCDIR) \
+                       -I$(SDLDIR)/include \
+                       -I./OpenGL/ \
+                       -I./OpenGL/GL \
+
+ifeq ($(strip $(use_devil)),true)
+    DEFINES += -DUSE_DEVIL=1
+    INCLUDES += -I$(SRCDIR)/devil/include
+else
+    DEFINES += -DZ_PREFIX=1
+    INCLUDES += -I$(ZLIBDIR) -I$(LIBPNGDIR) -I$(JPEGLIBDIR)
+endif
+
+ifeq ($(strip $(use_fmod)),false)
+    DEFINES += -DUSE_OPENAL=1
+    INCLUDES += -I$(OPENALDIR)/include -I$(LIBOGGDIR)/include -I$(LIBVORBISDIR)/include
+endif
+
+CFLAGS += -g -c $(OPT) $(INCLUDES) $(DEFINES) -fsigned-char -pipe -w
+
+
+ifeq ($(strip $(EXEEXT)),)
+       EXEEXT := bin
+endif
+EXE := $(RUNDIR)/lugaru-$(EXEEXT)
+
+CXXFLAGS := $(CFLAGS)
+
+SRCS := \
+       Frustum.cpp \
+       GameDraw.cpp \
+       GameInitDispose.cpp \
+       GameTick.cpp \
+       Globals.cpp \
+       Lights.cpp \
+       Models.cpp \
+       Objects.cpp \
+       pack.c \
+       pack_private.c \
+       Person.cpp \
+       private.c \
+       Quaternions.cpp \
+       Random.c \
+       Skeleton.cpp \
+       Skybox.cpp \
+       Sprites.cpp \
+       Terrain.cpp \
+       Text.cpp \
+       TGALoader.cpp \
+       unpack.c \
+       unpack_private.c \
+       Weapons.cpp \
+       MacCompatibility.cpp \
+       logger/logger.cpp \
+       WinInput.cpp \
+       OpenGL_Windows.cpp \
+       openal_wrapper.cpp \
+
+SRCS := $(foreach f,$(SRCS),$(SRCDIR)/$(f))
+
+
+UNUSED_SRCS := \
+       DRIVER.CC \
+       MD5.CC \
+
+
+PNGSRCS := \
+    png.c \
+    pngerror.c \
+    pnggccrd.c \
+    pngget.c \
+    pngmem.c \
+    pngpread.c \
+    pngread.c \
+    pngrio.c \
+    pngrtran.c \
+    pngrutil.c \
+    pngset.c \
+    pngtrans.c \
+    pngvcrd.c \
+    pngwio.c \
+    pngwrite.c \
+    pngwtran.c \
+    pngwutil.c \
+
+PNGSRCS := $(foreach f,$(PNGSRCS),$(LIBPNGDIR)/$(f))
+
+JPEGSRCS := \
+       jdapistd.c \
+    jdmaster.c \
+    jdapimin.c \
+    jcapimin.c \
+    jdmerge.c \
+    jdatasrc.c \
+    jdatadst.c \
+    jdcoefct.c \
+    jdcolor.c \
+    jddctmgr.c \
+    jdhuff.c \
+    jdinput.c \
+    jdmainct.c \
+    jdmarker.c \
+    jdphuff.c \
+    jdpostct.c \
+    jdsample.c \
+    jdtrans.c \
+    jerror.c \
+    jidctflt.c \
+    jidctfst.c \
+    jidctint.c \
+    jidctred.c \
+    jmemmgr.c \
+    jutils.c \
+    jmemnobs.c \
+    jquant1.c \
+    jquant2.c \
+    jcomapi.c \
+    jcmarker.c \
+    jcapistd.c \
+    jcparam.c \
+    jcinit.c \
+    jcdctmgr.c \
+    jccoefct.c \
+    jcmainct.c \
+    jfdctflt.c \
+    jfdctint.c \
+    jfdctfst.c \
+    jchuff.c \
+    jcphuff.c \
+    jcsample.c \
+    jcmaster.c \
+    jccolor.c \
+    jcprepct.c \
+
+JPEGSRCS := $(foreach f,$(JPEGSRCS),$(JPEGLIBDIR)/$(f))
+
+
+ZLIBSRCS = \
+       adler32.c \
+       compress.c \
+       crc32.c \
+       deflate.c \
+       gzio.c \
+       infback.c \
+       inffast.c \
+       inflate.c \
+       inftrees.c \
+       trees.c \
+       uncompr.c \
+       zutil.c \
+
+ZLIBSRCS := $(foreach f,$(ZLIBSRCS),$(ZLIBDIR)/$(f))
+
+
+GLUSRCS := \
+       dict.c \
+       geom.c \
+       memalloc.c \
+       mesh.c \
+       mipmap.c \
+       normal.c \
+       priorityq.c \
+       render.c \
+       sweep.c \
+       tess.c \
+       tessmono.c \
+       util.c \
+
+GLUSRCS := $(foreach f,$(GLUSRCS),$(GLUDIR)/$(f))
+
+
+OGGSRCS := \
+       bitwise.o \
+       framing.o
+
+OGGSRCS := $(foreach f,$(OGGSRCS),$(LIBOGGDIR)/src/$(f))
+
+VORBISSRCS := \
+       analysis.o \
+    bitrate.o \
+    block.o \
+    codebook.o \
+    envelope.o \
+    floor0.o \
+    floor1.o \
+    info.o \
+    lpc.o \
+    lsp.o \
+    mapping0.o \
+    mdct.o \
+    psy.o \
+    registry.o \
+    res0.o \
+    sharedbook.o \
+    smallft.o \
+    synthesis.o \
+    vorbisfile.o \
+    window.o
+
+VORBISSRCS := $(foreach f,$(VORBISSRCS),$(LIBVORBISDIR)/lib/$(f))
+
+ifeq ($(strip $(macosx)),false)
+       SRCS += $(GLUSRCS)
+endif
+
+ifeq ($(strip $(use_devil)),false)
+    SRCS += $(PNGSRCS) $(JPEGSRCS) $(ZLIBSRCS)
+endif
+
+ifeq ($(strip $(use_fmod)),false)
+    SRCS += $(OGGSRCS) $(VORBISSRCS)
+endif
+
+OBJS := $(SRCS:.CC=.o)
+OBJS := $(OBJS:.cc=.o)
+OBJS := $(OBJS:.cpp=.o)
+OBJS := $(OBJS:.c=.o)
+OBJS := $(OBJS:.m=.o)
+OBJS := $(foreach f,$(OBJS),$(BINDIR)/$(f))
+
+
+.PHONY: clean all
+
+all : $(EXE)
+
+$(BINDIR)/%.o : %.cpp
+       @mkdir -p $(dir $@)
+       $(CXX) -o $@ $(CXXFLAGS) $<
+
+$(BINDIR)/%.o : %.CC
+       @mkdir -p $(dir $@)
+       $(CXX) -x c++ -o $@ $(CXXFLAGS) $<
+
+$(BINDIR)/%.o : %.cc
+       @mkdir -p $(dir $@)
+       $(CXX) -o $@ $(CXXFLAGS) $<
+
+$(BINDIR)/%.o : %.m
+       @mkdir -p $(dir $@)
+       $(CC) -o $@ $(CFLAGS) $<
+
+$(BINDIR)/%.o : %.c
+       @mkdir -p $(dir $@)
+       $(CC) -o $@ $(CFLAGS) $<
+
+$(EXE) : $(OBJS) $(APPOBJS)
+       @mkdir -p $(dir $@)
+       $(LD) -o $@ $(LDFLAGS) $(OBJS) $(APPOBJS) $(POSTLDFLAGS)
+
+clean:
+       rm -f $(BINDIR)/*.o
+       rm -f $(BINDIR)/$(SRCDIR)/*.o
+       rm -f $(BINDIR)/$(SRCDIR)/logger/*.o
+       rm -f $(BINDIR)/$(GLUDIR)/*.o
+       rm -f $(BINDIR)/$(LIBPNGDIR)/*.o
+       rm -f $(BINDIR)/$(JPEGLIBDIR)/*.o
+       rm -f $(BINDIR)/$(ZLIBDIR)/*.o
+       rm -f $(BINDIR)/$(LIBOGGDIR)/src/*.o
+       rm -f $(BINDIR)/$(LIBVORBISDIR)/lib/*.o
+       rm -f $(EXE)
+
+# end of makefile ...
+
diff --git a/makefile.orig b/makefile.orig
deleted file mode 100644 (file)
index 223e3b8..0000000
+++ /dev/null
@@ -1,393 +0,0 @@
-
-macosx := false
-use_devil := false
-use_fmod := false
-
-ifeq ($(strip $(shell uname -s)),Darwin)
-       macosx := true
-endif
-
-#OPT += -O0
-OPT += -O3 -fno-strict-aliasing -falign-loops=16 -fno-math-errno
-#OPT += -Os -fno-strict-aliasing
-
-BINDIR := bin
-RUNDIR := Data
-SRCDIR := Source
-SDLDIR := SDL12
-LIBPNGDIR := libpng-1.2.8
-JPEGLIBDIR := jpeg-6b
-ZLIBDIR := zlib-1.2.3
-OPENALDIR := OpenAL
-GLUDIR := GLU
-LIBOGGDIR := libogg-1.0
-LIBVORBISDIR := libvorbis-1.0.1
-
-ifeq ($(strip $(macosx)),true)
-       CXX := g++-4.0
-       CC := gcc-4.0
-       LD := g++-4.0
-
-       ifeq ($(strip $(use_devil)),true)
-        $(error DEVIL isn't supported in the Mac OS X builds right now.)
-    endif
-
-       ifeq ($(strip $(use_fmod)),true)
-        $(error FMOD isn't supported in the Mac OS X builds right now.)
-    endif
-
-       ifeq ($(strip $(XCODE_DIR)),)
-        XCODE_DIR := /Developer
-    endif
-
-       ifeq ($(strip $(macosx_arch)),)
-               macosx_arch := $(shell uname -m)
-       endif
-
-       ifeq ($(strip $(macosx_arch)),ppc)
-        macosx_arch_okay := true
-        macosx_version_min := 10.4
-        macosx_version_min_required := 1040
-               macosx_sdk_dir := MacOSX10.4u.sdk
-               macosx_gcc_dir := powerpc-apple-darwin10/4.0.1
-               macosx_gcc_libdir := $(macosx_gcc_dir)
-               macosx_cxx_dir := powerpc-apple-darwin8
-    endif
-
-       ifeq ($(strip $(macosx_arch)),i386)
-        macosx_arch_okay := true
-        macosx_version_min := 10.4
-        macosx_version_min_required := 1040
-               macosx_sdk_dir := MacOSX10.4u.sdk
-               macosx_gcc_dir := i686-apple-darwin10/4.0.1
-               macosx_gcc_libdir := $(macosx_gcc_dir)
-               macosx_cxx_dir := i686-apple-darwin8
-    endif
-
-       ifeq ($(strip $(macosx_arch)),x86_64)
-        macosx_arch_okay := true
-        macosx_version_min := 10.6
-        macosx_version_min_required := 1060
-               macosx_sdk_dir := MacOSX10.6.sdk
-               macosx_gcc_dir := i686-apple-darwin10/4.0.1
-               macosx_gcc_libdir := $(macosx_gcc_dir)/x86_64
-               macosx_cxx_dir := x86_64-apple-darwin8
-    endif
-
-       ifneq ($(strip $(macosx_arch_okay)),true)
-        $(error Unknown Mac OS X architecture. Please update the makefile.)
-    endif
-
-       EXEEXT := $(macosx_arch)
-
-    CFLAGS += -arch $(macosx_arch)
-    CFLAGS += -mmacosx-version-min=$(macosx_version_min)
-    CFLAGS += -DMAC_OS_X_VERSION_MIN_REQUIRED=$(macosx_version_min_required)
-    CFLAGS += -nostdinc
-    CFLAGS += -F$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/System/Library/Frameworks
-    CFLAGS += -I$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/lib/gcc/$(macosx_gcc_dir)/include
-    CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include
-    CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0
-    CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0/$(macosx_cxx_dir)
-    CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0/$(macosx_cxx_dir)/bits
-    CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0/backward
-       CFLAGS += -mdynamic-no-pic
-
-    LDFLAGS += -arch $(macosx_arch)
-    LDFLAGS += -mmacosx-version-min=$(macosx_version_min)
-    LDFLAGS += -F$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/System/Library/Frameworks
-    LDFLAGS += -L$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/lib/gcc/$(macosx_gcc_libdir)
-    LDFLAGS += -Wl,-syslibroot,$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)
-       LDFLAGS += -framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation -framework Carbon -framework OpenAL
-       LDFLAGS += ./libSDL-1.2.0.dylib ./libSDLmain-osx.a
-else
-       CXX := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/g++
-       CC := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/gcc
-       LD := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/g++
-
-       CFLAGS += -DPLATFORM_LINUX=1
-       LDFLAGS += ./libSDL-1.2.so.0 -Wl,-rpath,\$$ORIGIN
-
-       ifeq ($(strip $(use_devil)),true)
-       LDFLAGS += ./libIL.so.1 ./libILU.so.1 ./libILUT.so.1
-       endif
-
-       ifeq ($(strip $(use_fmod)),true)
-       POSTLDFLAGS += -lpthread ./libfmod-linux-x86.a
-       else
-       LDFLAGS += ./libopenal.so.1
-       endif
-endif
-
-DEFINES += \
-       -DPLATFORM_UNIX=1 \
-       -DUSE_SDL=1 \
-       -DTRUE=1 \
-       -DFALSE=0 \
-       -Dstricmp=strcasecmp \
-       -DBinIO_STDINT_HEADER="<stdint.h>" \
-
-INCLUDES += \
-                       -I$(SRCDIR) \
-                       -I$(SDLDIR)/include \
-                       -I./OpenGL/ \
-                       -I./OpenGL/GL \
-
-ifeq ($(strip $(use_devil)),true)
-    DEFINES += -DUSE_DEVIL=1
-    INCLUDES += -I$(SRCDIR)/devil/include
-else
-    DEFINES += -DZ_PREFIX=1
-    INCLUDES += -I$(ZLIBDIR) -I$(LIBPNGDIR) -I$(JPEGLIBDIR)
-endif
-
-ifeq ($(strip $(use_fmod)),false)
-    DEFINES += -DUSE_OPENAL=1
-    INCLUDES += -I$(OPENALDIR)/include -I$(LIBOGGDIR)/include -I$(LIBVORBISDIR)/include
-endif
-
-CFLAGS += -g -c $(OPT) $(INCLUDES) $(DEFINES) -fsigned-char -pipe -w
-
-
-ifeq ($(strip $(EXEEXT)),)
-       EXEEXT := bin
-endif
-EXE := $(RUNDIR)/lugaru-$(EXEEXT)
-
-CXXFLAGS := $(CFLAGS)
-
-SRCS := \
-       Frustum.cpp \
-       GameDraw.cpp \
-       GameInitDispose.cpp \
-       GameTick.cpp \
-       Globals.cpp \
-       Lights.cpp \
-       Models.cpp \
-       Objects.cpp \
-       pack.c \
-       pack_private.c \
-       Person.cpp \
-       private.c \
-       Quaternions.cpp \
-       Random.c \
-       Skeleton.cpp \
-       Skybox.cpp \
-       Sprites.cpp \
-       Terrain.cpp \
-       Text.cpp \
-       TGALoader.cpp \
-       unpack.c \
-       unpack_private.c \
-       Weapons.cpp \
-       MacCompatibility.cpp \
-       logger/logger.cpp \
-       WinInput.cpp \
-       OpenGL_Windows.cpp \
-       openal_wrapper.cpp \
-
-SRCS := $(foreach f,$(SRCS),$(SRCDIR)/$(f))
-
-
-UNUSED_SRCS := \
-       DRIVER.CC \
-       MD5.CC \
-
-
-PNGSRCS := \
-    png.c \
-    pngerror.c \
-    pnggccrd.c \
-    pngget.c \
-    pngmem.c \
-    pngpread.c \
-    pngread.c \
-    pngrio.c \
-    pngrtran.c \
-    pngrutil.c \
-    pngset.c \
-    pngtrans.c \
-    pngvcrd.c \
-    pngwio.c \
-    pngwrite.c \
-    pngwtran.c \
-    pngwutil.c \
-
-PNGSRCS := $(foreach f,$(PNGSRCS),$(LIBPNGDIR)/$(f))
-
-JPEGSRCS := \
-       jdapistd.c \
-    jdmaster.c \
-    jdapimin.c \
-    jcapimin.c \
-    jdmerge.c \
-    jdatasrc.c \
-    jdatadst.c \
-    jdcoefct.c \
-    jdcolor.c \
-    jddctmgr.c \
-    jdhuff.c \
-    jdinput.c \
-    jdmainct.c \
-    jdmarker.c \
-    jdphuff.c \
-    jdpostct.c \
-    jdsample.c \
-    jdtrans.c \
-    jerror.c \
-    jidctflt.c \
-    jidctfst.c \
-    jidctint.c \
-    jidctred.c \
-    jmemmgr.c \
-    jutils.c \
-    jmemnobs.c \
-    jquant1.c \
-    jquant2.c \
-    jcomapi.c \
-    jcmarker.c \
-    jcapistd.c \
-    jcparam.c \
-    jcinit.c \
-    jcdctmgr.c \
-    jccoefct.c \
-    jcmainct.c \
-    jfdctflt.c \
-    jfdctint.c \
-    jfdctfst.c \
-    jchuff.c \
-    jcphuff.c \
-    jcsample.c \
-    jcmaster.c \
-    jccolor.c \
-    jcprepct.c \
-
-JPEGSRCS := $(foreach f,$(JPEGSRCS),$(JPEGLIBDIR)/$(f))
-
-
-ZLIBSRCS = \
-       adler32.c \
-       compress.c \
-       crc32.c \
-       deflate.c \
-       gzio.c \
-       infback.c \
-       inffast.c \
-       inflate.c \
-       inftrees.c \
-       trees.c \
-       uncompr.c \
-       zutil.c \
-
-ZLIBSRCS := $(foreach f,$(ZLIBSRCS),$(ZLIBDIR)/$(f))
-
-
-GLUSRCS := \
-       dict.c \
-       geom.c \
-       memalloc.c \
-       mesh.c \
-       mipmap.c \
-       normal.c \
-       priorityq.c \
-       render.c \
-       sweep.c \
-       tess.c \
-       tessmono.c \
-       util.c \
-
-GLUSRCS := $(foreach f,$(GLUSRCS),$(GLUDIR)/$(f))
-
-
-OGGSRCS := \
-       bitwise.o \
-       framing.o
-
-OGGSRCS := $(foreach f,$(OGGSRCS),$(LIBOGGDIR)/src/$(f))
-
-VORBISSRCS := \
-       analysis.o \
-    bitrate.o \
-    block.o \
-    codebook.o \
-    envelope.o \
-    floor0.o \
-    floor1.o \
-    info.o \
-    lpc.o \
-    lsp.o \
-    mapping0.o \
-    mdct.o \
-    psy.o \
-    registry.o \
-    res0.o \
-    sharedbook.o \
-    smallft.o \
-    synthesis.o \
-    vorbisfile.o \
-    window.o
-
-VORBISSRCS := $(foreach f,$(VORBISSRCS),$(LIBVORBISDIR)/lib/$(f))
-
-ifeq ($(strip $(macosx)),false)
-       SRCS += $(GLUSRCS)
-endif
-
-ifeq ($(strip $(use_devil)),false)
-    SRCS += $(PNGSRCS) $(JPEGSRCS) $(ZLIBSRCS)
-endif
-
-ifeq ($(strip $(use_fmod)),false)
-    SRCS += $(OGGSRCS) $(VORBISSRCS)
-endif
-
-OBJS := $(SRCS:.CC=.o)
-OBJS := $(OBJS:.cc=.o)
-OBJS := $(OBJS:.cpp=.o)
-OBJS := $(OBJS:.c=.o)
-OBJS := $(OBJS:.m=.o)
-OBJS := $(foreach f,$(OBJS),$(BINDIR)/$(f))
-
-
-.PHONY: clean all
-
-all : $(EXE)
-
-$(BINDIR)/%.o : %.cpp
-       @mkdir -p $(dir $@)
-       $(CXX) -o $@ $(CXXFLAGS) $<
-
-$(BINDIR)/%.o : %.CC
-       @mkdir -p $(dir $@)
-       $(CXX) -x c++ -o $@ $(CXXFLAGS) $<
-
-$(BINDIR)/%.o : %.cc
-       @mkdir -p $(dir $@)
-       $(CXX) -o $@ $(CXXFLAGS) $<
-
-$(BINDIR)/%.o : %.m
-       @mkdir -p $(dir $@)
-       $(CC) -o $@ $(CFLAGS) $<
-
-$(BINDIR)/%.o : %.c
-       @mkdir -p $(dir $@)
-       $(CC) -o $@ $(CFLAGS) $<
-
-$(EXE) : $(OBJS) $(APPOBJS)
-       @mkdir -p $(dir $@)
-       $(LD) -o $@ $(LDFLAGS) $(OBJS) $(APPOBJS) $(POSTLDFLAGS)
-
-clean:
-       rm -f $(BINDIR)/*.o
-       rm -f $(BINDIR)/$(SRCDIR)/*.o
-       rm -f $(BINDIR)/$(SRCDIR)/logger/*.o
-       rm -f $(BINDIR)/$(GLUDIR)/*.o
-       rm -f $(BINDIR)/$(LIBPNGDIR)/*.o
-       rm -f $(BINDIR)/$(JPEGLIBDIR)/*.o
-       rm -f $(BINDIR)/$(ZLIBDIR)/*.o
-       rm -f $(BINDIR)/$(LIBOGGDIR)/src/*.o
-       rm -f $(BINDIR)/$(LIBVORBISDIR)/lib/*.o
-       rm -f $(EXE)
-
-# end of makefile ...
-
index f02e18921f71cdb0f4444cb743e36aa9fdcf44b9..ac33ff144294da7040e041099dbd62b650f64012 100755 (executable)
@@ -6,8 +6,8 @@ set -x
 NCPU=`sysctl -n hw.ncpu`
 
 for arch in ppc i386 x86_64 ; do
-    make macosx=true macosx_arch=$arch clean
-    make macosx=true macosx_arch=$arch -j$NCPU
+    make -f makefile.old macosx=true macosx_arch=$arch clean
+    make -f makefile.old macosx=true macosx_arch=$arch -j$NCPU
     # We always strip here. For debugging, you should do "make" directly.
     strip run/lugaru-$arch
     BINS="$BINS run/lugaru-$arch"