60 lines
1.1 KiB
Makefile
60 lines
1.1 KiB
Makefile
# note that this file does not properly handle options
|
|
|
|
|
|
PROGN:=probotic
|
|
|
|
CFLAGS:=-std=c99 -Wall -Wextra -Wpedantic -Wvla -Wshadow -Wundef
|
|
CPPFLAGS:=-I./lib/libircclient/include/ -Iinclude -D_GNU_SOURCE -DPROGN=\"${PROGN}\" -D_FORTIFY_SOURCE=2
|
|
|
|
LDLIBS:=-lsqlite3
|
|
LIB:=./lib/libircclient/src/libircclient.o
|
|
|
|
SRC := api.c irc.c main.c parse.c unity.c
|
|
HDR := config.h api.h error.h irc.h irccolors.h parse.h stmt.h
|
|
|
|
VPATH := src include
|
|
|
|
ifeq (${DEBUG},1)
|
|
CFLAGS += -Og -ggdb
|
|
else
|
|
CFLAGS += -O3 -flto=auto -fomit-frame-pointer
|
|
endif
|
|
|
|
ifdef SAN
|
|
CFLAGS += -fsanitize=${SAN}
|
|
endif
|
|
|
|
ifeq (${NO_VULN},1)
|
|
CPPFLAGS += -DNO_VULN_COMMANDS
|
|
endif
|
|
|
|
ifeq (${ENABLE_SSL},1)
|
|
LDLIBS += -lssl -lcrypto
|
|
CPPFLAGS += -DIRC_SSL_SUPPORT
|
|
endif
|
|
|
|
all: include/config.h ${PROGN}
|
|
|
|
${PROGN}: ${HDR} ${SRC}
|
|
${LINK.c} -pipe ${LIB} src/unity.c -o $@ ${LDLIBS}
|
|
|
|
# do nothing but update them...
|
|
${SRC} ${HDR}:
|
|
|
|
submodules:
|
|
git submodule update --init --recursive
|
|
|
|
include/config.h: config.mk.h
|
|
cp -f $< $@
|
|
|
|
clean:
|
|
-rm ${OBJ}
|
|
|
|
help:
|
|
@echo "Targets:"
|
|
@echo " all (default)"
|
|
@echo " submodules"
|
|
@echo " clean"
|
|
|
|
.PHONY: all submodules clean help
|