diff options
Diffstat (limited to 'bin/Makefile')
-rw-r--r-- | bin/Makefile | 185 |
1 files changed, 71 insertions, 114 deletions
diff --git a/bin/Makefile b/bin/Makefile index d37aeb1b..bb1535d6 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -1,32 +1,22 @@ -PREFIX = ~/.local -MANDIR = ${PREFIX}/share/man +PREFIX ?= ~/.local +MANDIR ?= ${PREFIX}/share/man -LIBS_PREFIX = /usr/local +LIBS_PREFIX ?= /usr/local CFLAGS += -I${LIBS_PREFIX}/include LDFLAGS += -L${LIBS_PREFIX}/lib CFLAGS += -Wall -Wextra -Wpedantic -Wno-gnu-case-range -LDLIBS.dtch = -lutil -LDLIBS.fbclock = -lz -LDLIBS.glitch = -lz -LDLIBS.hnel = -lutil -LDLIBS.modem = -lutil -LDLIBS.pngo = -lz -LDLIBS.ptee = -lutil -LDLIBS.relay = -ltls -LDLIBS.scheme = -lm -LDLIBS.title = -lcurl - --include config.mk BINS += beef BINS += bibsort BINS += bit BINS += c +BINS += dehtml BINS += dtch +BINS += enc +BINS += git-comment BINS += glitch BINS += hilex -BINS += hnel BINS += htagml BINS += modem BINS += mtags @@ -36,6 +26,8 @@ BINS += pbd BINS += pngo BINS += psf2png BINS += ptee +BINS += qf +BINS += quick BINS += scheme BINS += shotty BINS += sup @@ -44,142 +36,107 @@ BINS += up BINS += when BINS += xx -BINS_BSD += ever -BINS_LINUX += bri -BINS_LINUX += fbatt -BINS_LINUX += fbclock -BINS_LINUX += psfed -BINS_TLS += relay +BSD += ever + +GAMES += freecell -BINS_ALL = ${BINS} ${BINS_BSD} ${BINS_LINUX} ${BINS_TLS} +TLS += downgrade +TLS += relay MANS = ${BINS:%=man1/%.1} -MANS_BSD = ${BINS_BSD:%=man1/%.1} -MANS_LINUX = ${BINS_LINUX:%=man1/%.1} -MANS_TLS = ${BINS_TLS:%=man1/%.1} -MANS_ALL = ${BINS_ALL:%=man1/%.1} +MANS.BSD = ${BSD:%=man1/%.1} +MANS.GAMES = ${GAMES:%=man6/%.6} +MANS.TLS = ${TLS:%=man1/%.1} -any: meta ${BINS} +LDLIBS.downgrade = -ltls +LDLIBS.dtch = -lutil +LDLIBS.fbclock = -lz +LDLIBS.freecell = -lcurses +LDLIBS.glitch = -lz +LDLIBS.modem = -lutil +LDLIBS.pngo = -lz +LDLIBS.ptee = -lutil +LDLIBS.qf = -lcurses +LDLIBS.relay = -ltls +LDLIBS.scheme = -lm +LDLIBS.title = -lcurl +LDLIBS.typer = -ltls -bsd: meta ${BINS_BSD} +ALL ?= meta any -linux: meta ${BINS_LINUX} +-include config.mk -tls: meta ${BINS_TLS} +all: ${ALL} meta: .gitignore tags -.SUFFIXES: .pl - -.c: - ${CC} ${CFLAGS} ${LDFLAGS} $< ${LDLIBS.$@} -o $@ - -.o: - ${CC} ${LDFLAGS} $< ${LDLIBS.$@} -o $@ - -.pl: - cp -f $< $@ - chmod a+x $@ - -OBJS.hilex += c11.o -OBJS.hilex += hilex.o -OBJS.hilex += make.o -OBJS.hilex += mdoc.o -OBJS.hilex += sh.o +any: ${BINS} -hilex: ${OBJS.hilex} - ${CC} ${LDFLAGS} ${OBJS.$@} ${LDLIBS.$@} -o $@ +bsd: ${BSD} -${OBJS.hilex}: hilex.h +games: ${GAMES} -fbatt.o fbclock.o: scheme.h +tls: ${TLS} -psf2png.o scheme.o: png.h +IGNORE = *.o *.html +IGNORE += ${BINS} ${BSD} ${GAMES} ${TLS} +IGNORE += tags htmltags -scheme.h: scheme - ./scheme -c > scheme.h +.gitignore: Makefile + echo config.mk '${IGNORE}' | tr ' ' '\n' | sort > $@ tags: *.[chly] ctags -w *.[chly] -IGNORE = *.o *.html ${BINS_ALL} scheme.h tags htmltags - -.gitignore: Makefile - echo config.mk '${IGNORE}' | tr ' ' '\n' | sort > .gitignore - clean: rm -f ${IGNORE} -setuid: bri - chown root bri - chmod u+s bri +install: ${ALL:%=install-%} -link: +install-meta: install -d ${PREFIX}/bin ${MANDIR}/man1 - ln -fs ${BINS_ALL:%=${PWD}/%} ${PREFIX}/bin - ln -fs ${MANS_ALL:%=${PWD}/%} ${MANDIR}/man1 - -unlink: - rm -f ${BINS_ALL:%=${PREFIX}/bin/%} - rm -f ${MANS_ALL:%=${MANDIR}/%} -install: ${BINS} ${MANS} - install -d ${PREFIX}/bin ${MANDIR}/man1 +install-any: install-meta ${BINS} ${MANS} install ${BINS} ${PREFIX}/bin install -m 644 ${MANS} ${MANDIR}/man1 -install-bsd: ${BINS_BSD} ${MANS_BSD} - install -d ${PREFIX}/bin ${MANDIR}/man1 - install ${BINS_BSD} ${PREFIX}/bin - install -m 644 ${MANS_BSD} ${MANDIR}/man1 +install-bsd: install-meta ${BSD} ${MANS.BSD} + install ${BSD} ${PREFIX}/bin + install -m 644 ${MANS.BSD} ${MANDIR}/man1 -install-linux: ${BINS_LINUX} ${MANS_BSD} - install -d ${PREFIX}/bin ${MANDIR}/man1 - install ${BINS_LINUX} ${PREFIX}/bin - install -m 644 ${MANS_LINUX} ${MANDIR}/man1 +install-games: install-meta ${GAMES} ${MANS.GAMES} + install ${GAMES} ${PREFIX}/bin + install -m 644 ${MANS.GAMES} ${MANDIR}/man6 -install-tls: ${BINS_TLS} ${MANS_BSD} - install -d ${PREFIX}/bin ${MANDIR}/man1 - install ${BINS_TLS} ${PREFIX}/bin - install -m 644 ${MANS_TLS} ${MANDIR}/man1 +install-tls: install-meta ${TLS} ${MANS.TLS} + install ${TLS} ${PREFIX}/bin + install -m 644 ${MANS.TLS} ${MANDIR}/man1 uninstall: - rm -f ${BINS_ALL:%=${PREFIX}/bin/%} - rm -f ${MANS_ALL:%=${MANDIR}/%} + rm -f ${BINS:%=${PREFIX}/bin/%} ${MANS:%=${MANDIR}/%} + rm -f ${BSD:%=${PREFIX}/bin/%} ${MANS.BSD:%=${MANDIR}/%} + rm -f ${GAMES:%=${PREFIX}/bin/%} ${MANS.GAMES:%=${MANDIR}/%} + rm -f ${TLS:%=${PREFIX}/bin/%} ${MANS.TLS:%=${MANDIR}/%} -HTMLS = index.html ${BINS_ALL:=.html} png.html -WEBROOT = /usr/local/www/causal.agency - -html: ${HTMLS} - @true - -${HTMLS}: html.sh scheme hilex htagml htmltags - -htmltags: *.[chly] mtags Makefile *.sh - rm -f $@ - for f in *.[chly]; do ctags -aw -f $@ $$f; done - ./mtags -a -f $@ Makefile *.sh +.SUFFIXES: .pl -.SUFFIXES: .html +.c: + ${CC} ${CFLAGS} ${LDFLAGS} $< ${LDLIBS.$@} -o $@ -.c.html: - sh html.sh man1/${<:.c=.1} $< > $@ +.o: + ${CC} ${LDFLAGS} $< ${LDLIBS.$@} -o $@ -.h.html: - sh html.sh man3/${<:.h=.3} $< > $@ +.pl: + cp -f $< $@ + chmod a+x $@ -.y.html: - sh html.sh man1/${<:.y=.1} $< > $@ +OBJS.hilex = c11.o hilex.o make.o mdoc.o sh.o -.sh.html: - sh html.sh man1/${<:.sh=.1} $< > $@ +hilex: ${OBJS.hilex} + ${CC} ${LDFLAGS} ${OBJS.$@} ${LDLIBS.$@} -o $@ -.pl.html: - sh html.sh man1/${<:.pl=.1} $< > $@ +${OBJS.hilex}: hilex.h -index.html: README.7 Makefile html.sh - sh html.sh README.7 Makefile html.sh > $@ +psf2png.o scheme.o: png.h -install-html: ${HTMLS} - install -d ${WEBROOT}/bin - install -C -m 644 ${HTMLS} ${WEBROOT}/bin +include html.mk |