# $Id: Makefile,v 1.25 2019/08/02 19:36:29 kili Exp $

# On redneck systems like linux, you may have to uncomment the following
# line.
# CFLAGS+= -D'setproctitle(a, b)=while(0)' -Dsrand_deterministic=srand ${DEBUG}
#
# You may also have to install the pmake package (works at least for
# debian) and run
#
#	pmake depend
#	pmake
#
# to build this program.
#
# The DEBUG setting below may be a noop on linux.

DEBUG=	-g -Wall -Wno-parentheses

# Don't even think about asking me for the meaning of this name!
PROG=	trisold
SRCS=	trisold.c alloc.c canvas.c map.c moves.c steps.c
LDADD= -lm

.PHONY: export

export:
	cvs2cl -S --no-wrap && \
	rep=$$(cat CVS/Root)/$$(cat CVS/Repository) && \
	export root=$${rep%/*} module=$${rep##*/}; \
	mkdir exp && \
	cd exp && \
	cvs -qR -d $$root export -rHEAD $$module && \
	cd $$module && \
	cp ../../ChangeLog . && \
	mandoc -T html -O style=mandoc.css trisold.1 > README.html && \
	cp -p /usr/src/usr.bin/mandoc/mandoc.css . && \
	cd .. && \
	pax -wzf ../$$module.tar.gz $$module && \
	cd .. && \
	rm -rf exp && \
	scp -p $$module.tar.gz dead-parrot.de:/var/www/virtual/karopapier/ && \
	rm -f $${module}.tar.gz

.PHONY: test

test: all
	/usr/bin/time -p ./trisold -rcs ../042.map  maps/!(125|145|167).map >_
	diff -I ^usr: -uw __ _

.include <bsd.prog.mk>
