xref: /openbsd/regress/usr.bin/make/Makefile (revision ce008665)
1*ce008665Sespie# $OpenBSD: Makefile,v 1.50 2019/12/22 09:16:58 espie Exp $
2d30492b3Sespie
331380ac0SbluhmREGRESS_TARGETS=     t1  t2  t3  t4  t5  t6  t7  t8  t9 \
431380ac0Sbluhm		t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 \
531380ac0Sbluhm		t20 t21 t22 t23 t24 t25 t26 t27 t28 t29 \
631380ac0Sbluhm		t30 t31 t32 t33 t34 t35 t36 t37 t38 t38j t39 \
7747d3b41Sespie		t40 t41 t42 t42bis t43 t44 t45 t46 t47 t48
831380ac0Sbluhm
9*ce008665SespieREGRESS_EXPECTED_FAILURES = t14 t17 t18
10d30492b3Sespie
11777589e1StbMALLOC_OPTIONS?=J
12d30492b3Sespiet1: t1.out
13fe973566Sespie	env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -e -r -f ${.CURDIR}/mk1 | diff - t1.out
14d30492b3Sespie
15d30492b3Sespie# This is a POSIX test. pmake does not pass variables to submakes until
16d30492b3Sespie# after OpenBSD 2.7.
17d30492b3Sespiet2:
18fe973566Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk2| diff - t2.out
19d30492b3Sespie
20d30492b3Sespiet3:
21fe973566Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk3 -f mk3a|diff - t3.out
22fe973566Sespie	cd ${.CURDIR} && cat mk3a |env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk3 -f -|diff - t3.out
23fe973566Sespie	cd ${.CURDIR} && cat mk3 |env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f - -f mk3a|diff - t3.out
24fe973566Sespie	cd ${.CURDIR} && cat mk3 mk3a|env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f - |diff - t3.out
25d30492b3Sespie
26d30492b3Sespiet4:
27fe973566Sespie	cd ${.CURDIR} && cat mk4 mk4a|env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f - |diff - t4.out
28d30492b3Sespie	# Splitting files along conditionals should not work
291524cffdSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk4 -f mk4a 2>/dev/null || test $$? -ge 128 ; then false; fi
30d30492b3Sespie
31d30492b3Sespie# Another POSIX test, checking that MAKEFLAGS does work
32d30492b3Sespiet5:
33d30492b3Sespie	# first check that make does fail as expected
341524cffdSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mkfail 2>/dev/null || test $$? -ge 128; then false; fi
35d30492b3Sespie	# first form of MAKEFLAGS
36fe973566Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MAKEFLAGS=-n MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mkfail
37d30492b3Sespie	# second form of MAKEFLAGS
38fe973566Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MAKEFLAGS=n MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mkfail
39d30492b3Sespie
40d30492b3Sespiet6:
41fe973566Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} A=good -r -f mk6 | diff - t6.out
42d30492b3Sespie
4331380ac0Sbluhm# This test passes since the cond parser has been rewritten.
441a5be1c1Sespiet7:
451524cffdSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk7 2>/dev/null || test $$? -ge 128; then false; fi
461a5be1c1Sespie
479e90d608Sespie# check for existent/non existent files
489e90d608Sespiet8:
499e90d608Sespie	touch goodfile phony
50fe973566Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk8 | diff - t8.out
519e90d608Sespie
523a482e43Sespiet9:
53fe973566Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk9 2>&1 | diff - t9.out
543a482e43Sespie
55a3ee128fSespie# verify that systemV extended variables work as expected
56a3ee128fSespiet10:	z.a
57a3ee128fSespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk10 |diff - t10.out
58a3ee128fSespie
59da5327dbSespie# check for substitution parser in some confusing situations
60da5327dbSespiet11:
61da5327dbSespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk11 |diff - t11.out
62da5327dbSespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk11 A=t|diff - t11.out2
63da5327dbSespie
6400a5c933Sespie# Check for filename expansions.
6500a5c933Sespiet12:
6600a5c933Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk12 |diff - t12.out
6700a5c933Sespie
6831380ac0Sbluhm# Verify whitespace handling.
69ea40f178Sespiet13:
70ea40f178Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk13 |diff - t13.out
71ea40f178Sespie
7296b9c5acSespie# make currently incorrectly uses annotations for suffixes rules
7396b9c5acSespie# for non-suffixes rules.
7496b9c5acSespie# this is hard to fix without breaking something else
75fcb573ceSespiet14:
761524cffdSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk14 2>/dev/null || test $$? -ge 128; then false; fi
77fcb573ceSespie
78ad977213Sespiet15:
79ad977213Sespie	touch t15file
80ad977213Sespie	cd ${.CURDIR} && ulimit -t 2 && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk15 2>/dev/null
81ad977213Sespie
826e31152dSespiet16:
836e31152dSespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk16
846e31152dSespie
8596b9c5acSespie# Bug in cond-parser, ends up having too many open conds.
869280f092Sespiet17:
879280f092Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk17
889280f092Sespie
8996b9c5acSespie# bug in cond-parser again: this one holds too many open conditionals,
9096b9c5acSespie# and exactly enough closes...
91b2734408Sespiet18:
92b2734408Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk18
93b2734408Sespie
9482eabe46Sespiet19:
9582eabe46Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} SHELL=/bin/zsh ${MAKE} -r -f mk19 | diff - t19.out
9682eabe46Sespie
9782eabe46Sespiet20:
98*ce008665Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} SHELL=/bin/sh ${MAKE} -r -f mk20 | diff - t20.out
9982eabe46Sespie
1009fdcdc49Sespiet21:
1019fdcdc49Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk21 | diff - t21.out
1029fdcdc49Sespie
103a00f81f1Sespiet22:
104a00f81f1Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk22 b | diff - t22.out
105a00f81f1Sespie
106a00f81f1Sespiet23:
107a00f81f1Sespie	cd ${.CURDIR} && ulimit -t 60 && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk22 a 2>&1| diff - t23.out
108a00f81f1Sespie
109d8547688Sespiet24:
1101524cffdSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk23 a 2>/dev/null || test $$? -ge 128; then false; fi
1113846517aSespie
1123846517aSespiet25:
1133846517aSespie	touch ${.OBJDIR}/t25.1st
1143846517aSespie	rm -f ${.OBJDIR}/t25.2nd
1151524cffdSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk24 t25.2nd 2>/dev/null || test $$? -ge 128; then false; fi
1163846517aSespie
1173846517aSespiet26:
1183846517aSespie	touch ${.OBJDIR}/f26.2nd
1193846517aSespie	rm -f ${.OBJDIR}/f26
1201524cffdSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk24 f26 2>/dev/null || test $$? -ge 128; then false; fi
1213846517aSespie
1223846517aSespiet27:
1233846517aSespie	touch ${.OBJDIR}/t27.2nd
1243846517aSespie	rm -f ${.OBJDIR}/t27.3rd
1251524cffdSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk24 t27.3rd 2>/dev/null || test $$? -ge 128; then false; fi
126d8547688Sespie
1277ad4da04Sespiet28:
1287ad4da04Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk25 all >/dev/null
1297ad4da04Sespie
1303cd197acSespiet29:
1313cd197acSespie	rm -f t29dep t29.targ t29.targ2 libt29.a
1323cd197acSespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk26 all | diff - t29.out
1333cd197acSespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk26 all | diff - t29.out2
1343cd197acSespie
1357b923527Sespiet30:
1367b923527Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk27 all | diff - t30.out
1377b923527Sespie
138c235aa79Sespiet31:
139c235aa79Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk28 all
140c235aa79Sespie
141016739e4Sfgscht32:
142016739e4Sfgsch	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} B="A" ${MAKE} -r -f mk32 all | diff - t32.out
143016739e4Sfgsch
144016739e4Sfgscht33:
145016739e4Sfgsch	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} B=0 ${MAKE} -r -f mk32 all | diff - t33.out
146016739e4Sfgsch
147016739e4Sfgscht34:
148016739e4Sfgsch	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} B=1 ${MAKE} -r -f mk32 all | diff - t34.out
149016739e4Sfgsch
150016739e4Sfgscht35:
151016739e4Sfgsch	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} B=2 ${MAKE} -r -f mk32 all | diff - t35.out
152016739e4Sfgsch
15378e70fa1Sespiet36:
15478e70fa1Sespie	if echo '$$$$(A:&)' | env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f - 2>/dev/null|| test $$? -ge 128; then false; fi
15578e70fa1Sespie
156a3ee128fSespiez.a:
157a3ee128fSespie	touch $@
158a3ee128fSespie
15950cd2f97Sespiet37:
160834049f1Sespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} B=2 ${MAKE} -r -f mk33 all; then false; else true; fi
16150cd2f97Sespie
16232a92205Sespiet38:
1634cc8d355Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk34 | diff - t38.out
16432a92205Sespie
16532a92205Sespiet38j:
1664cc8d355Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk34 -j2 | diff - t38.out
1674cc8d355Sespie
1684cc8d355Sespiet39:
1694cc8d355Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk35 2>&1 | diff - t39.out
1704cc8d355Sespie
171dacceb69Sjsgt40:
172dacceb69Sjsg	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk36 2>/dev/null
173dacceb69Sjsg
1749a59c451Sjsgt41:
1759a59c451Sjsg	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk37 2>/dev/null || test $$? -ge 128; then false; fi
1769a59c451Sjsg
1779a59c451Sjsgt42:
1789a59c451Sjsg	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk38 2>/dev/null || test $$? -ge 128; then false; fi
1799a59c451Sjsg
1804301cb8bSespiet42bis:
1814301cb8bSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk38bis 2>/dev/null || test $$? -ge 128; then false; fi
1824301cb8bSespie
18361bf719dSespiet43:
18461bf719dSespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -j2 -f mk39 b 2>&1 | diff - t43.out
18504411d86Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -j2 -f mk39 a 2>&1 | diff - t43.out
18661bf719dSespie
1873516c9d9Sespiet44:
1883516c9d9Sespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk40 2>/dev/null || test $$? -ge 128; then false; fi
1893516c9d9Sespie
1903516c9d9Sespiet45:
1913516c9d9Sespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk41 2>/dev/null || test $$? -ge 128; then false; fi
1923516c9d9Sespie
19302e33fd6Sespie# this file should fail, but NOT segfault
19402e33fd6Sespiet46:
19502e33fd6Sespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk42 a 2>/dev/null; then \
19602e33fd6Sespie	    false; \
19702e33fd6Sespie	    else \
19802e33fd6Sespie		if test $$? -ge 1 -a $$? -lt 128; then \
19902e33fd6Sespie		    true; else \
20002e33fd6Sespie		    false; fi; \
20102e33fd6Sespie	    fi
20261bf719dSespie
20309c75a74Sespiet47: tok.o
20409c75a74Sespie	test -f tok.o || exit 1
20509c75a74Sespie
206747d3b41Sespiet48:
207747d3b41Sespie	cd ${.CURDIR} && make -r -f mk43 a
208747d3b41Sespie
209d30492b3Sespiet1.out:
210d30492b3Sespie	echo MACHINE_ARCH=${MACHINE_ARCH} >$@
211d30492b3Sespie
2123846517aSespie.PHONY: ${REGRESS_TARGETS} regress
213d30492b3Sespie
21432a92205SespieCLEANFILES+=t1.out z.a a.a a.b mk34.b goodfile phony t15file \
2153cd197acSespie	t25.1st t25.2nd f26.2nd f26 t27.2nd t27.3rd \
21631380ac0Sbluhm	libt29.a t29dep t29.targ t29.targ2 t38.b tok tok.o tok.d
217d30492b3Sespie
2188267faadSart.include <bsd.regress.mk>
219