Probiotics (in bot form) for programming.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

Makefile 1.1KB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. PROGN:=probotic
  2. USER := probotic
  3. PREFIX = /opt/${USER}/
  4. CFLAGS:=-std=c99 -Wall -Wextra -Wpedantic -Wvla -Wshadow -Wundef
  5. CPPFLAGS:=-I./lib/libircclient/include/ -Iinclude -D_GNU_SOURCE -DPROGN=\"${PROGN}\" -D_FORTIFY_SOURCE=2
  6. LDLIBS:=-lsqlite3
  7. LIB:=./lib/libircclient/src/libircclient.o
  8. SRC := api.c irc.c main.c parse.c unity.c
  9. HDR := config.h api.h error.h irc.h irccolors.h parse.h stmt.h
  10. VPATH := src include
  11. ifeq (${DEBUG},1)
  12. CFLAGS += -Og -ggdb
  13. else
  14. CFLAGS += -O3 -flto=auto -fomit-frame-pointer
  15. endif
  16. ifdef SAN
  17. CFLAGS += -fsanitize=${SAN}
  18. endif
  19. ifeq (${ENABLE_SSL},1)
  20. LDLIBS += -lssl -lcrypto
  21. endif
  22. ${PROGN}: include/config.h ${HDR} ${SRC}
  23. ${LINK.c} -pipe ${LIB} src/unity.c -o $@ ${LDLIBS}
  24. # do nothing but update them...
  25. ${SRC} ${HDR}:
  26. include/config.h: config.mk.h
  27. cp -f $< $@
  28. clean:
  29. -rm ${OBJ}
  30. ${PREFIX}:
  31. mkdir $@
  32. bootstrap:
  33. make -C bootstrap
  34. install: bootstrap ${PREFIX}
  35. useradd ${USER} -r -s /sbin/nologin -d ${PREFIX} || true
  36. install -v -g ${USER} -o ${USER} -m 744 ./bootstrap/data.sqlite ${PROGN} ${PREFIX}
  37. chown ${USER}:${USER} ${PREFIX} -R
  38. uninstall:
  39. userdel -rf ${USER}
  40. .PHONY: clean bootstrap install uninstall