1# $OpenBSD: Makefile,v 1.3 2013/04/01 10:18:28 eric Exp $ 2 3# 4# Note on building and running the regress tests: 5# 6# The regress suite builds two sets of static executables: one linked 7# against the current libc, and one linked against a libc with the resolver 8# replaced. The idea is to compare the output of all programs in both cases. 9# 10# So before building the regression test programs, you need to have two 11# static libc: the system libc.a in /usr/lib/ which is assumed to be built 12# with asr, and a pre-asr libc.a in the "./lib/" directory (you can build 13# one by commenting out the ".include "${LIBCSRCDIR}/asr/Makefile.inc" 14# line from the /usr/src/lib/libc/Makefile.in and rebuild the libc). 15# 16# When done, run "make && make install". This builds and installs the two sets 17# of programs in REGRESSDIR. They will run chrooted there to allow testing with 18# various /etc environment without messing up the local machine config files. 19# 20# When you are sure everything is in place, run "make regress". This will 21# create two files: $REGRESSDIR/output.log with the output of all tests, 22# and $REGRESSDIR/regress.log with the diffs for those that "failed". 23# 24# Note that the "install" and "regress" targets need to be run as root. 25# 26 27LIBCDIRSTD?= ${.CURDIR}/lib 28LIBCDIRASR?= /usr/lib 29 30REGRESSDIR?= /tmp/regress 31REGRESS?= regress.sh 32 33all: build 34 35build: 36 cd bin && EXT=.asr LDFLAGS=-L${LIBCDIRASR} make 37 cd bin && EXT=.std LDFLAGS=-L${LIBCDIRSTD} make 38 39clean: 40 cd bin && EXT=.std make clean 41 cd bin && EXT=.asr make clean 42 43install: 44 mkdir -p ${REGRESSDIR}/etc 45 mkdir -p ${REGRESSDIR}/bin 46 cd bin && BINDIR=${REGRESSDIR}/bin EXT=.std make install 47 cd bin && BINDIR=${REGRESSDIR}/bin EXT=.asr make install 48 49uninstall: 50 rm -rf ${REGRESSDIR} 51 52regress: 53 RUNDIR=${REGRESSDIR} sh ${.CURDIR}/${REGRESS} 54