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

48 lines
932 B
Makefile
Raw Normal View History

2023-08-04 11:13:47 -04:00
# note that this file does not properly handle options
2023-08-06 22:51:57 -04:00
PROGN:=probotic
CFLAGS:=-std=c99 -Wall -Wextra -Wpedantic -Wvla -Wshadow -Wundef
2023-08-07 07:13:13 -04:00
CPPFLAGS:=-I./lib/libircclient/include/ -Iinclude -D_GNU_SOURCE -DPROGN=\"${PROGN}\" -D_FORTIFY_SOURCE=2
2023-08-06 22:51:57 -04:00
2023-08-07 07:13:13 -04:00
LDLIBS:=-lsqlite3
LIB:=./lib/libircclient/src/libircclient.o
2023-08-06 22:51:57 -04:00
2023-08-04 11:13:47 -04:00
SRC := api.c irc.c main.c parse.c unity.c
HDR := api.h error.h irc.h irccolors.h parse.h stmt.h
2023-08-06 22:51:57 -04:00
ifeq (${DEBUG},1)
CFLAGS += -Og -ggdb
else
CFLAGS += -O3 -flto=auto -fomit-frame-pointer
endif
ifdef SAN
CFLAGS += -fsanitize=${SAN}
endif
2023-08-07 07:13:13 -04:00
ifeq (${NO_VULN},1)
2023-08-06 22:51:57 -04:00
CPPFLAGS += -DNO_VULN_COMMANDS
endif
2023-08-07 07:13:13 -04:00
ifeq (${ENABLE_SSL},1)
LDLIBS += -lssl -lcrypto
CPPFLAGS += -DIRC_SSL_SUPPORT
endif
all: ${PROGN}
2023-08-06 22:51:57 -04:00
${PROGN}: ${HDR} ${SRC}
2023-08-07 07:13:13 -04:00
${LINK.c} -pipe ${LIB} src/unity.c -o $@ ${LDLIBS}
2023-08-04 11:13:47 -04:00
# do nothing but update them...
$(SRC) $(HDR):
2023-08-06 22:51:57 -04:00
2023-08-07 07:13:13 -04:00
submodules:
git submodule update --init --recursive
2023-08-06 22:51:57 -04:00
clean:
-rm ${OBJ}
2023-08-07 07:13:13 -04:00
.PHONY: submodules clean