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

49 lines
977 B
Makefile
Raw Normal View History

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