Dees_Troy | 3bde123 | 2012-09-22 08:10:28 -0400 | [diff] [blame] | 1 | CC=cc |
| 2 | CFLAGS=-O3 -Wall -Wextra |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 3 | |
| 4 | pigz: pigz.o yarn.o |
Dees_Troy | 3bde123 | 2012-09-22 08:10:28 -0400 | [diff] [blame] | 5 | $(CC) -o pigz pigz.o yarn.o -lpthread -lz |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 6 | ln -f pigz unpigz |
| 7 | |
| 8 | pigz.o: pigz.c yarn.h |
| 9 | |
| 10 | yarn.o: yarn.c yarn.h |
| 11 | |
| 12 | dev: pigz pigzt pigzn |
| 13 | |
| 14 | pigzt: pigzt.o yarnt.o |
Dees_Troy | 3bde123 | 2012-09-22 08:10:28 -0400 | [diff] [blame] | 15 | $(CC) -o pigzt pigzt.o yarnt.o -lpthread -lz |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 16 | |
| 17 | pigzt.o: pigz.c yarn.h |
Dees_Troy | 3bde123 | 2012-09-22 08:10:28 -0400 | [diff] [blame] | 18 | $(CC) -Wall -O3 -DDEBUG -g -c -o pigzt.o pigz.c |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 19 | |
| 20 | yarnt.o: yarn.c yarn.h |
Dees_Troy | 3bde123 | 2012-09-22 08:10:28 -0400 | [diff] [blame] | 21 | $(CC) -Wall -O3 -DDEBUG -g -c -o yarnt.o yarn.c |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 22 | |
| 23 | pigzn: pigzn.o |
Dees_Troy | 3bde123 | 2012-09-22 08:10:28 -0400 | [diff] [blame] | 24 | $(CC) -o pigzn pigzn.o -lz |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 25 | |
| 26 | pigzn.o: pigz.c |
Dees_Troy | 3bde123 | 2012-09-22 08:10:28 -0400 | [diff] [blame] | 27 | $(CC) -Wall -O3 -DDEBUG -DNOTHREAD -g -c -o pigzn.o pigz.c |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 28 | |
| 29 | test: 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_Troy | 3bde123 | 2012-09-22 08:10:28 -0400 | [diff] [blame] | 35 | 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_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 47 | |
| 48 | tests: dev test |
| 49 | ./pigzn -kf pigz.c ; ./pigz -t pigz.c.gz |
Dees_Troy | 3bde123 | 2012-09-22 08:10:28 -0400 | [diff] [blame] | 50 | @rm -f pigz.c.gz |
Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 51 | |
| 52 | docs: pigz.pdf |
| 53 | |
| 54 | pigz.pdf: pigz.1 |
| 55 | groff -mandoc -f H -T ps pigz.1 | ps2pdf - pigz.pdf |
| 56 | |
| 57 | clean: |
Dees_Troy | 3bde123 | 2012-09-22 08:10:28 -0400 | [diff] [blame] | 58 | @rm -f *.o pigz unpigz pigzn pigzt pigz.c.gz pigz.c.zz pigz.c.zip |