zlib/Makefile

74 lines
2.0 KiB
Makefile
Raw Normal View History

2011-09-10 02:07:35 -04:00
# Makefile for zlib
# Copyright (C) 1995 Jean-loup Gailly.
# For conditions of distribution and use, see copyright notice in zlib.h
2011-09-10 01:36:31 -04:00
CC=cc
CFLAGS=-O
2011-09-10 02:08:07 -04:00
#use -O3 for gcc to take advantage of inlining
2011-09-10 02:07:35 -04:00
#CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
2011-09-10 01:36:31 -04:00
#CFLAGS=-g -DDEBUG
2011-09-10 02:09:18 -04:00
LDFLAGS=-L. -lz
2011-09-10 01:36:31 -04:00
RANLIB=ranlib
2011-09-10 02:07:35 -04:00
prefix=/usr/local
2011-09-10 01:36:31 -04:00
OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
2011-09-10 01:52:17 -04:00
zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
2011-09-10 01:36:31 -04:00
2011-09-10 02:08:07 -04:00
TEST_OBJS = example.o minigzip.o
2011-09-10 01:36:31 -04:00
2011-09-10 02:08:07 -04:00
all: example minigzip
2011-09-10 01:36:31 -04:00
test: all
./example
echo hello world | ./minigzip | ./minigzip -d
2011-09-10 02:09:18 -04:00
install: libz.a
2011-09-10 02:07:35 -04:00
-@mkdir $(prefix)/include
-@mkdir $(prefix)/lib
cp zlib.h zconf.h $(prefix)/include
chmod 644 $(prefix)/include/zlib.h $(prefix)/include/zconf.h
2011-09-10 02:09:18 -04:00
cp libz.a $(prefix)/lib
chmod 644 $(prefix)/lib/libz.a
2011-09-10 02:07:35 -04:00
2011-09-10 02:09:18 -04:00
libz.a: $(OBJS)
2011-09-10 01:36:31 -04:00
ar rc $@ $(OBJS)
$(RANLIB) $@
2011-09-10 02:09:18 -04:00
example: example.o libz.a
2011-09-10 01:36:31 -04:00
$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
2011-09-10 02:09:18 -04:00
minigzip: minigzip.o libz.a
2011-09-10 01:36:31 -04:00
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
clean:
2011-09-10 02:09:18 -04:00
rm -f *.o example minigzip libz.a foo.gz
2011-09-10 01:36:31 -04:00
zip:
2011-09-10 02:09:18 -04:00
zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \
descrip.mms *.[ch]
2011-09-10 01:36:31 -04:00
tgz:
cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \
2011-09-10 02:09:18 -04:00
zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch]
2011-09-10 01:36:31 -04:00
# DO NOT DELETE THIS LINE -- make depend depends on it.
adler32.o: zutil.h zlib.h zconf.h
compress.o: zlib.h zconf.h
crc32.o: zutil.h zlib.h zconf.h
deflate.o: deflate.h zutil.h zlib.h zconf.h
example.o: zlib.h zconf.h
gzio.o: zutil.h zlib.h zconf.h
infblock.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
2011-09-10 01:52:17 -04:00
infcodes.o: zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h
inffast.o: zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
2011-09-10 01:36:31 -04:00
inflate.o: zutil.h zlib.h zconf.h infblock.h
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
infutil.o: zutil.h zlib.h zconf.h inftrees.h infutil.h
minigzip.o: zlib.h zconf.h
trees.o: deflate.h zutil.h zlib.h zconf.h
uncompr.o: zlib.h zconf.h
zutil.o: zutil.h zlib.h zconf.h