1#	$OpenBSD: Makefile,v 1.4 2017/03/10 17:23:48 eric Exp $
2
3#
4# Notes on building and running the regression tests
5#
6# The regress suite builds two sets of static executables: the former linked
7# against the system libc, and the latter against the libc found in /usr/obj
8# The idea is to compare the output of all programs with internal changes in
9# the libc (more specifically the resolver).  They will be run in a chrooted
10# environment to test various /etc configurations without touching the local
11# machine config files.
12#
13# First, build a libc that needs testing, then:
14#
15# $ make
16# $ doas make install
17# $ doas make regress
18#
19# Tests output goes into a $REGRESSDIR/tmp.XXXXXXXXXX directory, and a digest
20# is displayed at the end.
21#
22
23REGRESSDIR?=	/tmp/regress-asr
24REGRESS?=	regress.sh
25
26A?=	.a
27B?=	.b
28
29DIRA?=	/usr/lib
30DIRB?=	/usr/obj/lib/libc
31
32
33all: build
34
35build:
36	cd bin && EXT=${A} LDFLAGS=-L${DIRA} make
37	cd bin && EXT=${B} LDFLAGS=-L${DIRB} make
38
39clean:
40	cd bin && EXT=${A} make clean
41	cd bin && EXT=${B} make clean
42
43install:
44	mkdir -p ${REGRESSDIR}/bin
45	cd bin && BINDIR=${REGRESSDIR}/bin EXT=${A} make install
46	cd bin && BINDIR=${REGRESSDIR}/bin EXT=${B} make install
47
48uninstall:
49	rm -rf ${REGRESSDIR}
50
51regress:
52	RUNDIR=${REGRESSDIR} A=${A} B=${B} sh ${.CURDIR}/${REGRESS}
53