summaryrefslogtreecommitdiff
path: root/regress/lib/libc/asr/Makefile
blob: ac1d4ed18c689df9a3f2209c1ec5468651bf68c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#	$OpenBSD: Makefile,v 1.2 2012/08/07 21:00:31 eric Exp $

#
# Note on building and running the regress tests:
#
# The regress suite builds two sets of static executables: one linked
# against the current libc, and one linked against a libc with the resolver
# replaced. The idea is to compare the output of all programs in both cases.
#
# So before building the regression test programs, you need to have the two
# libc.a ready.  By default, it is assumed that the asr-enabled libc was just
# built from src but not installed, so the current libc.a is expected to be
# found in /usr/lib, and the new one in /usr/obj/lib/libc. If your setting
# is different, just set LIBCDIRSTD and LIBCDIRASR accordingly.
# 
# When done, run "make && make install". This builds and installs the two sets
# of programs in REGRESSDIR. They will run chrooted there to allow testing with
# various /etc environment without messing up the local machine config files.
#
# When you are sure everything is in place, run "make regress". This will
# create two files: $REGRESSDIR/output.log with the output of all run tests,
# and $REGRESSDIR/regress.log with the diffs for those that "failed".
#
# Note that "install" and "regress" targets need to be run as root.
#

LIBCDIRSTD?=	/usr/lib
LIBCDIRASR?=	/usr/obj/lib/libc

REGRESSDIR?=	/tmp/regress
REGRESS?=	regress.sh

all: build

build:
	cd bin && EXT=.asr LDFLAGS=-L${LIBCDIRASR} make
	cd bin && EXT=.std LDFLAGS=-L${LIBCDIRSTD} make

clean:
	cd bin && EXT=.std make clean
	cd bin && EXT=.asr make clean

install:
	mkdir -p ${REGRESSDIR}/etc
	mkdir -p ${REGRESSDIR}/bin
	cd bin && BINDIR=${REGRESSDIR}/bin EXT=.std make install
	cd bin && BINDIR=${REGRESSDIR}/bin EXT=.asr make install

uninstall:
	rm -rf ${REGRESSDIR}

regress:
	RUNDIR=${REGRESSDIR} sh ${.CURDIR}/${REGRESS}