modal/makefile

27 lines
678 B
Makefile

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
.PHONY: all debug dest run test install uninstall format clean
all: dest bin/modal
dest:
@ mkdir -p bin
run: all
@ bin/modal test.modal
test: all
@ bin/modal -v
@ bin/modal test.modal
install: all
@ cp bin/modal ~/bin/
uninstall:
@ rm -f ~/bin/modal
format:
@ clang-format -i src/modal.c
clean:
@ rm -fr bin
bin/modal: src/modal.c
@ cc ${DEBUG_flags} ${CFLAGS} src/modal.c -o bin/modal