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
|
2022-02-19 22:46:07 +00:00
|
|
|
CFLAGS += -std=c11 -Wall -Wextra -Wpedantic -Wmissing-prototypes
|
|
|
|
CFLAGS += ${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
|
|
|
|
2022-02-19 05:01:34 +00:00
|
|
|
TESTS += edit.t
|
|
|
|
|
|
|
|
dev: tags all check
|
2020-02-02 02:55:05 +00:00
|
|
|
|
|
|
|
all: catgirl
|
|
|
|
|
2020-02-01 06:18:01 +00:00
|
|
|
catgirl: ${OBJS}
|
|
|
|
${CC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@
|
|
|
|
|
2022-02-19 05:01:34 +00:00
|
|
|
${OBJS} ${TESTS}: chat.h edit.h
|
|
|
|
|
|
|
|
check: ${TESTS}
|
|
|
|
|
|
|
|
.SUFFIXES: .t
|
|
|
|
|
|
|
|
.c.t:
|
|
|
|
${CC} ${CFLAGS} -DTEST ${LDFLAGS} $< ${LDLIBS} -o $@
|
|
|
|
./$@ || rm $@
|
2020-02-01 06:18:01 +00:00
|
|
|
|
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:
|
2022-02-19 05:01:34 +00:00
|
|
|
rm -f catgirl ${OBJS} ${TESTS} 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
|
|
|
|
|
|
|
CHROOT_USER = chat
|
|
|
|
CHROOT_GROUP = ${CHROOT_USER}
|
|
|
|
|
|
|
|
chroot.tar: catgirl catgirl.1 scripts/chroot-prompt.sh scripts/chroot-man.sh
|
2021-09-27 19:16:45 +00:00
|
|
|
chroot.tar: scripts/build-chroot.sh
|
|
|
|
sh scripts/build-chroot.sh ${CHROOT_USER} ${CHROOT_GROUP}
|
2020-02-12 03:07:01 +00:00
|
|
|
|
|
|
|
install-chroot: chroot.tar
|
2021-09-27 19:16:45 +00:00
|
|
|
tar -px -f chroot.tar -C /home/${CHROOT_USER}
|
2020-02-12 03:07:01 +00:00
|
|
|
|
|
|
|
clean-chroot:
|
|
|
|
rm -fr chroot.tar root
|