Makefile revision 1.3
11.3SriastradPROG=	vndcompress
21.3SriastradSRCS=	main.c vndcompress.c vnduncompress.c
31.3Sriastrad
41.3SriastradLINKS=	${BINDIR}/vndcompress ${BINDIR}/vnduncompress
51.3SriastradMLINKS=	vndcompress.1 vnduncompress.1
61.1Shubertf
71.3SriastradDPADD+=	${LIBZ}
81.1ShubertfLDADD+=	-lz
91.1Shubertf
101.3SriastradWARNS=	5
111.3Sriastrad
121.1Shubertf.include <bsd.prog.mk>
131.3Sriastrad
141.3SriastradTESTFILES+=	oneblock
151.3SriastradXFAIL+=		oneblock.in-outx
161.3SriastradXFAIL+=		oneblock.cl2-cl2x
171.3Sriastradoneblock.in:
181.3Sriastrad	head -c 512 < /usr/share/dict/words > ${.TARGET}.tmp \
191.3Sriastrad	&& mv -f ${.TARGET}.tmp ${.TARGET}
201.3Sriastrad
211.3SriastradTESTFILES+=	tenblock
221.3SriastradXFAIL+=		tenblock.in-outx
231.3SriastradXFAIL+=		tenblock.cl2-cl2x
241.3Sriastradtenblock.in:
251.3Sriastrad	head -c 5120 < /usr/share/dict/words > ${.TARGET}.tmp \
261.3Sriastrad	&& mv -f ${.TARGET}.tmp ${.TARGET}
271.3Sriastrad
281.3SriastradTESTFILES+=	smallfile
291.3SriastradXFAIL+=		smallfile.in-outx
301.3SriastradXFAIL+=		smallfile.cl2-cl2x
311.3Sriastradsmallfile.in:
321.3Sriastrad	head -c 12345 < /usr/share/dict/words > ${.TARGET}.tmp \
331.3Sriastrad	&& mv -f ${.TARGET}.tmp ${.TARGET}
341.3Sriastrad
351.3SriastradCHECKS+=	check-pipe
361.3SriastradCLEANFILES+=	smallfile.cl2pipe
371.3Sriastradcheck-pipe: .PHONY smallfile.cl2 smallfile.cl2pipe
381.3Sriastrad	cmp ${.ALLSRC}
391.3Sriastradsmallfile.cl2pipe: smallfile.in vndcompress
401.3Sriastrad	head -c 54321 < /usr/share/dict/words \
411.3Sriastrad	| ./vndcompress -l 12345 /dev/stdin ${.TARGET}.tmp \
421.3Sriastrad	&& mv -f ${.TARGET}.tmp ${.TARGET}
431.3Sriastrad
441.3SriastradTESTFILES+=	onechunk
451.3Sriastradonechunk.in:
461.3Sriastrad	head -c 65536 < /usr/share/dict/words > ${.TARGET}.tmp \
471.3Sriastrad	&& mv -f ${.TARGET}.tmp ${.TARGET}
481.3Sriastrad
491.3SriastradTESTFILES+=	tenchunk
501.3Sriastradtenchunk.in:
511.3Sriastrad	head -c 655360 < /usr/share/dict/words > ${.TARGET}.tmp \
521.3Sriastrad	&& mv -f ${.TARGET}.tmp ${.TARGET}
531.3Sriastrad
541.3SriastradTESTFILES+=	extrablock
551.3SriastradXFAIL+=		extrablock.in-outx
561.3SriastradXFAIL+=		extrablock.cl2-cl2x
571.3Sriastradextrablock.in:
581.3Sriastrad	head -c $$((65536 + 512)) < /usr/share/dict/words > ${.TARGET}.tmp \
591.3Sriastrad	&& mv -f ${.TARGET}.tmp ${.TARGET}
601.3Sriastrad
611.3SriastradTESTFILES+=	medfile
621.3SriastradXFAIL+=		medfile.in-outx
631.3SriastradXFAIL+=		medfile.cl2-cl2x
641.3Sriastradmedfile.in:
651.3Sriastrad	head -c 123456 < /usr/share/dict/words > ${.TARGET}.tmp \
661.3Sriastrad	&& mv -f ${.TARGET}.tmp ${.TARGET}
671.3Sriastrad
681.3SriastradTESTFILES+=		onetinyblock
691.3SriastradBLOCKSIZE.onetinyblock=	512
701.3Sriastradonetinyblock.in:
711.3Sriastrad	head -c 512 < /usr/share/dict/words > ${.TARGET}.tmp \
721.3Sriastrad	&& mv -f ${.TARGET}.tmp ${.TARGET}
731.3Sriastrad
741.3SriastradTESTFILES+=		tentinyblock
751.3SriastradBLOCKSIZE.tentinyblock=	512
761.3Sriastradtentinyblock.in:
771.3Sriastrad	head -c 5120 < /usr/share/dict/words > ${.TARGET}.tmp \
781.3Sriastrad	&& mv -f ${.TARGET}.tmp ${.TARGET}
791.3Sriastrad
801.3SriastradCHECKS+=	check-pipe-restart
811.3SriastradCLEANFILES+=	piperestart.in piperestart.in.tmp
821.3SriastradCLEANFILES+=	piperestart.cl2 piperestart.cl2.tmp
831.3SriastradCLEANFILES+=	piperestart.cl2restart piperestart.cl2restart.tmp
841.3SriastradCLEANFILES+=	piperestart.cl2part piperestart.cl2part.tmp
851.3Sriastradcheck-pipe-restart: .PHONY piperestart.cl2 piperestart.cl2restart
861.3Sriastrad	cmp ${.ALLSRC}
871.3Sriastradpiperestart.cl2restart: piperestart.cl2part vndcompress
881.3Sriastrad	cp piperestart.cl2part ${.TARGET}.tmp \
891.3Sriastrad	&& head -c 700000 < /usr/share/dict/words \
901.3Sriastrad	| ./vndcompress -l 655360 -k 1 -rR /dev/stdin ${.TARGET}.tmp \
911.3Sriastrad	&& mv -f ${.TARGET}.tmp ${.TARGET}
921.3Sriastradpiperestart.cl2part: vndcompress
931.3Sriastrad	head -c 600000 < /usr/share/dict/words \
941.3Sriastrad	| ./vndcompress -l 655360 -k 1 /dev/stdin ${.TARGET}.tmp; \
951.3Sriastrad	mv -f ${.TARGET}.tmp ${.TARGET}
961.3Sriastradpiperestart.in:
971.3Sriastrad	head -c 655360 < /usr/share/dict/words > ${.TARGET}.tmp \
981.3Sriastrad	&& mv -f ${.TARGET}.tmp ${.TARGET}
991.3Sriastrad
1001.3SriastradCHECKS+=	check-part
1011.3SriastradCLEANFILES+=	part.orig part.cl2part part.cl2 part.out
1021.3Sriastradcheck-part: .PHONY part.orig part.out
1031.3Sriastrad	cmp part.orig part.out
1041.3Sriastradpart.cl2: part.orig part.cl2part vndcompress
1051.3Sriastrad	cp part.cl2part ${.TARGET}.tmp \
1061.3Sriastrad	&& ./vndcompress -s 512 -rR part.orig ${.TARGET}.tmp \
1071.3Sriastrad	&& mv -f ${.TARGET}.tmp ${.TARGET}
1081.3Sriastradpart.cl2part: part.orig vndcompress
1091.3Sriastrad	./vndcompress -s 512 -p 10 part.orig ${.TARGET}.tmp \
1101.3Sriastrad	&& mv -f ${.TARGET}.tmp ${.TARGET}
1111.3Sriastradpart.orig:
1121.3Sriastrad	head -c 12345 < /usr/share/dict/words > ${.TARGET}.tmp \
1131.3Sriastrad	&& mv -f ${.TARGET}.tmp ${.TARGET}
1141.3Sriastrad
1151.3SriastradTESTSUFFIXES+=	in cl2 cl2x out outx
1161.3Sriastrad
1171.3SriastradTESTFORMS+=	cl2 cl2x
1181.3SriastradTESTFORMS+=	in out
1191.3SriastradTESTFORMS+=	in outx
1201.3Sriastrad
1211.3Sriastrad.for testfile in ${TESTFILES}
1221.3Sriastrad.  for suffix in ${TESTSUFFIXES}
1231.3SriastradCLEANFILES+=	${testfile}.${suffix}
1241.3SriastradCLEANFILES+=	${testfile}.${suffix}.tmp
1251.3Sriastrad.  endfor
1261.3Sriastrad.  for left right in ${TESTFORMS}
1271.3SriastradCHECKS.${testfile}+=	check-${testfile}.${left}-${right}
1281.3Sriastradcheck-${testfile}.${left}-${right}: .PHONY \
1291.3Sriastrad  ${testfile}.${left} ${testfile}.${right}
1301.3Sriastrad.    if empty(XFAIL:M${testfile}.${left}-${right})
1311.3Sriastrad	cmp ${testfile}.${left} ${testfile}.${right}
1321.3Sriastrad.    else
1331.3Sriastrad	@echo '# expecting failure...' \
1341.3Sriastrad	&& echo 'cmp ${testfile}.${left} ${testfile}.${right}' \
1351.3Sriastrad	&& if cmp ${testfile}.${left} ${testfile}.${right}; then \
1361.3Sriastrad	  echo 'unexpected pass!' \
1371.3Sriastrad	  && exit 1; \
1381.3Sriastrad	fi
1391.3Sriastrad.    endif
1401.3Sriastrad.  endfor
1411.3Sriastradcheck-${testfile}: ${CHECKS.${testfile}}
1421.3SriastradCHECKS+=	check-${testfile}
1431.3Sriastrad.endfor
1441.3Sriastrad
1451.3Sriastradcheck: .PHONY ${CHECKS}
1461.3Sriastrad
1471.3Sriastrad.SUFFIXES: .cl2 .cl2x .in .out .outx
1481.3Sriastrad
1491.3Sriastrad.in.cl2: vndcompress
1501.3Sriastrad	./vndcompress ${.IMPSRC} ${.TARGET} ${BLOCKSIZE.${.PREFIX}}
1511.3Sriastrad
1521.3Sriastrad.in.cl2x:
1531.3Sriastrad	vndcompress ${.IMPSRC} ${.TARGET} ${BLOCKSIZE.${.PREFIX}}
1541.3Sriastrad
1551.3Sriastrad.cl2.out: vndcompress
1561.3Sriastrad	./vndcompress -d ${.IMPSRC} ${.TARGET}
1571.3Sriastrad
1581.3Sriastrad.cl2.outx:
1591.3Sriastrad	vnduncompress ${.IMPSRC} ${.TARGET}
160