Building with GNU Make
Required software
Building
- Open a terminal (
cmd
on Windows,sh
on Linux/Mac) window in SGScript source root directory. - Run
make
(mingw32-make
on Windows), optionally specifying targets and options.- The syntax is
make <target|option>[, <target|option> ...]
- To build only the library, just write
make
; - To build all tools (VM, compiler, plug-in modules), write
make tools
.
- The syntax is
- On Windows, a batch file can be used to enable the usage of
make
(create a filemake.bat
inC:\MinGW\bin
directory or equivalent, add the directory to PATH if it's not there):
@ECHO OFF mingw32-make %*
Build options
Targets:
- libraries & tools
- <no target>: build just the library
- xgmath: build eXtended Game Math library
- json: build JSON library
- pproc: build Parallel Processing library
- sockets: build Sockets library
- meta: build Metaprogramming helper library
- vm: build the virtual machine (sgsvm)
- c: build the compiler (sgsc)
- sgsexe: build SGScript EXE builder
- testing
- build_test: build language test application
- build_apitest: build API test application
- build_cppbctest: build C++ binding compiler test application
- build_mttest: build multithreading safety test application
- test: build and run language test application
- apitest: build and run API test application
- cppbctest: build and run C++ binding compiler test application
- mttest: build and run multithreading safety test application
- other
- clean: clean all generated files
- clean_obj: clean only intermediate build files
- clean_objbin: clean intermediate build files and binaries
Options:
- arch=[32|64] - target architecture (x86/x64), default depends on compiler
- mode=[debug|release] - whether it's a debug or a release build (default=debug)
- static=[1|0] - whether to build a static library or a dynamic one (default=0: dynamic)
Additional build options & platforms
- To build on Android, modify the makefile according to the comment in the beginning of that file.