hibot/Makefile

39 lines
876 B
Makefile
Raw Permalink Normal View History

2023-12-15 17:45:27 -05:00
.PHONY: clean run test
WRAP := valgrind --track-origins=yes --leak-check=full --show-leak-kinds=all
CFLAGS += -fno-builtin -I/usr/include/libircclient/
ifeq ($(DEBUG), 1)
CFLAGS += -Wall -Wextra -Wpedantic
CFLAGS += -DDEBUG -O0 -ggdb -fno-inline
else
2023-12-17 16:20:43 -05:00
CFLAGS += -O3 -fno-stack-protector
2023-12-15 17:45:27 -05:00
endif
LDLIBS := -lircclient
2023-12-17 06:49:56 -05:00
INSTALL_TARGET := /etc/init.d/hibot
2023-12-15 17:45:27 -05:00
OUT := hibot
SOURCE.d := source/
SOURCE := main.c
SOURCE := $(addprefix ${SOURCE.d}, ${SOURCE})
HEADER := config.inc version.inc log.h bot.h syntax.h
2023-12-15 17:45:27 -05:00
HEADER := $(addprefix ${SOURCE.d}, ${HEADER})
${OUT}: ${SOURCE} ${HEADER}
2023-12-17 14:46:32 -05:00
${CC} ${CFLAGS} -o $@ ${SOURCE} ${LDLIBS}
2023-12-15 17:45:27 -05:00
2023-12-16 20:38:41 -05:00
run: ${OUT}
2023-12-17 14:44:35 -05:00
./${OUT} irc.rizon.net:6665 "#/g/test"
2023-12-15 17:45:27 -05:00
test: ${OUT}
${WRAP} ${OUT} irc.rizon.net:6665 "#/g/test"
2023-12-17 06:49:56 -05:00
install:
m4 script/hibot.m4 > ${INSTALL_TARGET}
2023-12-17 07:48:41 -05:00
chmod 755 ${INSTALL_TARGET}
2023-12-17 06:49:56 -05:00
2023-12-15 17:45:27 -05:00
clean:
-rm ${OUT}
2023-12-17 06:49:56 -05:00
-rm ${INSTALL_TARGET}