A game library and wrapper around SFML
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.
 
 
 

126 lines
3.9 KiB

# Building Tests:
# jam clean
# jam -j4 -q
# Building Unreal:
# jam clean
# jam -j4 -q -sUNREAL=true GalavantPseudotarget
# (if building the same target repeatedly, don't clean, if that wasn't obvious)
##
## Compiler
##
CC = gcc ;
# GCC
#C++ = g++ ;
#LINK = g++ ;
# Clang
C++ = clang++ ;
LINK = clang++ ;
# LINK = ld ;
##
## Compiler arguments
##
# Galavant requires C++11
## Argument explanation
#
# g = debug symbols
# -O0 = compile without optimizations for debugging
#
# -Wall -Wextra = Error detection/tolerance
# -Wno-unused-parameter = I should probably get rid of this at some point
#
# fPIC = position independent code. This is so the lib can be linked in other libs/executables
# -stdlib=lib++ = Unreal uses libc++, which is busted on Ubuntu 16.04. Remove this option
# if you don't give a shit about Unreal and/or want to build the tests
#
# lstdc++ = standard library [Unused]
# Arguments used on all projects, regardless of any variables
C++FLAGS = -std=c++14 -stdlib=libstdc++ -fPIC
-Wall -Wextra -Wno-unused-parameter
# Why isn't this quoting properly?
# -D IMGUI_USER_CONFIG=\"dependencies/imgui-sfml/imconfig-SFML.h\"
;
# Required arguments for tests
TESTSC++FLAGS = -g ;
ALLLIBSC++FLAGS = $(TESTSC++FLAGS) ;
OPTIM = -O0 ;
HDRS =
dependencies/SFML/include
dependencies/imgui
dependencies/imgui-sfml
;
LINKFLAGS = -stdlib=libstdc++
-Wl,-rpath,.:dependencies/SFML/lib
;
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 ;
}
# This is for test executables, not the lib. You can use this as reference for your own executables
LINKLIBS =
# SFML
-Ldependencies/SFML/lib
$(SFML_LINKLIBS)
# OpenGL
-lGL
-lGLU
-lGLEW
;
# HDRS = thirdParty/flatbuffers/include src ;
# TODO: add project-specific filetype rules for things like flatbuffer .json compilation (see "UserObject rule":
# https://swarm.workshop.perforce.com/view/guest/perforce_software/jam/src/Jamfile.html ) ?
# TODO: [Hacked done] Calling jam -dc indicates that it thinks many unmodified files are newer,
# which is why it's building way more than it should be. Further investigation is needed, as if it
# has nothing to build it should complete almost instantly
#
# The problem was Library deletes .o files, preventing Jam from knowing what needs rebuilt
# (see https://swarm.workshop.perforce.com/view/guest/perforce_software/jam/src/Jambase.html)
# Actually, because I'm moving libs to lib/, Jam doesn't know to look there for .o
# (see http://maillist.perforce.com/pipermail/jamming/2004-November/004235.html)
# Motherfucker seems to be broken no matter fucking what (see src/Jamfile commented lines)
#
# Update: Something seems fucked with the Library or LibraryFromObjects rules. Instead of diving
# deeper, I'm going to just add this flag which will guarantee Jam won't rely on reading the libs
# to find "missing" objects
# (as an aside, https://swarm.workshop.perforce.com/view/guest/perforce_software/jam/src/Jam.html
# was helpful, esp 'jam -dx')
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 ;
# Some helpful Jam commands
# -q : stop on failed target
# -jN : use N cores
# -sVAR=VAL : Set VAR to VAL. Note that setting UNREAL=false is the same as setting UNREAL=true,
# frustratingly
# -dx : print commands being used
# -n : don't actually run commands
# Note: When creating ConsoleOnly frontend, I had to reverse the lib link order. This is probably
# just because I didn't understand link order when making GalavantPseudotarget. I've since updated
# GalavantPseudotarget with the proper order