This repository has been archived on 2024-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
probotic/Makefile
2023-08-02 09:24:50 -06:00

45 lines
822 B
Makefile

# 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}
.endif
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}