IRC bouncer
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.

Makefile 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. PREFIX = /usr/local
  2. MANDIR = ${PREFIX}/man
  3. ETCDIR = ${PREFIX}/etc
  4. LIBRESSL_PREFIX = /usr/local
  5. CFLAGS += -std=c11 -Wall -Wextra -Wpedantic
  6. CFLAGS += ${LIBRESSL_PREFIX:%=-I%/include}
  7. LDFLAGS += ${LIBRESSL_PREFIX:%=-L%/lib}
  8. LDLIBS = -lcrypt -lcrypto -ltls
  9. BINS = calico pounce
  10. MANS = ${BINS:=.1}
  11. RCS = ${BINS:%=rc.d/%}
  12. DIRS = ${ETCDIR}/pounce /var/run/calico
  13. -include config.mk
  14. OBJS += bounce.o
  15. OBJS += client.o
  16. OBJS += config.o
  17. OBJS += local.o
  18. OBJS += ring.o
  19. OBJS += server.o
  20. OBJS += state.o
  21. dev: tags all
  22. all: ${BINS}
  23. calico: dispatch.o
  24. ${CC} ${LDFLAGS} dispatch.o -o $@
  25. pounce: ${OBJS}
  26. ${CC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@
  27. ${OBJS}: bounce.h compat.h
  28. dispatch.o: compat.h
  29. tags: *.c *.h
  30. ctags -w *.c *.h
  31. clean:
  32. rm -f tags ${BINS} ${OBJS} dispatch.o
  33. install: ${BINS} ${MANS} ${RCS}
  34. install -d ${PREFIX}/bin ${MANDIR}/man1 ${ETCDIR}/rc.d
  35. install ${BINS} ${PREFIX}/bin
  36. install -m 644 ${MANS} ${MANDIR}/man1
  37. if [ -n '${RCS}' ]; then install -d ${ETCDIR}/rc.d; fi
  38. if [ -n '${RCS}' ]; then install ${RCS} ${ETCDIR}/rc.d; fi
  39. if [ -n '${DIRS}' ]; then install -d ${DIRS}; fi
  40. uninstall:
  41. rm -f ${BINS:%=${PREFIX}/bin/%}
  42. rm -f ${MANS:%=${MANDIR}/man1/%}
  43. if [ -n '${RCS}' ]; then rm -f ${RCS:%=${ETCDIR}/%}; fi
  44. if [ -n '${DIRS}' ]; then rmdir ${DIRS}; fi
  45. localhost.crt:
  46. printf "[dn]\nCN=localhost\n[req]\ndistinguished_name=dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth" \
  47. | openssl req -x509 -out localhost.crt -keyout localhost.key \
  48. -newkey rsa:2048 -nodes -sha256 \
  49. -subj '/CN=localhost' -extensions EXT -config /dev/fd/0