2020-05-27 16:01:49 +00:00
|
|
|
PREFIX ?= /usr/local
|
2021-05-04 16:09:46 +00:00
|
|
|
BINDIR ?= ${PREFIX}/bin
|
|
|
|
MANDIR ?= ${PREFIX}/man
|
2020-02-09 20:02:47 +00:00
|
|
|
|
2020-04-03 21:10:52 +00:00
|
|
|
CEXTS = gnu-case-range gnu-conditional-omitted-operand
|
|
|
|
CFLAGS += -std=c11 -Wall -Wextra -Wpedantic ${CEXTS:%=-Wno-%}
|
2021-05-04 16:09:46 +00:00
|
|
|
LDADD.libtls = -ltls
|
|
|
|
LDADD.ncursesw = -lncursesw
|
2020-02-07 04:49:27 +00:00
|
|
|
|
|
|
|
-include config.mk
|
2020-02-01 06:18:01 +00:00
|
|
|
|
2021-05-04 16:09:46 +00:00
|
|
|
LDLIBS = ${LDADD.libtls} ${LDADD.ncursesw}
|
|
|
|
|
2020-09-02 00:35:17 +00:00
|
|
|
OBJS += buffer.o
|
2020-02-01 06:18:01 +00:00
|
|
|
OBJS += chat.o
|
2020-02-05 05:20:39 +00:00
|
|
|
OBJS += command.o
|
2020-02-08 02:30:25 +00:00
|
|
|
OBJS += complete.o
|
2020-02-06 03:49:56 +00:00
|
|
|
OBJS += config.o
|
2020-02-05 01:23:55 +00:00
|
|
|
OBJS += edit.o
|
2021-01-16 18:30:59 +00:00
|
|
|
OBJS += filter.o
|
2020-02-01 06:18:01 +00:00
|
|
|
OBJS += handle.o
|
|
|
|
OBJS += irc.o
|
2020-03-25 22:56:09 +00:00
|
|
|
OBJS += log.o
|
2020-02-02 00:37:48 +00:00
|
|
|
OBJS += ui.o
|
2020-02-08 23:29:01 +00:00
|
|
|
OBJS += url.o
|
2020-02-11 00:57:10 +00:00
|
|
|
OBJS += xdg.o
|
2020-02-01 06:18:01 +00:00
|
|
|
|
2020-02-02 02:55:05 +00:00
|
|
|
dev: tags all
|
|
|
|
|
|
|
|
all: catgirl
|
|
|
|
|
2020-02-01 06:18:01 +00:00
|
|
|
catgirl: ${OBJS}
|
|
|
|
${CC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@
|
|
|
|
|
|
|
|
${OBJS}: chat.h
|
|
|
|
|
2021-05-04 16:09:46 +00:00
|
|
|
tags: *.[ch]
|
|
|
|
ctags -w *.[ch]
|
2020-02-02 02:55:05 +00:00
|
|
|
|
2020-02-01 06:18:01 +00:00
|
|
|
clean:
|
2021-05-04 16:09:46 +00:00
|
|
|
rm -f catgirl ${OBJS} tags
|
2020-02-09 20:02:47 +00:00
|
|
|
|
|
|
|
install: catgirl catgirl.1
|
2021-05-04 16:09:46 +00:00
|
|
|
install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MANDIR}/man1
|
|
|
|
install catgirl ${DESTDIR}${BINDIR}
|
2020-05-23 18:12:07 +00:00
|
|
|
install -m 644 catgirl.1 ${DESTDIR}${MANDIR}/man1
|
2020-02-09 20:02:47 +00:00
|
|
|
|
|
|
|
uninstall:
|
2021-05-04 16:09:46 +00:00
|
|
|
rm -f ${DESTDIR}${BINDIR}/catgirl ${DESTDIR}${MANDIR}/man1/catgirl.1
|
2020-02-12 03:07:01 +00:00
|
|
|
|
2020-02-13 02:31:09 +00:00
|
|
|
scripts/sandman: scripts/sandman.o
|
|
|
|
${CC} ${LDFLAGS} scripts/sandman.o -framework Cocoa -o $@
|
|
|
|
|
|
|
|
install-sandman: scripts/sandman scripts/sandman.1
|
2021-05-04 16:09:46 +00:00
|
|
|
install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MANDIR}/man1
|
|
|
|
install scripts/sandman ${DESTDIR}${BINDIR}
|
2020-05-23 18:12:07 +00:00
|
|
|
install -m 644 scripts/sandman.1 ${DESTDIR}${MANDIR}/man1
|
2020-02-13 02:31:09 +00:00
|
|
|
|
|
|
|
uninstall-sandman:
|
2021-05-04 16:09:46 +00:00
|
|
|
rm -f ${DESTDIR}${BINDIR}/sandman ${DESTDIR}${MANDIR}/man1/sandman.1
|
2020-02-13 02:31:09 +00:00
|
|
|
|
2020-02-12 03:07:01 +00:00
|
|
|
CHROOT_USER = chat
|
|
|
|
CHROOT_GROUP = ${CHROOT_USER}
|
|
|
|
|
|
|
|
chroot.tar: catgirl catgirl.1 scripts/chroot-prompt.sh scripts/chroot-man.sh
|
|
|
|
install -d -o root -g wheel \
|
|
|
|
root \
|
|
|
|
root/bin \
|
2020-07-31 17:04:33 +00:00
|
|
|
root/etc \
|
2020-02-12 03:07:01 +00:00
|
|
|
root/home \
|
|
|
|
root/lib \
|
|
|
|
root/libexec \
|
|
|
|
root/usr/bin \
|
2020-07-31 17:04:33 +00:00
|
|
|
root/usr/local/etc/ssl \
|
2020-02-12 03:07:01 +00:00
|
|
|
root/usr/share/man \
|
|
|
|
root/usr/share/misc
|
|
|
|
install -d -o ${CHROOT_USER} -g ${CHROOT_GROUP} \
|
|
|
|
root/home/${CHROOT_USER} \
|
|
|
|
root/home/${CHROOT_USER}/.local/share
|
|
|
|
cp -fp /libexec/ld-elf.so.1 root/libexec
|
2020-07-31 17:04:48 +00:00
|
|
|
ldd -f '%p\n' catgirl /usr/bin/mandoc /usr/bin/less \
|
|
|
|
| sort -u | xargs -t -J % cp -fp % root/lib
|
2020-02-12 03:07:01 +00:00
|
|
|
chflags noschg root/libexec/* root/lib/*
|
|
|
|
cp -fp /etc/hosts /etc/resolv.conf root/etc
|
2020-07-31 17:04:33 +00:00
|
|
|
cp -fp /usr/local/etc/ssl/cert.pem root/usr/local/etc/ssl
|
2020-02-12 03:07:01 +00:00
|
|
|
cp -af /usr/share/locale root/usr/share
|
|
|
|
cp -fp /usr/share/misc/termcap.db root/usr/share/misc
|
|
|
|
cp -fp /rescue/sh /usr/bin/mandoc /usr/bin/less root/bin
|
2021-06-25 15:51:52 +00:00
|
|
|
${MAKE} install DESTDIR=root PREFIX=/usr MANDIR=/usr/share/man
|
2020-02-12 03:07:01 +00:00
|
|
|
install scripts/chroot-prompt.sh root/usr/bin/catgirl-prompt
|
|
|
|
install scripts/chroot-man.sh root/usr/bin/man
|
|
|
|
tar -c -f chroot.tar -C root bin etc home lib libexec usr
|
|
|
|
|
|
|
|
install-chroot: chroot.tar
|
|
|
|
tar -x -f chroot.tar -C /home/${CHROOT_USER}
|
|
|
|
|
|
|
|
clean-chroot:
|
|
|
|
rm -fr chroot.tar root
|