49 lines
977 B
Makefile
49 lines
977 B
Makefile
# OVERRIDE ME #
|
|
PROGN := probotic
|
|
|
|
CC := cc
|
|
CFLAGS := -std=c99 -Wall -Wextra -Wpedantic
|
|
CPPFLAGS := -I/usr/bin/ircclient/
|
|
LDFLAGS := -lircclient
|
|
|
|
SRC.DIR := src
|
|
OBJ.DIR := obj
|
|
# INC.DIR := include
|
|
|
|
SRC := fetch.c main.c
|
|
OBJ := ${OBJ.DIR}/fetch.o ${OBJ.DIR}/main.o
|
|
# HDR :=
|
|
|
|
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}\""
|
|
|
|
all: ${PROGN}
|
|
|
|
${PROGN}: ${OBJ.DIR} ${PREFIX} ${HDR} ${OBJ}
|
|
${CC} ${CFLAGS} ${CPPFLAGS} -o $@ ${OBJ} ${LDFLAGS}
|
|
|
|
${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 $< $@
|
|
|
|
${OBJ.DIR} ${PREFIX}:
|
|
mkdir -p $@
|
|
|
|
clean:
|
|
${RM} ${OBJ} ${PROGN}
|