diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 65 |
1 files changed, 33 insertions, 32 deletions
diff --git a/Makefile b/Makefile index 48fc350..e08e8e3 100644 --- a/Makefile +++ b/Makefile @@ -3,13 +3,18 @@ BINDIR ?= ${PREFIX}/bin MANDIR ?= ${PREFIX}/man CEXTS = gnu-case-range gnu-conditional-omitted-operand -CFLAGS += -std=c11 -Wall -Wextra -Wpedantic ${CEXTS:%=-Wno-%} +CFLAGS += -std=c11 -Wall -Wextra -Wpedantic -Wmissing-prototypes +CFLAGS += ${CEXTS:%=-Wno-%} LDADD.libtls = -ltls LDADD.ncursesw = -lncursesw +BINS = catgirl +MANS = ${BINS:=.1} + -include config.mk LDLIBS = ${LDADD.libtls} ${LDADD.ncursesw} +LDLIBS.sandman = -framework Cocoa OBJS += buffer.o OBJS += chat.o @@ -19,55 +24,51 @@ OBJS += config.o OBJS += edit.o OBJS += filter.o OBJS += handle.o +OBJS += input.o OBJS += irc.o OBJS += log.o OBJS += ui.o OBJS += url.o +OBJS += window.o OBJS += xdg.o -dev: tags all +OBJS.sandman = sandman.o + +TESTS += edit.t -all: catgirl +dev: tags all check + +all: ${BINS} catgirl: ${OBJS} ${CC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@ ${OBJS}: chat.h -tags: *.[ch] - ctags -w *.[ch] - -clean: - rm -f catgirl ${OBJS} tags - -install: catgirl catgirl.1 - install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MANDIR}/man1 - install catgirl ${DESTDIR}${BINDIR} - install -m 644 catgirl.1 ${DESTDIR}${MANDIR}/man1 +edit.o edit.t input.o: edit.h -uninstall: - rm -f ${DESTDIR}${BINDIR}/catgirl ${DESTDIR}${MANDIR}/man1/catgirl.1 +sandman: ${OBJS.sandman} + ${CC} ${LDFLAGS} ${OBJS.$@} ${LDLIBS.$@} -o $@ -scripts/sandman: scripts/sandman.o - ${CC} ${LDFLAGS} scripts/sandman.o -framework Cocoa -o $@ +check: ${TESTS} -install-sandman: scripts/sandman scripts/sandman.1 - install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MANDIR}/man1 - install scripts/sandman ${DESTDIR}${BINDIR} - install -m 644 scripts/sandman.1 ${DESTDIR}${MANDIR}/man1 +.SUFFIXES: .t -uninstall-sandman: - rm -f ${DESTDIR}${BINDIR}/sandman ${DESTDIR}${MANDIR}/man1/sandman.1 +.c.t: + ${CC} ${CFLAGS} -DTEST ${LDFLAGS} $< ${LDLIBS} -o $@ + ./$@ || rm $@ -CHROOT_USER = chat -CHROOT_GROUP = ${CHROOT_USER} +tags: *.[ch] + ctags -w *.[ch] -chroot.tar: catgirl 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} +clean: + rm -f ${BINS} ${OBJS} ${OBJS.sandman} ${TESTS} tags -install-chroot: chroot.tar - tar -px -f chroot.tar -C /home/${CHROOT_USER} +install: ${BINS} ${MANS} + install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MANDIR}/man1 + install ${BINS} ${DESTDIR}${BINDIR} + install -m 644 ${MANS} ${DESTDIR}${MANDIR}/man1 -clean-chroot: - rm -fr chroot.tar root +uninstall: + rm -f ${BINS:%=${DESTDIR}${BINDIR}/%} + rm -f ${MANS:%=${DESTDIR}${MANDIR}/man1/%} |