
12 changed files with 250 additions and 0 deletions
@ -0,0 +1,3 @@ |
|||
[submodule "Dependencies/cakelisp"] |
|||
path = Dependencies/cakelisp |
|||
url = https://macoy.me/code/macoy/cakelisp |
@ -0,0 +1,5 @@ |
|||
#!/bin/sh |
|||
|
|||
echo "Building Cakelisp..." |
|||
cd Dependencies/cakelisp && jam -j4 && cd ../../ |
|||
echo "done!" |
@ -0,0 +1,6 @@ |
|||
#!/bin/sh |
|||
|
|||
./Dependencies/cakelisp/bin/cakelisp src/OgreCore.cake \ |
|||
&& jam -j4 libGameLib.a |
|||
|
|||
./Dependencies/cakelisp/bin/cakelisp test/OgreApp.cake && cd test && jam -j4 |
@ -0,0 +1,3 @@ |
|||
SubDir . ; |
|||
|
|||
SubInclude . src ; |
@ -0,0 +1,102 @@ |
|||
## |
|||
## Compilation |
|||
## |
|||
|
|||
C++ = clang++ ; |
|||
LINK = clang++ ; |
|||
# C++ = g++ ; |
|||
# LINK = g++ ; |
|||
|
|||
if $(UNIX) { SUFSHR = .so ; } |
|||
else if $(NT) { SUFSHR = .dll ; } |
|||
|
|||
if $(CROSS_COMPILE_WINDOWS) |
|||
{ |
|||
C++ = x86_64-w64-mingw32-g++ ; |
|||
LINK = x86_64-w64-mingw32-g++ ; |
|||
AR = x86_64-w64-mingw32-ar ; |
|||
SUFEXE = .exe ; |
|||
|
|||
OS_DEPENDENT_C++FLAGS = -DWINDOWS ; |
|||
OS_DEPENDENT_LINKLIBS = ; |
|||
OS_DEPENDENT_LINKFLAGS = --export-all-symbols ; |
|||
|
|||
MINGW_LIB_PATH = /usr/lib/gcc/x86_64-w64-mingw32/7.3-win32 ; |
|||
OS_DEPENDENT_DLLS = |
|||
$(MINGW_LIB_PATH)/libgcc_s_seh-1.dll |
|||
$(MINGW_LIB_PATH)/libstdc++-6.dll ; |
|||
} |
|||
else if $(UNIX) |
|||
{ |
|||
OS_DEPENDENT_C++FLAGS = -DUNIX ; |
|||
# For dynamic loading: ldl loads, export-dynamic lets the loaded code resolve its symbols to the loader's code |
|||
OS_DEPENDENT_LINKLIBS = -ldl ; |
|||
OS_DEPENDENT_LINKFLAGS = --export-dynamic ; |
|||
OS_DEPENDENT_DLLS = ; |
|||
} |
|||
else if $(NT) |
|||
{ |
|||
OS_DEPENDENT_C++FLAGS = -DWINDOWS ; |
|||
# TODO: Windows support |
|||
OS_DEPENDENT_LINKLIBS = ; |
|||
OS_DEPENDENT_LINKFLAGS = ; |
|||
OS_DEPENDENT_DLLS = ; |
|||
} |
|||
|
|||
# Arguments used on all projects, regardless of any variables |
|||
C++FLAGS = -std=c++11 -Wall -Wextra -Wno-unused-parameter |
|||
# Only for profiling, i.e. not release builds |
|||
# -DTRACY_ENABLE |
|||
-g |
|||
# Needed for dynamic linking |
|||
-fPIC |
|||
|
|||
$(OS_DEPENDENT_C++FLAGS) |
|||
; |
|||
|
|||
# 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 |
|||
# Functions for dynamically loading libraries (UNIX) |
|||
$(OS_DEPENDENT_LINKLIBS) |
|||
; |
|||
|
|||
LINKFLAGS = -g |
|||
# -Wl = pass to linker |
|||
# --export-dynamic = Export all symbols so dynamically loaded code can resolve their symbols to ours |
|||
-Wl,-rpath,.,$(OS_DEPENDENT_LINKFLAGS) |
|||
; |
|||
## |
|||
## 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 ; |
|||
|
|||
# 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 WINDOWS=true, |
|||
# frustratingly (as if it's an ifdef not an if x = y |
|||
# -dx : print commands being used |
|||
# -n : don't actually run commands |
@ -0,0 +1,3 @@ |
|||
SubDir . src ; |
|||
|
|||
Library libGameLib : OgreCore.cake.cpp ; |
@ -0,0 +1,5 @@ |
|||
(c-import "<stdio.h>") |
|||
|
|||
(defun ogre-initialize (&return bool) |
|||
(printf "Ogre initialized\n") |
|||
(return true)) |
@ -0,0 +1,3 @@ |
|||
SubDir . ; |
|||
|
|||
Main ogreApp : OgreApp.cake.cpp ; |
@ -0,0 +1,105 @@ |
|||
## |
|||
## Compilation |
|||
## |
|||
|
|||
C++ = clang++ ; |
|||
LINK = clang++ ; |
|||
# C++ = g++ ; |
|||
# LINK = g++ ; |
|||
|
|||
if $(UNIX) { SUFSHR = .so ; } |
|||
else if $(NT) { SUFSHR = .dll ; } |
|||
|
|||
if $(CROSS_COMPILE_WINDOWS) |
|||
{ |
|||
C++ = x86_64-w64-mingw32-g++ ; |
|||
LINK = x86_64-w64-mingw32-g++ ; |
|||
AR = x86_64-w64-mingw32-ar ; |
|||
SUFEXE = .exe ; |
|||
|
|||
OS_DEPENDENT_C++FLAGS = -DWINDOWS ; |
|||
OS_DEPENDENT_LINKLIBS = ; |
|||
OS_DEPENDENT_LINKFLAGS = --export-all-symbols ; |
|||
|
|||
MINGW_LIB_PATH = /usr/lib/gcc/x86_64-w64-mingw32/7.3-win32 ; |
|||
OS_DEPENDENT_DLLS = |
|||
$(MINGW_LIB_PATH)/libgcc_s_seh-1.dll |
|||
$(MINGW_LIB_PATH)/libstdc++-6.dll ; |
|||
} |
|||
else if $(UNIX) |
|||
{ |
|||
OS_DEPENDENT_C++FLAGS = -DUNIX ; |
|||
# For dynamic loading: ldl loads, export-dynamic lets the loaded code resolve its symbols to the loader's code |
|||
OS_DEPENDENT_LINKLIBS = -ldl ; |
|||
OS_DEPENDENT_LINKFLAGS = --export-dynamic ; |
|||
OS_DEPENDENT_DLLS = ; |
|||
} |
|||
else if $(NT) |
|||
{ |
|||
OS_DEPENDENT_C++FLAGS = -DWINDOWS ; |
|||
# TODO: Windows support |
|||
OS_DEPENDENT_LINKLIBS = ; |
|||
OS_DEPENDENT_LINKFLAGS = ; |
|||
OS_DEPENDENT_DLLS = ; |
|||
} |
|||
|
|||
# Arguments used on all projects, regardless of any variables |
|||
C++FLAGS = -std=c++11 -Wall -Wextra -Wno-unused-parameter |
|||
# Only for profiling, i.e. not release builds |
|||
# -DTRACY_ENABLE |
|||
-g |
|||
# Needed for dynamic linking |
|||
-fPIC |
|||
|
|||
$(OS_DEPENDENT_C++FLAGS) |
|||
; |
|||
|
|||
# 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 |
|||
# Functions for dynamically loading libraries (UNIX) |
|||
$(OS_DEPENDENT_LINKLIBS) |
|||
|
|||
-L../src |
|||
-lGameLib |
|||
; |
|||
|
|||
LINKFLAGS = -g |
|||
# -Wl = pass to linker |
|||
# --export-dynamic = Export all symbols so dynamically loaded code can resolve their symbols to ours |
|||
-Wl,-rpath,.,$(OS_DEPENDENT_LINKFLAGS) |
|||
; |
|||
## |
|||
## 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 ; |
|||
|
|||
# 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 WINDOWS=true, |
|||
# frustratingly (as if it's an ifdef not an if x = y |
|||
# -dx : print commands being used |
|||
# -n : don't actually run commands |
@ -0,0 +1,9 @@ |
|||
;; TODO: Cakelisp include paths |
|||
(import "../src/OgreCore.cake") |
|||
|
|||
(c-import "<stdio.h>") |
|||
|
|||
(defun main (&return int) |
|||
(printf "Hello, world!\n") |
|||
(ogre-initialize) |
|||
(return 0)) |
Loading…
Reference in new issue