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:09:34 -06:00

45 lines
843 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 creds_parser.c
OBJ := fetch.o main.o creds_parser.o
HDR := config.h utils.h creds_parser.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}