~ashn/autil

Public domain utilities for C99
Release v2.0.0
Remove the AUTIL_ALIGNOF macro
Fix PHONY target that was missed in the test->check make target rename

clone

read-only
https://git.sr.ht/~ashn/autil
read/write
git@git.sr.ht:~ashn/autil

You can also use your local clone with git send-email.

#AUTIL - ASHN'S UTILITIES

Public domain headers containing functions and data structures for rapid application development in C99 (or later).

Library Description
autil.h General purpose utility functions and data structures
atest.h Dead simple unit testing library
aengn.h 2D game engine with pixel coordinates (SDL2 backend)

See individual header files for usage instructions.

#Building and Running Unit/Integration Tests

#POSIX c99

$ make check CFLAGS='$(C99_DBG)'  # Debug
$ make check                      # Release

#GCC or Clang

$ make check CC=clang CFLAGS='$(GNU_DBG)'              # Debug
$ make check CC=clang CFLAGS='$(GNU_DBG) $(SANITIZE)'  # Debug with Address
                                                       # Sanitizer (glibc only)
$ make check CC=clang CFLAGS='$(GNU_REL)'              # Release

#Building and Running Examples

#Dependencies

Applications built using aengn.h link against SDL2, SDL2_image, and SDL2_mixer for native builds and compile with Emscripten's emcc for web builds. SDL2 and its extension libraries are provided by most package managers, and can be installed on Debian-based distros with:

$ apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev

The Emscripten toolchain can be downloaded and activated with:

$ git clone https://github.com/emscripten-core/emsdk.git
$ cd emsdk/
$ ./emsdk install latest  # Download and install latest SDK (do this once)
$ ./emsdk activate latest # Make the latest SDK active (do this once)
$ source ./emsdk_env.sh   # Setup envrionment (source this every time)

#Building

$ make examples CFLAGS='$(C99_DBG)'  # Debug   (c99)
$ make examples                      # Release (c99)

$ make examples CC=clang CFLAGS='$(GNU_DBG)'  # Debug   (gcc/clang)
$ make examples CC=clang CFLAGS='$(GNU_REL)'  # Release (gcc/clang)

$ make examples-web CFLAGS='$(GNU_DBG)'  # Debug   (emscripten)
$ make examples-web CFLAGS='$(GNU_REL)'  # Release (emscripten)

#Running

To run an example with the name example-name:

$ (cd examples/ && ./example-name)

which will set the working directory to example/ for applications that load assets via relative paths.

#License

All content in this repository is licensed under the Zero-Clause BSD license.

See LICENSE for more information.