File: Makefile

package info (click to toggle)
runawk 1.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 712 kB
  • sloc: awk: 1,127; ansic: 736; sh: 420; makefile: 103
file content (37 lines) | stat: -rw-r--r-- 1,044 bytes parent folder | download | duplicates (3)
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
DIFF_PROG ?=	diff -u

TESTTEMPDIR = ${.CURDIR}/..
.export TESTTEMPDIR

all:
	@echo 'running tests...'; \
	export SRCDIR=${.CURDIR}/..; \
	if { ${.CURDIR}/test.sh > ${.OBJDIR}/_test.res; \
	    ${DIFF_PROG} ${.CURDIR}/test.out ${.OBJDIR}/_test.res; };\
	then echo '   succeeded'; \
	else echo '   failed'; false; \
	fi

# test using all available awk version except mawk which
# is definitely buggy, oawk is also NOT supported

AWK_PROGS ?= /usr/bin/awk /usr/bin/nawk /usr/bin/gawk \
   /usr/pkg/bin/nawk /usr/pkg/bin/gawk /usr/pkg/bin/nbawk #\
#   /usr/pkg/heirloom/bin/posix/awk /usr/pkg/heirloom/bin/posix2001/awk
#   /usr/pkg/heirloom/bin/nawk
#   /usr/bin/mawk /usr/pkg/bin/mawk /usr/pkg/bin/mawk-uxre

.PHONY: test_all
test_all:
.for awk in ${AWK_PROGS}
	@if test -x ${awk}; then \
		echo testing ${awk}; \
		export RUNAWK_AWKPROG=${awk}; cd ${.CURDIR} && ${MAKE} all; \
		echo ''; \
	fi
.endfor

CLEANFILES += ${TESTTEMPDIR}/temp1.awk ${TESTTEMPDIR}/temp2.awk ${TESTTEMPDIR}/temp3.awk
DISTCLEANFILES += _test.res

.include <mkc.files.mk>