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