Zernit/Makefile

44 lines
1.2 KiB
Makefile
Raw Normal View History

2020-01-18 12:43:35 +01:00
# FIXME: in-code docs needed
2020-02-05 10:06:21 +01:00
# FIXME: Windows doesn't support makefiles natively -> if you have a better method then please MR it or make an issue
## Syntax capture ##
2020-01-12 01:57:48 +01:00
all:
2020-02-05 10:06:21 +01:00
@ printf '%s\n' "Unknown option '$1' parsed in target all"
@ exit 2
## BUILD ##
# All build targets are expected in 'build/build-LANG' where 'LANG' is the unique identifier of the language used
# FIXME: Build in '$repodir/build/build-rustlang' instead of '$repodir/target' for multilang support
build-rustlang:
@ cargo build
2020-02-05 10:06:21 +01:00
# FIXME: Replace 'exit 1' with helpful messages
build-gcc:
@ # Make a build directory
@ [ ! -d build ] && { mkdir build || exit 1 ;}
@ [ ! -d build/target-gcc ] && { mkdir build/build-gcc || exit 1 ;}
2020-01-18 12:43:35 +01:00
2020-02-05 10:06:21 +01:00
@ # Compilation
@ [ ! -f build/build-gcc ] && { gcc src/bin/main.c -o build/build-gcc/gcc-zernit || exit 1 ;}
@ printf '%s\n' "Compilation of target for gcc finished"
2020-02-05 10:06:21 +01:00
build-clang:
@ printf 'FIXME: %s\n' "translate zernit in clang"
@ exit 1
2020-01-18 12:43:35 +01:00
2020-02-05 10:06:21 +01:00
build-brainfuck:
@ printf 'FIXME: %s\n' "translate zernit in brainfuck"
@ exit 1
2020-02-05 10:06:21 +01:00
build-python:
@ printf 'FIXME: %s\n' "translate zernit in python"
@ exit 1
2020-01-18 12:43:35 +01:00
2020-02-05 10:06:21 +01:00
## CLEAN ##
2020-01-18 12:43:35 +01:00
2020-02-05 10:06:21 +01:00
clean:
@ [ -d build ] && { rm -r build || exit 1 ;}
@ printf '%s\n' "Build directory has been cleaned"