summaryrefslogtreecommitdiff
path: root/regress/usr.bin/ctfdump/Makefile
blob: da6cadd5938960e9bb22ab73aaa1702168be1b98 (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
#	$OpenBSD: Makefile,v 1.2 2017/08/23 14:09:39 bluhm Exp $

# If you are unsure whether the output of ctfdump(1) is correct, you can
# install ctftools from ports and set CTFDUMP=/usr/local/bin/ctfdump.
CTFDUMP?=		/usr/bin/ctfdump
CTFSTRIP?=		/usr/bin/ctfstrip

PROG=			example
DEBUG+=			-g

REGRESS_TARGETS=	base_types_encoding

# Test the proper encoding and display of base types in the C language.
base_types_encoding: ${PROG}.ctf
	${MAKE} -C ${.CURDIR} run-${PROG} RT=$@ RE=' (INTEGER|FLOAT) '

# Run ctfdump(1) and massage the output to make it stable.  ${RT} is the
# original test target; ${RE} reduces the output to the relevant lines.
run-${PROG}: ${PROG}.ctf
	${CTFDUMP} ${PROG}.ctf 2>&1 | sed 's/\[[0-9]*\]/[]/' | sort | egrep '${RE}' >${RT}.out
.if exists(${RT}.${MACHINE})
	diff -u ${.CURDIR}/${RT}.${MACHINE} ${RT}.out
	@echo ok - ${RT}
.else
	# ${RT} for machine ${MACHINE} not found
	@echo SKIPPED
.endif

${PROG}.ctf: ${PROG}
	${CTFSTRIP} -o ${PROG}.ctf ${PROG}

CLEANFILES+= ${PROG}.ctf *.out

.include <bsd.regress.mk>