1*31380ac0Sbluhm# $OpenBSD: Makefile,v 1.46 2017/07/07 16:31:37 bluhm Exp $ 2d30492b3Sespie 3*31380ac0SbluhmREGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t8 t9 \ 4*31380ac0Sbluhm t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 \ 5*31380ac0Sbluhm t20 t21 t22 t23 t24 t25 t26 t27 t28 t29 \ 6*31380ac0Sbluhm t30 t31 t32 t33 t34 t35 t36 t37 t38 t38j t39 \ 7*31380ac0Sbluhm t40 t41 t42 t43 t44 t45 t46 t47 8*31380ac0Sbluhm 9*31380ac0Sbluhm# We don't pass t14 t17 t18 t20 109280f092Sespie# and t16 yields piss poor performance 11*31380ac0Sbluhm 12*31380ac0Sbluhmt14: 13*31380ac0Sbluhm # make currently incorrectly uses annotations for suffixes 14*31380ac0Sbluhm # rules for non-suffixes rules. 15*31380ac0Sbluhm @echo DISABLED 16*31380ac0Sbluhm 17*31380ac0Sbluhmt17: 18*31380ac0Sbluhm # Bug in cond-parser, ends up having too many open conds. 19*31380ac0Sbluhm @echo DISABLED 20*31380ac0Sbluhm 21*31380ac0Sbluhmt18: 22*31380ac0Sbluhm # Another test case: this one holds too many open conditionals, 23*31380ac0Sbluhm # and exactly enough closes... 24*31380ac0Sbluhm @echo DISABLED 25*31380ac0Sbluhm 26*31380ac0Sbluhmt20: 27*31380ac0Sbluhm # Some posix tests we don't pass yet, and won't until I've 28*31380ac0Sbluhm # added a `magic' status for variables (as SHELL is very, 29*31380ac0Sbluhm # very special, according to POSIX/Single Unix). 30*31380ac0Sbluhm @echo DISABLED 31d30492b3Sespie 32777589e1StbMALLOC_OPTIONS?=J 33d30492b3Sespiet1: t1.out 34fe973566Sespie env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -e -r -f ${.CURDIR}/mk1 | diff - t1.out 35d30492b3Sespie 36d30492b3Sespie# This is a POSIX test. pmake does not pass variables to submakes until 37d30492b3Sespie# after OpenBSD 2.7. 38d30492b3Sespiet2: 39fe973566Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk2| diff - t2.out 40d30492b3Sespie 41d30492b3Sespiet3: 42fe973566Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk3 -f mk3a|diff - t3.out 43fe973566Sespie cd ${.CURDIR} && cat mk3a |env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk3 -f -|diff - t3.out 44fe973566Sespie cd ${.CURDIR} && cat mk3 |env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f - -f mk3a|diff - t3.out 45fe973566Sespie cd ${.CURDIR} && cat mk3 mk3a|env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f - |diff - t3.out 46d30492b3Sespie 47d30492b3Sespiet4: 48fe973566Sespie cd ${.CURDIR} && cat mk4 mk4a|env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f - |diff - t4.out 49d30492b3Sespie # Splitting files along conditionals should not work 501524cffdSespie 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 51d30492b3Sespie 52d30492b3Sespie# Another POSIX test, checking that MAKEFLAGS does work 53d30492b3Sespiet5: 54d30492b3Sespie # first check that make does fail as expected 551524cffdSespie if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mkfail 2>/dev/null || test $$? -ge 128; then false; fi 56d30492b3Sespie # first form of MAKEFLAGS 57fe973566Sespie cd ${.CURDIR} && env -i PATH=${PATH} MAKEFLAGS=-n MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mkfail 58d30492b3Sespie # second form of MAKEFLAGS 59fe973566Sespie cd ${.CURDIR} && env -i PATH=${PATH} MAKEFLAGS=n MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mkfail 60d30492b3Sespie 61d30492b3Sespiet6: 62fe973566Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} A=good -r -f mk6 | diff - t6.out 63d30492b3Sespie 64*31380ac0Sbluhm# This test passes since the cond parser has been rewritten. 651a5be1c1Sespiet7: 661524cffdSespie if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk7 2>/dev/null || test $$? -ge 128; then false; fi 671a5be1c1Sespie 689e90d608Sespie# check for existent/non existent files 699e90d608Sespiet8: 709e90d608Sespie touch goodfile phony 71fe973566Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk8 | diff - t8.out 729e90d608Sespie 733a482e43Sespiet9: 74fe973566Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk9 2>&1 | diff - t9.out 753a482e43Sespie 76a3ee128fSespie# verify that systemV extended variables work as expected 77a3ee128fSespiet10: z.a 78a3ee128fSespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk10 |diff - t10.out 79a3ee128fSespie 80da5327dbSespie# check for substitution parser in some confusing situations 81da5327dbSespiet11: 82da5327dbSespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk11 |diff - t11.out 83da5327dbSespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk11 A=t|diff - t11.out2 84da5327dbSespie 8500a5c933Sespie# Check for filename expansions. 8600a5c933Sespiet12: 8700a5c933Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk12 |diff - t12.out 8800a5c933Sespie 89*31380ac0Sbluhm# Verify whitespace handling. 90ea40f178Sespiet13: 91ea40f178Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk13 |diff - t13.out 92ea40f178Sespie 93fcb573ceSespiet14: 941524cffdSespie if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk14 2>/dev/null || test $$? -ge 128; then false; fi 95fcb573ceSespie 96ad977213Sespiet15: 97ad977213Sespie touch t15file 98ad977213Sespie cd ${.CURDIR} && ulimit -t 2 && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk15 2>/dev/null 99ad977213Sespie 1006e31152dSespiet16: 1016e31152dSespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk16 1026e31152dSespie 1039280f092Sespiet17: 1049280f092Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk17 1059280f092Sespie 106b2734408Sespiet18: 107b2734408Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk18 108b2734408Sespie 10982eabe46Sespiet19: 11082eabe46Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} SHELL=/bin/zsh ${MAKE} -r -f mk19 | diff - t19.out 11182eabe46Sespie 11282eabe46Sespiet20: 113*31380ac0Sbluhm cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} SHELL=/bin/sh -r -f mk20 | diff - t20.out 11482eabe46Sespie 1159fdcdc49Sespiet21: 1169fdcdc49Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk21 | diff - t21.out 1179fdcdc49Sespie 118a00f81f1Sespiet22: 119a00f81f1Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk22 b | diff - t22.out 120a00f81f1Sespie 121a00f81f1Sespiet23: 122a00f81f1Sespie cd ${.CURDIR} && ulimit -t 60 && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk22 a 2>&1| diff - t23.out 123a00f81f1Sespie 124d8547688Sespiet24: 1251524cffdSespie 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 1263846517aSespie 1273846517aSespiet25: 1283846517aSespie touch ${.OBJDIR}/t25.1st 1293846517aSespie rm -f ${.OBJDIR}/t25.2nd 1301524cffdSespie 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 1313846517aSespie 1323846517aSespiet26: 1333846517aSespie touch ${.OBJDIR}/f26.2nd 1343846517aSespie rm -f ${.OBJDIR}/f26 1351524cffdSespie 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 1363846517aSespie 1373846517aSespiet27: 1383846517aSespie touch ${.OBJDIR}/t27.2nd 1393846517aSespie rm -f ${.OBJDIR}/t27.3rd 1401524cffdSespie 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 141d8547688Sespie 1427ad4da04Sespiet28: 1437ad4da04Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk25 all >/dev/null 1447ad4da04Sespie 1453cd197acSespiet29: 1463cd197acSespie rm -f t29dep t29.targ t29.targ2 libt29.a 1473cd197acSespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk26 all | diff - t29.out 1483cd197acSespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk26 all | diff - t29.out2 1493cd197acSespie 1507b923527Sespiet30: 1517b923527Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk27 all | diff - t30.out 1527b923527Sespie 153c235aa79Sespiet31: 154c235aa79Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk28 all 155c235aa79Sespie 156016739e4Sfgscht32: 157016739e4Sfgsch cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} B="A" ${MAKE} -r -f mk32 all | diff - t32.out 158016739e4Sfgsch 159016739e4Sfgscht33: 160016739e4Sfgsch cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} B=0 ${MAKE} -r -f mk32 all | diff - t33.out 161016739e4Sfgsch 162016739e4Sfgscht34: 163016739e4Sfgsch cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} B=1 ${MAKE} -r -f mk32 all | diff - t34.out 164016739e4Sfgsch 165016739e4Sfgscht35: 166016739e4Sfgsch cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} B=2 ${MAKE} -r -f mk32 all | diff - t35.out 167016739e4Sfgsch 16878e70fa1Sespiet36: 16978e70fa1Sespie if echo '$$$$(A:&)' | env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f - 2>/dev/null|| test $$? -ge 128; then false; fi 17078e70fa1Sespie 171a3ee128fSespiez.a: 172a3ee128fSespie touch $@ 173a3ee128fSespie 17450cd2f97Sespiet37: 175834049f1Sespie if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} B=2 ${MAKE} -r -f mk33 all; then false; else true; fi 17650cd2f97Sespie 17732a92205Sespiet38: 1784cc8d355Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk34 | diff - t38.out 17932a92205Sespie 18032a92205Sespiet38j: 1814cc8d355Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk34 -j2 | diff - t38.out 1824cc8d355Sespie 1834cc8d355Sespiet39: 1844cc8d355Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk35 2>&1 | diff - t39.out 1854cc8d355Sespie 186dacceb69Sjsgt40: 187dacceb69Sjsg cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk36 2>/dev/null 188dacceb69Sjsg 1899a59c451Sjsgt41: 1909a59c451Sjsg if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk37 2>/dev/null || test $$? -ge 128; then false; fi 1919a59c451Sjsg 1929a59c451Sjsgt42: 1939a59c451Sjsg if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk38 2>/dev/null || test $$? -ge 128; then false; fi 1949a59c451Sjsg 19561bf719dSespiet43: 19661bf719dSespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -j2 -f mk39 b 2>&1 | diff - t43.out 19704411d86Sespie cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -j2 -f mk39 a 2>&1 | diff - t43.out 19861bf719dSespie 1993516c9d9Sespiet44: 2003516c9d9Sespie if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk40 2>/dev/null || test $$? -ge 128; then false; fi 2013516c9d9Sespie 2023516c9d9Sespiet45: 2033516c9d9Sespie if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk41 2>/dev/null || test $$? -ge 128; then false; fi 2043516c9d9Sespie 20502e33fd6Sespie# this file should fail, but NOT segfault 20602e33fd6Sespiet46: 20702e33fd6Sespie if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk42 a 2>/dev/null; then \ 20802e33fd6Sespie false; \ 20902e33fd6Sespie else \ 21002e33fd6Sespie if test $$? -ge 1 -a $$? -lt 128; then \ 21102e33fd6Sespie true; else \ 21202e33fd6Sespie false; fi; \ 21302e33fd6Sespie fi 21461bf719dSespie 21509c75a74Sespiet47: tok.o 21609c75a74Sespie test -f tok.o || exit 1 21709c75a74Sespie 218d30492b3Sespiet1.out: 219d30492b3Sespie echo MACHINE_ARCH=${MACHINE_ARCH} >$@ 220d30492b3Sespie 2213846517aSespie.PHONY: ${REGRESS_TARGETS} regress 222d30492b3Sespie 22332a92205SespieCLEANFILES+=t1.out z.a a.a a.b mk34.b goodfile phony t15file \ 2243cd197acSespie t25.1st t25.2nd f26.2nd f26 t27.2nd t27.3rd \ 225*31380ac0Sbluhm libt29.a t29dep t29.targ t29.targ2 t38.b tok tok.o tok.d 226d30492b3Sespie 2278267faadSart.include <bsd.regress.mk> 228