# OVERRIDE ME #
PROGN := probotic
CC := cc
CFLAGS := -std=c99 -Wall -Wextra -Wpedantic
CPPFLAGS := -I/usr/bin/ircclient/ -Iinclude
LDFLAGS := -lircclient
SRC.DIR := src
OBJ.DIR := obj
INC.DIR := include
SRC := fetch.c main.c parse.c
OBJ := fetch.o main.o parse.o
HDR := config.h utils.h parse.h
VPATH := ${INC.DIR}:${SRC.DIR}:${OBJ.DIR}
.if "${DEBUG}" == "1"
CFLAGS := ${CFLAGS} -Og -g3
.else
CFLAGS := ${CFLAGS} -O3 -flto=auto -fomit-frame-pointer
.endif
.ifdef SAN
CFLAGS := ${CFLAGS} -fsanitize=${SAN}
CPPFLAGS := ${CPPFLAGS} -DPROGN="\"${PROGN}\""
.c.o:
${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<
${PROGN}: ${OBJ.DIR} ${HDR} ${OBJ}
${CC} ${CFLAGS} ${CPPFLAGS} -o $@ ${OBJ} ${LDFLAGS}
include/config.h: include/config.mk.h
cp -f $< $@
${OBJ.DIR}:
mkdir -p $@
clean:
${RM} ${OBJ} ${PROGN}