catgirl/Makefile

104 lines
2.1 KiB
Makefile
Raw Normal View History

2018-08-20 19:44:57 +00:00
PREFIX = ~/.local
2019-07-27 22:05:06 +00:00
MANDIR = ${PREFIX}/share/man
2018-08-13 23:27:22 +00:00
CHROOT_USER = chat
2019-07-27 22:05:06 +00:00
CHROOT_GROUP = ${CHROOT_USER}
LIBRESSL_PREFIX = /usr/local
2018-08-13 23:27:22 +00:00
CFLAGS += -std=c11 -Wall -Wextra -Wpedantic
2019-07-27 22:05:06 +00:00
CFLAGS += -I${LIBRESSL_PREFIX}/include
LDFLAGS += -L${LIBRESSL_PREFIX}/lib
2018-08-03 17:36:41 +00:00
LDLIBS = -lcursesw -ltls
2018-08-13 23:27:22 +00:00
2018-11-30 20:41:21 +00:00
BINS = catgirl
2019-07-27 22:05:06 +00:00
MANS = catgirl.1
2018-11-30 20:41:21 +00:00
-include config.mk
OBJS += chat.o
2019-02-26 04:10:40 +00:00
OBJS += color.o
OBJS += edit.o
2018-09-06 04:41:06 +00:00
OBJS += event.o
2018-09-13 00:23:45 +00:00
OBJS += format.o
OBJS += handle.o
OBJS += input.o
OBJS += irc.o
OBJS += log.o
OBJS += pls.o
OBJS += tab.o
OBJS += tag.o
OBJS += term.o
OBJS += ui.o
OBJS += url.o
TESTS += format.t
2018-12-16 21:57:43 +00:00
TESTS += pls.t
2018-09-14 23:41:48 +00:00
TESTS += term.t
2019-07-27 22:05:06 +00:00
all: tags ${BINS} test
2019-07-27 22:05:06 +00:00
catgirl: ${OBJS}
${CC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@
2019-07-27 22:05:06 +00:00
${OBJS}: chat.h
2019-01-25 01:42:27 +00:00
2019-07-27 22:05:06 +00:00
test: ${TESTS}
set -e; ${TESTS:%=./%;}
2019-01-25 01:42:27 +00:00
.SUFFIXES: .t
.c.t:
2019-07-27 22:05:06 +00:00
${CC} ${CFLAGS} -DTEST ${LDFLAGS} $< ${LDLIBS} -o $@
2019-01-25 01:42:27 +00:00
tags: *.c *.h
ctags -w *.c *.h
2019-07-27 22:05:06 +00:00
install: ${BINS} ${MANS}
install -d ${PREFIX}/bin ${MANDIR}/man1
install ${BINS} ${PREFIX}/bin
install -m 644 ${MANS} ${MANDIR}/man1
2018-09-10 20:18:36 +00:00
uninstall:
2019-07-27 22:05:06 +00:00
rm -f ${BINS:%=${PREFIX}/bin/%}
rm -f ${MANS:%=${MANDIR}/man1/%}
2018-09-10 20:18:36 +00:00
chroot.tar: catgirl catgirl.1 man.sh
2018-08-03 02:02:59 +00:00
install -d -o root -g wheel \
2018-09-10 21:44:23 +00:00
root \
2018-08-03 02:02:59 +00:00
root/bin \
root/etc \
root/home \
root/lib \
root/libexec \
2018-09-10 21:44:23 +00:00
root/usr/bin \
2018-08-03 02:02:59 +00:00
root/usr/local/etc/ssl \
2018-09-10 21:44:23 +00:00
root/usr/share/man \
2018-08-03 02:02:59 +00:00
root/usr/share/misc
2019-07-27 22:05:06 +00:00
install -d -o ${CHROOT_USER} -g ${CHROOT_GROUP} root/home/${CHROOT_USER}
cp -fp /libexec/ld-elf.so.1 root/libexec
cp -fp \
2018-08-03 02:02:59 +00:00
/lib/libc.so.7 \
/lib/libncursesw.so.8 \
/lib/libthr.so.3 \
2018-09-10 21:44:23 +00:00
/lib/libz.so.6 \
2019-01-18 02:29:54 +00:00
/usr/local/lib/libcrypto.so.44 \
/usr/local/lib/libssl.so.46 \
/usr/local/lib/libtls.so.18 \
2018-08-03 02:02:59 +00:00
root/lib
cp -fp /etc/hosts /etc/resolv.conf root/etc
cp -fp /usr/local/etc/ssl/cert.pem root/usr/local/etc/ssl
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
2019-07-27 22:05:06 +00:00
${MAKE} install PREFIX=root/usr
2018-09-10 21:44:23 +00:00
install man.sh root/usr/bin/man
2019-01-25 01:46:33 +00:00
tar -c -f chroot.tar -C root bin etc home lib libexec usr
install-chroot: chroot.tar
2019-07-27 22:05:06 +00:00
tar -x -f chroot.tar -C /home/${CHROOT_USER}
2018-08-03 02:02:59 +00:00
clean:
2019-07-27 22:05:06 +00:00
rm -fr ${BINS} ${OBJS} ${TESTS} tags root chroot.tar
2018-09-16 02:22:51 +00:00
README: catgirl.7
mandoc catgirl.7 | col -bx > README