Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rafalh/mtasa_txbuild
Build tools required to build scripts for Toxic server in Multi Theft Auto: San Andreas.
https://github.com/rafalh/mtasa_txbuild
mtasa mtasa-lua multi-theft-auto
Last synced: 3 days ago
JSON representation
Build tools required to build scripts for Toxic server in Multi Theft Auto: San Andreas.
- Host: GitHub
- URL: https://github.com/rafalh/mtasa_txbuild
- Owner: rafalh
- License: mit
- Created: 2021-02-09T23:31:57.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T20:21:57.000Z (about 2 years ago)
- Last Synced: 2024-03-19T16:11:03.932Z (9 months ago)
- Topics: mtasa, mtasa-lua, multi-theft-auto
- Language: C++
- Homepage:
- Size: 1.36 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Toxic Build
===========Tool used for MTA resources compilation based on meta.xml.
Usage
-----
Define environment variable `TXBUILD` as path to directory where this repository has been cloned.In every resource source directory create Makefile:
PROJECT_NAME :=
PROJECT_DIR :=include $(TXBUILD)/generic.mak
In root source directory for all resources create `config.mak` file (customize example for your needs):
SELF := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
PREPROCESS := 1
COMPILE := 1
UTF8_BOM := 0
JOIN := 0
PROTECT := 1
LOADER_PATH := $(SELF)loader.lua
ifeq ($(windir),)
RESOURCES_PATH := /mnt/c/Program\ Files\ (x86)/MTA\ San\ Andreas\ 1.5/server/mods/deathmatch/resources/
else
RESOURCES_PATH := C:/Program\ Files\ (x86)/MTA\ San\ Andreas\ 1.5/server/mods/deathmatch/resources/
endif
TEMP_DIR := buildCompile resource using Make tool. On Windows you need mingw32-make (included in txbuild). For example:
$(TXBUILD)\mingw32-make
Configuration properties
------------------------Behaviour of txbuild can be defined in `config.mak` files in resource directory or up to 3 levels higher in filesystem hierarchy. Configuration files on higher level has lower priority. File can define any set of following optional variables:
* `PREPROCESS` - run preprocessor on every Lua file. See description of preprocessor below.
* `COMPILE` - compile Lua files using luac_mta tool
* `UTF8_BOM` - add UTF8 BOM to final Lua scripts
* `JOIN` - join all Lua scripts into one big script - recommended to increase difficulty of reverse engineering
* `PROTECT` - protect scripts by embedding them for loading by custom loader specified in `LOADER_PATH`
* `RESOURCES_PATH` - destination path for compiled resources
* `TEMP_DIR` - name of directory used for buildingPreprocessor
------------Preprocessor runs every line starting with `#` and evaluates expressions `$(...)`. See examples below.
Conditional compilation:
#if FEATURE_A
addCommandHandler('a', ...)
#endIncluding other file:
#include 'a.lua'
Compile-time constants:
#define TIMEOUT 200
setTimer(function () end, $(TIMEOUT))
Protection with loader
----------------------
Loader is a preprocessed Lua script used for additional protection of scripts. If `PROTECT` is set to 1 every Lua script is returned as embedded in custom loader defined using `LOADER_PATH` variable in `config.mak`. When preprocessing loader file preprocessor variable `__LUA_CHUNK_TBL__` contains table of strings from input Lua file. Loader can use preprocessor to encrypt those lines and embedd them for future execution in runtime.Building
--------
Toxic Build consists of some native components that needs to be built using a C++ compiler. The project uses CMake build system. Source code is in `src` directory.On Windows Visual Studio can be used for building (it has CMake support built-in). Alternatively MinGW can be used with a separate CMake GUI tool. Building can be avoided by downloading `txbuild-bin-win32.zip` file from [Releases](https://github.com/rafalh/mtasa_txbuild/releases) page and unpacking it in the root directory (preserving `bin` subdirectory).
On Linux GCC and CMake can be installed from distribution package manager.
To build on Ubuntu run:
```bash
sudo apt-get install build-essentials cmake
mkdir build
cmake ../src -DCMAKE_BUILD_TYPE=Release
make
```Copyright
---------
Copyright (c) 2012 Rafał Harabień