blob: 822902c440848af504a300419d49cbb0b77effb7 [file] [log] [blame]
Dees_Troy3bde1232012-09-22 08:10:28 -04001CC=cc
2CFLAGS=-O3 -Wall -Wextra
Dees_Troy51a0e822012-09-05 15:24:24 -04003
4pigz: pigz.o yarn.o
Dees_Troy3bde1232012-09-22 08:10:28 -04005 $(CC) -o pigz pigz.o yarn.o -lpthread -lz
Dees_Troy51a0e822012-09-05 15:24:24 -04006 ln -f pigz unpigz
7
8pigz.o: pigz.c yarn.h
9
10yarn.o: yarn.c yarn.h
11
12dev: pigz pigzt pigzn
13
14pigzt: pigzt.o yarnt.o
Dees_Troy3bde1232012-09-22 08:10:28 -040015 $(CC) -o pigzt pigzt.o yarnt.o -lpthread -lz
Dees_Troy51a0e822012-09-05 15:24:24 -040016
17pigzt.o: pigz.c yarn.h
Dees_Troy3bde1232012-09-22 08:10:28 -040018 $(CC) -Wall -O3 -DDEBUG -g -c -o pigzt.o pigz.c
Dees_Troy51a0e822012-09-05 15:24:24 -040019
20yarnt.o: yarn.c yarn.h
Dees_Troy3bde1232012-09-22 08:10:28 -040021 $(CC) -Wall -O3 -DDEBUG -g -c -o yarnt.o yarn.c
Dees_Troy51a0e822012-09-05 15:24:24 -040022
23pigzn: pigzn.o
Dees_Troy3bde1232012-09-22 08:10:28 -040024 $(CC) -o pigzn pigzn.o -lz
Dees_Troy51a0e822012-09-05 15:24:24 -040025
26pigzn.o: pigz.c
Dees_Troy3bde1232012-09-22 08:10:28 -040027 $(CC) -Wall -O3 -DDEBUG -DNOTHREAD -g -c -o pigzn.o pigz.c
Dees_Troy51a0e822012-09-05 15:24:24 -040028
29test: pigz
30 ./pigz -kf pigz.c ; ./pigz -t pigz.c.gz
31 ./pigz -kfb 32 pigz.c ; ./pigz -t pigz.c.gz
32 ./pigz -kfp 1 pigz.c ; ./pigz -t pigz.c.gz
33 ./pigz -kfz pigz.c ; ./pigz -t pigz.c.zz
34 ./pigz -kfK pigz.c ; ./pigz -t pigz.c.zip
Dees_Troy3bde1232012-09-22 08:10:28 -040035 printf "" | ./pigz -cdf | wc -c | test `cat` -eq 0
36 printf "x" | ./pigz -cdf | wc -c | test `cat` -eq 1
37 printf "xy" | ./pigz -cdf | wc -c | test `cat` -eq 2
38 printf "xyz" | ./pigz -cdf | wc -c | test `cat` -eq 3
39 (printf "w" | gzip ; printf "x") | ./pigz -cdf | wc -c | test `cat` -eq 2
40 (printf "w" | gzip ; printf "xy") | ./pigz -cdf | wc -c | test `cat` -eq 3
41 (printf "w" | gzip ; printf "xyz") | ./pigz -cdf | wc -c | test `cat` -eq 4
42 -@if test "`whereis compress | grep /`" != ""; then \
43 echo 'compress -f < pigz.c | ./unpigz | cmp - pigz.c' ;\
44 compress -f < pigz.c | ./unpigz | cmp - pigz.c ;\
45 fi
46 @rm -f pigz.c.gz pigz.c.zz pigz.c.zip
Dees_Troy51a0e822012-09-05 15:24:24 -040047
48tests: dev test
49 ./pigzn -kf pigz.c ; ./pigz -t pigz.c.gz
Dees_Troy3bde1232012-09-22 08:10:28 -040050 @rm -f pigz.c.gz
Dees_Troy51a0e822012-09-05 15:24:24 -040051
52docs: pigz.pdf
53
54pigz.pdf: pigz.1
55 groff -mandoc -f H -T ps pigz.1 | ps2pdf - pigz.pdf
56
57clean:
Dees_Troy3bde1232012-09-22 08:10:28 -040058 @rm -f *.o pigz unpigz pigzn pigzt pigz.c.gz pigz.c.zz pigz.c.zip