IRC client
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 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. PREFIX = ~/.local
  2. MANDIR = $(PREFIX)/share/man/man
  3. CHROOT_USER = chat
  4. CHROOT_GROUP = $(CHROOT_USER)
  5. LIBRESSL_PREFIX = /usr/local
  6. CFLAGS += -std=c11 -Wall -Wextra -Wpedantic
  7. CFLAGS += -I$(LIBRESSL_PREFIX)/include
  8. LDFLAGS += -L$(LIBRESSL_PREFIX)/lib
  9. LDLIBS = -lcursesw -ltls
  10. BINS = catgirl
  11. MANS = catgirl.1
  12. -include config.mk
  13. OBJS += chat.o
  14. OBJS += edit.o
  15. OBJS += event.o
  16. OBJS += format.o
  17. OBJS += handle.o
  18. OBJS += input.o
  19. OBJS += irc.o
  20. OBJS += log.o
  21. OBJS += pls.o
  22. OBJS += tab.o
  23. OBJS += tag.o
  24. OBJS += term.o
  25. OBJS += ui.o
  26. OBJS += url.o
  27. TESTS += format.t
  28. TESTS += pls.t
  29. TESTS += term.t
  30. all: tags $(BINS) test
  31. $(OBJS): chat.h
  32. catgirl: $(OBJS)
  33. $(CC) $(LDFLAGS) $(OBJS) $(LDLIBS) -o $@
  34. .SUFFIXES: .t
  35. .c.t:
  36. $(CC) $(CFLAGS) -DTEST $(LDFLAGS) $< $(LDLIBS) -o $@
  37. test: $(TESTS)
  38. set -e; $(TESTS:%=./%;)
  39. tags: *.h *.c
  40. ctags -w *.h *.c
  41. install: $(BINS) $(MANS)
  42. install -d $(PREFIX)/bin $(MANDIR)1
  43. install $(BINS) $(PREFIX)/bin
  44. install -m 644 $(MANS) $(MANDIR)1
  45. uninstall:
  46. rm -f $(BINS:%=$(PREFIX)/bin/%)
  47. rm -f $(MAN:%=%(MANDIR)1/%)
  48. chroot.tar: catgirl catgirl.1 man.sh
  49. install -d -o root -g wheel \
  50. root \
  51. root/bin \
  52. root/etc \
  53. root/home \
  54. root/lib \
  55. root/libexec \
  56. root/usr/bin \
  57. root/usr/local/etc/ssl \
  58. root/usr/share/man \
  59. root/usr/share/misc
  60. install -d -o $(CHROOT_USER) -g $(CHROOT_GROUP) root/home/$(CHROOT_USER)
  61. cp -fp /libexec/ld-elf.so.1 root/libexec
  62. cp -fp \
  63. /lib/libc.so.7 \
  64. /lib/libncursesw.so.8 \
  65. /lib/libthr.so.3 \
  66. /lib/libz.so.6 \
  67. /usr/local/lib/libcrypto.so.43 \
  68. /usr/local/lib/libssl.so.45 \
  69. /usr/local/lib/libtls.so.17 \
  70. root/lib
  71. cp -fp /etc/hosts /etc/resolv.conf root/etc
  72. cp -fp /usr/local/etc/ssl/cert.pem root/usr/local/etc/ssl
  73. cp -af /usr/share/locale root/usr/share
  74. cp -fp /usr/share/misc/termcap.db root/usr/share/misc
  75. cp -fp /rescue/sh /usr/bin/mandoc /usr/bin/less root/bin
  76. $(MAKE) install PREFIX=root/usr
  77. install man.sh root/usr/bin/man
  78. tar -cf chroot.tar -C root bin etc home lib libexec usr
  79. install-chroot: chroot.tar
  80. tar -xf chroot.tar -C /home/$(CHROOT_USER)
  81. clean:
  82. rm -fr $(OBJS) $(BINS) $(TESTS) tags root chroot.tar
  83. README: catgirl.7
  84. mandoc catgirl.7 | col -bx > README