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

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