Added features to makefile

This commit is contained in:
Emil 2023-08-04 13:17:55 -06:00
parent d990460011
commit ffb9b1d9d8

View File

@ -1,6 +1,7 @@
# CC=gcc
CFLAGS:=-Wall -Wextra -Wpedantic -ggdb $(shell pkg-config --cflags ncurses readline)
LDLIBS=-I ${CHDRD} $(shell pkg-config --libs ncurses readline)
CFLAGS:=-Wall -Wextra -Wpedantic
CPPFLAGS:=-D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600
LDLIBS=-I ${CHDRD} -lncurses -ltinfo -lreadline
LEX:=flex
LEXD:=src/
@ -19,6 +20,16 @@ CHDR:=$(addsuffix .gch,$(subst ${HDRD},${CHDRD},${HDR}))
OUTPUT:=csope
ifeq (${DEBUG},1)
CFLAGS += -Og -ggdb
else
CFLAGS += -O3 -flto=auto -fomit-frame-pointer
endif
ifdef SAN
CFLAGS += -fsanitize=${SAN}
endif
main: ${CHDR} ${OBJ}
${LINK.c} ${OBJ} -o ${OUTPUT} ${LDLIBS}