catboy/Makefile

78 lines
1.5 KiB
Makefile
Raw Permalink Normal View History

PREFIX ?= /usr/local
BINDIR ?= ${PREFIX}/bin
MANDIR ?= ${PREFIX}/man
2020-02-09 20:02:47 +00:00
CEXTS = gnu-case-range gnu-conditional-omitted-operand
CFLAGS += -std=c11 -Wall -Wextra -Wpedantic -Wmissing-prototypes
CFLAGS += ${CEXTS:%=-Wno-%}
LDADD.libtls = -ltls
LDADD.ncursesw = -lncursesw
-include config.mk
2020-02-01 06:18:01 +00:00
LDLIBS = ${LDADD.libtls} ${LDADD.ncursesw}
OBJS += buffer.o
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
2021-01-16 18:30:59 +00:00
OBJS += filter.o
2020-02-01 06:18:01 +00:00
OBJS += handle.o
2022-02-20 01:20:19 +00:00
OBJS += input.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 += window.o
OBJS += xdg.o
2020-02-01 06:18:01 +00:00
TESTS += edit.t
dev: tags all check
2020-02-02 02:55:05 +00:00
all: catboy
2020-02-02 02:55:05 +00:00
catboy: ${OBJS}
2020-02-01 06:18:01 +00:00
${CC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@
2022-02-20 01:20:19 +00:00
${OBJS}: chat.h
edit.o edit.t input.o: edit.h
check: ${TESTS}
.SUFFIXES: .t
.c.t:
${CC} ${CFLAGS} -DTEST ${LDFLAGS} $< ${LDLIBS} -o $@
./$@ || rm $@
2020-02-01 06:18:01 +00:00
tags: *.[ch]
ctags -w *.[ch]
2020-02-02 02:55:05 +00:00
2020-02-01 06:18:01 +00:00
clean:
rm -f catboy ${OBJS} ${TESTS} tags
2020-02-09 20:02:47 +00:00
install: catboy catgirl.1
install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MANDIR}/man1
install catboy ${DESTDIR}${BINDIR}
install -m 644 catboy.1 ${DESTDIR}${MANDIR}/man1
2020-02-09 20:02:47 +00:00
uninstall:
rm -f ${DESTDIR}${BINDIR}/catboy ${DESTDIR}${MANDIR}/man1/catgirl.1
2020-02-12 03:07:01 +00:00
CHROOT_USER = chat
CHROOT_GROUP = ${CHROOT_USER}
chroot.tar: catboy catgirl.1 scripts/chroot-prompt.sh scripts/chroot-man.sh
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
tar -px -f chroot.tar -C /home/${CHROOT_USER}
2020-02-12 03:07:01 +00:00
clean-chroot:
rm -fr chroot.tar root