2024-04-04 12:04:27 -04:00
|
|
|
RELEASE_flags=-DNDEBUG -O2 -g0 -s
|
|
|
|
DEBUG_flags=-std=c89 -D_POSIX_C_SOURCE=199309L -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined
|
|
|
|
|
2024-04-05 13:34:46 -04:00
|
|
|
.PHONY: all debug dest run test install uninstall format clean archive
|
2024-04-04 12:04:27 -04:00
|
|
|
|
2024-04-08 18:47:58 -04:00
|
|
|
all: dest
|
2024-04-04 12:04:27 -04:00
|
|
|
|
|
|
|
dest:
|
|
|
|
@ mkdir -p bin
|
2024-04-08 19:04:31 -04:00
|
|
|
run: all bin/modal
|
2024-04-08 18:47:58 -04:00
|
|
|
@ bin/modal examples/hello.modal 2> /dev/null
|
2024-04-09 11:56:25 -04:00
|
|
|
@ bin/modal examples/test.modal
|
2024-04-08 19:04:31 -04:00
|
|
|
test: bin/modal-debug bin/modal
|
2024-04-08 18:47:58 -04:00
|
|
|
@ bin/modal -v
|
2024-04-08 19:04:31 -04:00
|
|
|
@ bin/modal-debug examples/test.modal "(arg1) (arg2 (arg3))"
|
2024-04-08 19:23:21 -04:00
|
|
|
@ time bin/modal examples/test.modal "(arg1) (arg2 (arg3))"
|
2024-04-08 18:47:58 -04:00
|
|
|
install: bin/modal
|
2024-04-05 13:34:46 -04:00
|
|
|
cp bin/modal ~/bin/
|
2024-04-04 12:04:27 -04:00
|
|
|
uninstall:
|
2024-04-05 13:34:46 -04:00
|
|
|
rm -f ~/bin/modal
|
2024-04-04 12:04:27 -04:00
|
|
|
format:
|
|
|
|
@ clang-format -i src/modal.c
|
|
|
|
clean:
|
2024-04-05 13:34:46 -04:00
|
|
|
rm -fr bin
|
|
|
|
archive: all
|
|
|
|
cp src/modal.c ../oscean/etc/modal.c.txt
|
2024-04-04 12:04:27 -04:00
|
|
|
|
2024-04-08 18:47:58 -04:00
|
|
|
bin/modal-debug: src/modal.c
|
|
|
|
@ cc ${DEBUG_flags} src/modal.c -o bin/modal-debug
|
2024-04-04 12:04:27 -04:00
|
|
|
bin/modal: src/modal.c
|
2024-04-08 19:04:31 -04:00
|
|
|
@ cc ${RELEASE_flags} src/modal.c -o bin/modal
|
2024-04-04 12:04:27 -04:00
|
|
|
|