view Makefile @ 202:7f25bb89b59c

Move RLGWebD configuration options into a configuration file. On startup, rlgwebd now reads /etc/rlgwebd.conf. If the options for HTTPS are not found, it will only use HTTP.
author John "Elwin" Edwards
date Wed, 04 Jan 2017 20:28:29 -0500
parents 298a531776d6
children 6651f54a0062
line wrap: on
line source

CHROOT=/var/dgl
BINDIR=/usr/local/bin

WEBASSETS = about.html bell.svg index.html options.html options.js rlgterm.js \
            style-rlg.css termemu.js termemu-keys.js tty.css

all: sqlickrypt dglwatcher

sqlickrypt: sqlickrypt.c
	cc -o sqlickrypt sqlickrypt.c -lcrypt -lsqlite3

dglwatcher: dglwatcher.c
	cc -o dglwatcher dglwatcher.c

clean:
	rm -f sqlickrypt dglwatcher

install: all
	mkdir -p ${CHROOT}/bin
	cp sqlickrypt dglwatcher ${CHROOT}/bin
	for LIB in `ldd ./sqlickrypt | awk '$$1 ~ "^/" {print $$1}; $$3 ~ "^/" {print $$3}'`; do mkdir -p ${CHROOT}`dirname $$LIB`; cp $$LIB ${CHROOT}$$LIB; done
	cp rlgwebd rlgwebd-stop ${BINDIR}
	mkdir -p ${CHROOT}/var/www
	cp ${WEBASSETS} ${CHROOT}/var/www
	cp rlgwebd.service /usr/lib/systemd/system
	if test ! -f /etc/rlgwebd.conf; cp rlgwebd.conf /etc; fi

# Libraries are not removed.  Something else might be using them.
uninstall:
	rm -rf ${CHROOT}/var/www
	rm -f ${CHROOT}/bin/sqlickrypt
	rm -f ${CHROOT}/bin/dglwatcher
	rm -f ${BINDIR}/rlgwebd ${BINDIR}/rlgwebd-stop
	rm -f /usr/lib/systemd/system/rlgwebd.service