Vehicle simulation game
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

208 lines
5.8 KiB

##
## Compilation
##
C = clang ;
C++ = clang++ ;
LINK = clang++ ;
# C++ = g++ ;
# LINK = g++ ;
# If I was building a library, these would be useful
# LINKFLAGS = -shared ;
# if $(UNIX) { SUFSHR = .so ; }
# else if $(NT) { SUFSHR = .dll ; }
## Compiler arguments
# Arguments used on all projects, regardless of any variables
# Note that Tracy 0.6.5 requires c++14 (normally C++11 would be fine)
C++FLAGS = -std=c++14 -stdlib=libstdc++
-Wall -Wextra -Wno-unused-parameter
-g
# Only for profiling, i.e. not release builds
-DTRACY_ENABLE
# BT_USE_DOUBLE_PRECISION solves the Dantzig LCP missing definition
# Disabled now that I'm compiling Bullet in single-precision
# -DBT_USE_DOUBLE_PRECISION
;
HDRS = src
Dependencies/bullet3/src Dependencies/bullet3/Extras/Serialize/BulletWorldImporter
Dependencies/base2.0
Dependencies/base2.0/dependencies/SFML/include
Dependencies/base2.0/dependencies/imgui
Dependencies/base2.0/dependencies/imgui-sfml
Dependencies/tinygltf Dependencies/tinyobjloader
Dependencies/glm
Dependencies/Horde3D/Horde3D/Bindings/C++
Dependencies/tracy
;
if $(DEBUG_BUILD)
{
BULLET3_BUILD_DIR = Dependencies/bullet3/build_cmake_debug ;
# TODO: Separate Horde debug and release build directories
HORDE3D_BUILD_DIR = Dependencies/Horde3D/build/Horde3D ;
}
else
{
BULLET3_BUILD_DIR = Dependencies/bullet3/build_cmake ;
HORDE3D_BUILD_DIR = Dependencies/Horde3D/build/Horde3D ;
}
# TODO: Make base hold all this weirdness?
if $(DEBUG_BUILD)
{
SFML_LINKLIBS = -lsfml-audio-d -lsfml-graphics-d -lsfml-window-d -lsfml-system-d ;
}
else
{
SFML_LINKLIBS = -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system ;
}
OPTIM = -O0 ;
##
## Linking
##
LINKLIBS =
# Standard (e.g. for Tracy)
-lpthread -ldl
# SFML
-LDependencies/base2.0/dependencies/SFML/lib
$(SFML_LINKLIBS)
# OpenGL
-lGL
-lGLU
-lGLEW
# Base
-LDependencies/base2.0 -lBase20
# Bullet libraries
-L$(BULLET3_BUILD_DIR)/src/BulletDynamics
-L$(BULLET3_BUILD_DIR)/src/BulletCollision
-L$(BULLET3_BUILD_DIR)/src/Bullet3Common
-L$(BULLET3_BUILD_DIR)/src/LinearMath
-L$(BULLET3_BUILD_DIR)/Extras/Serialize/BulletWorldImporter
-lBullet3Common
-lBulletDynamics
-lBulletCollision
-lLinearMath
-lBulletWorldImporter
# Stuff I'm not using, but could use
# -L$(BULLET3_BUILD_DIR)/src/BulletSoftBody
# -L$(BULLET3_BUILD_DIR)/src/BulletInverseDynamics
# -L$(BULLET3_BUILD_DIR)/src/Bullet3InverseDynamicsUtils
# -lBulletSoftBody
# -lBulletInverseDynamics
# -lBulletInverseDynamicsUtils
-LDependencies/Horde3D/build/Horde3D/Source/Horde3DEngine
-LDependencies/Horde3D/build/Horde3D/Source/Horde3DUtils
-lHorde3D
-lHorde3DUtils
;
# LINKFLAGS = -Wl,-rpath,. ;
# TODO: Copy libs to better directory, or static link?
LINKFLAGS = -g -stdlib=libstdc++
-Wl,-rpath,.:Dependencies/base2.0/dependencies/SFML/lib:$(BULLET3_BUILD_DIR)/src/BulletSoftBody:$(BULLET3_BUILD_DIR)/Extras/InverseDynamics:$(BULLET3_BUILD_DIR)/src/BulletInverseDynamics:$(BULLET3_BUILD_DIR)/examples/ThirdPartyLibs/BussIK:$(BULLET3_BUILD_DIR)/src/BulletDynamics:$(BULLET3_BUILD_DIR)/src/BulletCollision:$(BULLET3_BUILD_DIR)/src/LinearMath:$(BULLET3_BUILD_DIR)/src/Bullet3Common:$(BULLET3_BUILD_DIR)/src/Bullet3Collision:$(BULLET3_BUILD_DIR)/Extras/Serialize/BulletWorldImporter:$(HORDE3D_BUILD_DIR)/Source/Horde3DEngine:$(HORDE3D_BUILD_DIR)/Source/Horde3DUtils ;
##
## Jam stuff
##
# Fix for unnecessary rebuilding any Jam project
KEEPOBJS = true ; # This doesn't actually fix anything, though it seems like it should
NOARSCAN = true ; # This actually fixes the problem
#AR = ar rUu ; # I was thinking maybe the AR command was wrong (always outputting deterministically)
# It doesn't seem like this is the problem though
AR = ar cr ;
# Cross compilation
# E.g.
# jam -j4 -q -sCROSS_COMPILE_WINDOWS=true
# if $(CROSS_COMPILE_WINDOWS)
# {
# CC = x86_64-w64-mingw32-gcc ;
# LINK = x86_64-w64-mingw32-gcc ;
# AR = x86_64-w64-mingw32-ar ;
# SUFSHR = .dll ;
# }
# Some helpful Jam commands
# -q : stop on failed target
# -jN : use N cores
# -sVAR=VAL : Set VAR to VAL. Note that setting WINDOWS=false is the same as setting UNREAL=true,
# frustratingly
# -dx : print commands being used
# -n : don't actually run commands
#
# Custom actions
# Refer to http://david.freetype.org/jam/jam-language-3.html
# $(1:S=.c) : Take $(1), strip the extension, and append ".c"
# $(1:BS=.h) : Strip path and extension, then append ".h"
Depends all : dataAssets ;
NotFile dataAssets ;
if $(BLENDER)
{
BLENDER_EXE = $(BLENDER) ;
}
else
{
BLENDER_EXE = blender ;
}
# Usage:
# BuildAsset outputAssets/outputAsset : inputAssets/input.blend ;
# TODO: Make output actually respected; currently ExportBlenderAssets.py determines output internally
rule BuildAsset
{
# Add 1 to list of data assets that need built
Depends dataAssets : $(1) ;
# 1 is a collection of assets, so not a file
NotFile $(1) ;
# 1 requires both a .obj and .dae (collision and render respectively)
Depends $(1) : $(1:S=.obj) $(1:S=.dae) ;
# The obj and dae require a .blend
# This rule ensures if the .blend is updated, the .obj and .dae are dirty (causing BuildAsset to run)
Depends $(1:S=.obj) : $(2) ;
Depends $(1:S=.dae) : $(2) ;
# TODO: Add depenencies on collision
Depends Collision/$(1:S=.obj) : $(1:S=.obj) ;
# TODO: I don't normally want to reprocess assets on clean. Make a separate CleanAssets rule
# Clean clean : $(1:S=.obj) $(1:S=.dae) ;
}
actions BuildAsset
{
$(BLENDER_EXE) $(2) --background --python ExportBlenderAssets.py
# TODO: Add these to clean and dependencies, because otherwise it will think
# subsequent builds are successful even if ColladaConv failed
# TODO: Make this directory!
cp $(1:S=.obj) Collision/
# TODO: Use build dir instead
./Dependencies/Horde3D/build/Binaries/Linux/Debug/ColladaConv $(1:S=.dae) -type model -addModelName -dest Content
# TODO: Add textures
# Bulk Collision : $(1:S=.obj) ;
}