diff options
author | WormHeamer | 2025-03-08 16:45:17 -0500 |
---|---|---|
committer | WormHeamer | 2025-03-08 16:45:17 -0500 |
commit | 4af753d591e61a7380735e03a8658fb8949e0448 (patch) | |
tree | ae92949580512dadecd26b8c3a359f2bd7755d58 /Makefile |
initial commit
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..50fd1dc --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +EXE = wdoc +RUNARGS = + +CFLAGS = -std=c17 -Wall -Wextra -Wpedantic -Os ${CFLAGS_${DEBUG}} +LDFLAGS = -flto ${LDFLAGS_${DEBUG}} +PREFIX = /usr/local/ +LDLIBS = + +DEBUG = 0 +GDB != which gf2 2> /dev/null || which gdb + +CFLAGS_1 = -g -fsanitize=undefined +LDFLAGS_1 = -g -fsanitize=undefined +LDFLAGS_0 = -s + +OBJ != find -type f -name '*.c' | sed 's/\.c$$/.o/' + +.PHONY: run all clean + +all: ${EXE} +run: ${EXE} + ./${EXE} ${RUNARGS} +debug: ${EXE} + ${GDB} -ex start --args ./${EXE} ${RUNARGS} + +clean: + rm -fv ${EXE} ${OBJ} + +${EXE}: ${OBJ} + ${CC} ${LDFLAGS} ${OBJ} -o ${EXE} ${LDLIBS} |