Skip to content

Commit

Permalink
Fix builds of pigzt and pigzn to include zopfli, at -lm.
Browse files Browse the repository at this point in the history
On some systems -lm is needed to link in the log function.
  • Loading branch information
madler committed Mar 5, 2013
1 parent 3b59589 commit c08cc12
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Makefile
Expand Up @@ -3,7 +3,7 @@ CFLAGS=-O3 -Wall -Wextra


pigz: pigz.o yarn.o zopfli/deflate.o zopfli/blocksplitter.o zopfli/tree.o zopfli/lz77.o zopfli/cache.o zopfli/hash.o zopfli/util.o zopfli/squeeze.o zopfli/katajainen.o
$(CC) -o pigz $^ -lpthread -lz
$(CC) -o pigz $^ -lpthread -lz -lm
ln -f pigz unpigz

pigz.o: pigz.c yarn.h zopfli/deflate.h zopfli/util.h
Expand All @@ -30,17 +30,17 @@ zopfli/katajainen.o: zopfli/katajainen.c zopfli/katajainen.h

dev: pigz pigzt pigzn

pigzt: pigzt.o yarnt.o
$(CC) -o pigzt pigzt.o yarnt.o -lpthread -lz
pigzt: pigzt.o yarnt.o zopfli/deflate.o zopfli/blocksplitter.o zopfli/tree.o zopfli/lz77.o zopfli/cache.o zopfli/hash.o zopfli/util.o zopfli/squeeze.o zopfli/katajainen.o
$(CC) -o pigzt $^ -lpthread -lz -lm

pigzt.o: pigz.c yarn.h
$(CC) -Wall -O3 -DDEBUG -g -c -o pigzt.o pigz.c

yarnt.o: yarn.c yarn.h
$(CC) -Wall -O3 -DDEBUG -g -c -o yarnt.o yarn.c

pigzn: pigzn.o
$(CC) -o pigzn pigzn.o -lz
pigzn: pigzn.o zopfli/deflate.o zopfli/blocksplitter.o zopfli/tree.o zopfli/lz77.o zopfli/cache.o zopfli/hash.o zopfli/util.o zopfli/squeeze.o zopfli/katajainen.o
$(CC) -o pigzn $^ -lz -lm

pigzn.o: pigz.c
$(CC) -Wall -O3 -DDEBUG -DNOTHREAD -g -c -o pigzn.o pigz.c
Expand Down

0 comments on commit c08cc12

Please sign in to comment.