catboy/Makefile

94 lines
2.4 KiB
Makefile
Raw Normal View History

PREFIX ?= /usr/local
MANDIR ?= ${PREFIX}/share/man
2020-02-09 20:02:47 +00:00
CEXTS = gnu-case-range gnu-conditional-omitted-operand
CFLAGS += -std=c11 -Wall -Wextra -Wpedantic ${CEXTS:%=-Wno-%}
LDLIBS = -lncursesw -ltls
-include config.mk
2020-02-01 06:18:01 +00:00
OBJS += chat.o
OBJS += command.o
2020-02-08 02:30:25 +00:00
OBJS += complete.o
OBJS += config.o
OBJS += edit.o
2020-02-01 06:18:01 +00:00
OBJS += handle.o
2020-03-31 18:30:42 +00:00
OBJS += ignore.o
2020-02-01 06:18:01 +00:00
OBJS += irc.o
OBJS += log.o
OBJS += ui.o
2020-02-08 23:29:01 +00:00
OBJS += url.o
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
2020-02-02 02:55:05 +00:00
tags: *.h *.c
ctags -w *.h *.c
2020-02-01 06:18:01 +00:00
clean:
2020-02-02 02:55:05 +00:00
rm -f tags catgirl ${OBJS}
2020-02-09 20:02:47 +00:00
install: catgirl catgirl.1
install -d ${DESTDIR}${PREFIX}/bin ${DESTDIR}${MANDIR}/man1
install catgirl ${DESTDIR}${PREFIX}/bin
install -m 644 catgirl.1 ${DESTDIR}${MANDIR}/man1
2020-02-09 20:02:47 +00:00
uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/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
install -d ${DESTDIR}${PREFIX}/bin ${DESTDIR}${MANDIR}/man1
install scripts/sandman ${DESTDIR}${PREFIX}/bin
install -m 644 scripts/sandman.1 ${DESTDIR}${MANDIR}/man1
2020-02-13 02:31:09 +00:00
uninstall-sandman:
rm -f ${DESTDIR}${PREFIX}/bin/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
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
${MAKE} install DESTDIR=root PREFIX=/usr
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