Documentation: add detailed build system documentation, add documentation for some files in resources

BodgeMaster-unfinished
BodgeMaster 2022-07-06 13:33:10 +02:00
parent 4e2a9f6297
commit bb8c597ec2
3 changed files with 89 additions and 11 deletions

View File

@ -52,18 +52,10 @@ This will download the following dependenceis:
### Building ### Building
To build the project, just use the `build` alias or invoke the `build.sh` To build the project, just use the `build` alias or invoke `scripts/build.sh`
script from the project's base directory. from the project's base directory.
`build` and `build.sh` accept the environment variables `CXX`, `CXXFLAGS`, and `SINGLE`.
- `CXXFLAGS` must at least specify the C++ version.
- Set `SINGLE` to `yes` to run the build script in single-threaded mode.
To clean out the build or dependency directories, use `clean` and
`clean_dependencies` or their corresponding scripts respectively.
`setup_project` will clean out both before doing its thing.
For more details, have a look at [the build system documentation](doc/build_system.md).
## Copyright / License ## Copyright / License

60
doc/build_system.md Normal file
View File

@ -0,0 +1,60 @@
# FOSS-VG Buils System
Yeah, I was annoyed at make. Sorry. -BodgeMaster
## Aliases
The shell environment provided in the project's base directory contains
aliases that can be invoked from anywhere.
This is useful if you, for example, `cd src/lib` and want to do a quick
rebuild, you can just run `build` and it will take care of switching
directories back and forth.
Where necessary, the "aliases" are shell functions instead of literal aliases
to accommodate for inline environment variables.
Provided aliases:
- `setup_project` runs `scripts/setup_project.sh`
- `build` runs `scripts/build.sh`
- `run_tests` runs `scripts/test.sh` (we can't alias `test` because that's an
actual POSIX command and it would break a lot of things)
- `clean` runs `scripts/clean.sh`
- `clean_dependencies` runs `scripts/clean_dependencies.sh`
## setup_project
Cleans the project and its dependencies first, ensuring the project is in a known state, then downloads and extracts dependencies.
This will probably do more in the future (for example compile dependencies that need to be compiled).
# build
Builds the project. This will compile all the things in `src/` except for what is in `src/test/`.
Checks for endianness if endianness header is missing. Builds the endianness check if that is missing as well.
Accepted environment variables:
- `CXX`: override the default compiler
- `CXXFLAGS`: override the default compiler flags, must at least specify the C++ version
- `SINGLE`: if set to `yes`, causes the build script to run in single-threaded mode
# test / run_tests
Builds and runs the unit tests.
Accepted environment variables:
- `CXX`: override the default compiler
- `CXXFLAGS`: override the default compiler flags, must at least specify the C++ version
# clean
Removes and re-creates `bin/`. Also removes the endianness header and the endianness check.
# clean_dependencies
Removes and re-created `dependencies/`.

View File

@ -1,7 +1,33 @@
# Tests # Tests
## unicode_data/
This directory contains two files with unicode data. One is in Java format, the other is normal UTF-8.
## check_endianness.cpp
A simple tool to determine the endianness of the system and write the endianness header for FOSS-VG
Supports: Little Endian, Big Endian, PDP Endian, Honeywell Endian
Note that, while it can detect PDP and Honeywell endianness, the FOSS-VG project itself does not support these.
Usage example: `check_endianness > header_file`
## JavaStringGenerator.java
A simple tool written in Java that takes an input as UTF-8 and outputs it in Java-style UTF-8.
Usage example: `echo -ne "\x00" | java JavaStringGenerator > output_file`
## servers.dat ## servers.dat
My current servers.dat as pulled from my Minecraft installation. Used for testing the NBT library until we have something better. My current servers.dat as pulled from my Minecraft installation. Used for testing the NBT library until we have something better.
## servers.dat_nbt_decoded.txt ## servers.dat_nbt_decoded.txt
The same file manually decoded. I did this to get a better understanding how NBT works, might come in handy in the future. The same file manually decoded. I did this to get a better understanding how NBT works, might come in handy in the future.