mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
330 lines
11 KiB
Makefile
330 lines
11 KiB
Makefile
# Makefile for zlib
|
|
# Copyright (C) 1995-2013 Jean-loup Gailly, Mark Adler
|
|
# For conditions of distribution and use, see copyright notice in zlib.h
|
|
|
|
# To compile and test, type:
|
|
# ./configure; make test
|
|
# Normally configure builds both a static and a shared library.
|
|
# If you want to build just a static library, use: ./configure --static
|
|
|
|
# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
|
|
# make install
|
|
# To install in $HOME instead of /usr/local, use:
|
|
# make install prefix=$HOME
|
|
|
|
CC=cc
|
|
|
|
CFLAGS=-O
|
|
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
|
|
#CFLAGS=-g -DDEBUG
|
|
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
|
|
# -Wstrict-prototypes -Wmissing-prototypes
|
|
|
|
SFLAGS=-O
|
|
LDFLAGS=
|
|
TEST_LDFLAGS=-L. libz.a
|
|
LDSHARED=$(CC)
|
|
|
|
STATICLIB=libz.a
|
|
SHAREDLIB=libz.so
|
|
SHAREDLIBV=libz.so.1.2.8
|
|
SHAREDLIBM=libz.so.1
|
|
IMPORTLIB=
|
|
SHAREDTARGET=libz.so.1.2.8
|
|
|
|
LIBS=$(STATICLIB) $(SHAREDTARGET)
|
|
|
|
AR=ar
|
|
ARFLAGS=rc
|
|
DEFFILE=
|
|
RC=
|
|
RCFLAGS=
|
|
RCOBJS=
|
|
STRIP=
|
|
RANLIB=ranlib
|
|
LDCONFIG=ldconfig
|
|
LDSHAREDLIBC=-lc
|
|
TAR=tar
|
|
SHELL=/bin/sh
|
|
EXE=
|
|
|
|
SRCDIR=.
|
|
INCLUDES=-I$(SRCDIR)
|
|
|
|
ARCHDIR=arch/generic
|
|
ARCH_STATIC_OBJS=
|
|
ARCH_SHARED_OBJS=
|
|
|
|
prefix = /usr/local
|
|
exec_prefix = ${prefix}
|
|
bindir = ${exec_prefix}/bin
|
|
libdir = ${exec_prefix}/lib
|
|
sharedlibdir = ${libdir}
|
|
includedir = ${prefix}/include
|
|
mandir = ${prefix}/share/man
|
|
man3dir = ${mandir}/man3
|
|
pkgconfigdir = ${libdir}/pkgconfig
|
|
|
|
OBJZ = adler32.o compress.o crc32.o deflate.o deflate_fast.o deflate_medium.o deflate_slow.o match.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o $(ARCH_STATIC_OBJS)
|
|
OBJG = gzclose.o gzlib.o gzread.o gzwrite.o
|
|
OBJC = $(OBJZ) $(OBJG)
|
|
|
|
PIC_OBJZ = adler32.lo compress.lo crc32.lo deflate.lo deflate_fast.lo deflate_medium.lo deflate_slow.lo match.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo $(ARCH_SHARED_OBJS)
|
|
PIC_OBJG = gzclose.lo gzlib.lo gzread.lo gzwrite.lo
|
|
PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG)
|
|
|
|
OBJS = $(OBJC)
|
|
|
|
PIC_OBJS = $(PIC_OBJC)
|
|
|
|
all: static shared
|
|
|
|
static: example$(EXE) minigzip$(EXE)
|
|
|
|
shared: examplesh$(EXE) minigzipsh$(EXE)
|
|
|
|
all64: example64$(EXE) minigzip64$(EXE)
|
|
|
|
check: test
|
|
|
|
$(ARCHDIR)/%.o: $(SRCDIR)/$(ARCHDIR)/%.c
|
|
$(MAKE) -C $(ARCHDIR) $(notdir $@)
|
|
|
|
$(ARCHDIR)/%.lo: $(SRCDIR)/$(ARCHDIR)/%.c
|
|
$(MAKE) -C $(ARCHDIR) $(notdir $@)
|
|
|
|
%.o: $(ARCHDIR)/%.o
|
|
-cp $< $@
|
|
|
|
%.lo: $(ARCHDIR)/%.lo
|
|
-cp $< $@
|
|
|
|
test: all
|
|
$(MAKE) -C test
|
|
|
|
infcover.o: $(SRCDIR)/test/infcover.c $(SRCDIR)/zlib.h zconf.h
|
|
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/test/infcover.c
|
|
|
|
infcover$(EXE): infcover.o $(STATICLIB)
|
|
$(CC) $(CFLAGS) -o $@ infcover.o $(STATICLIB)
|
|
ifneq ($(STRIP),)
|
|
$(STRIP) $@
|
|
endif
|
|
|
|
cover: infcover$(EXE)
|
|
rm -f *.gcda
|
|
./infcover
|
|
gcov inf*.c
|
|
|
|
$(STATICLIB): $(OBJS)
|
|
$(AR) $(ARFLAGS) $@ $(OBJS)
|
|
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
|
|
|
|
example.o: $(SRCDIR)/test/example.c $(SRCDIR)/zlib.h zconf.h
|
|
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/test/example.c
|
|
|
|
minigzip.o: $(SRCDIR)/test/minigzip.c $(SRCDIR)/zlib.h zconf.h
|
|
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $(SRCDIR)/test/minigzip.c
|
|
|
|
example64.o: $(SRCDIR)/test/example.c $(SRCDIR)/zlib.h zconf.h
|
|
$(CC) $(CFLAGS) $(INCLUDES) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)/test/example.c
|
|
|
|
minigzip64.o: $(SRCDIR)/test/minigzip.c $(SRCDIR)/zlib.h zconf.h
|
|
$(CC) $(CFLAGS) $(INCLUDES) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)/test/minigzip.c
|
|
|
|
zlibrc.o: win32/zlib1.rc
|
|
$(RC) $(RCFLAGS) -o $@ win32/zlib1.rc
|
|
|
|
.SUFFIXES: .lo
|
|
|
|
%.o: $(SRCDIR)/%.c
|
|
$(CC) $(INCLUDES) $(CFLAGS) -c -o $@ $<
|
|
|
|
%.lo: $(SRCDIR)/%.c
|
|
$(CC) $(INCLUDES) $(SFLAGS) -DPIC -c -o $@ $<
|
|
|
|
$(SHAREDTARGET): $(PIC_OBJS) $(DEFFILE) $(RCOBJS)
|
|
ifneq ($(SHAREDTARGET),)
|
|
$(LDSHARED) $(SFLAGS) -o $@ $(DEFFILE) $(PIC_OBJS) $(RCOBJS) $(LDSHAREDLIBC) $(LDFLAGS)
|
|
ifneq ($(STRIP),)
|
|
$(STRIP) $@
|
|
endif
|
|
ifneq ($(SHAREDLIB),$(SHAREDTARGET))
|
|
rm -f $(SHAREDLIB) $(SHAREDLIBM)
|
|
ln -s $@ $(SHAREDLIB)
|
|
ln -s $@ $(SHAREDLIBM)
|
|
endif
|
|
endif
|
|
|
|
example$(EXE): example.o $(STATICLIB)
|
|
$(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
|
|
ifneq ($(STRIP),)
|
|
$(STRIP) $@
|
|
endif
|
|
|
|
minigzip$(EXE): minigzip.o $(STATICLIB)
|
|
$(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
|
|
ifneq ($(STRIP),)
|
|
$(STRIP) $@
|
|
endif
|
|
|
|
examplesh$(EXE): example.o $(SHAREDTARGET)
|
|
$(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDTARGET)
|
|
ifneq ($(STRIP),)
|
|
$(STRIP) $@
|
|
endif
|
|
|
|
minigzipsh$(EXE): minigzip.o $(SHAREDTARGET)
|
|
$(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDTARGET)
|
|
ifneq ($(STRIP),)
|
|
$(STRIP) $@
|
|
endif
|
|
|
|
example64$(EXE): example64.o $(STATICLIB)
|
|
$(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
|
|
ifneq ($(STRIP),)
|
|
$(STRIP) $@
|
|
endif
|
|
|
|
minigzip64$(EXE): minigzip64.o $(STATICLIB)
|
|
$(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
|
|
ifneq ($(STRIP),)
|
|
$(STRIP) $@
|
|
endif
|
|
|
|
install-shared: $(SHAREDTARGET)
|
|
ifneq ($(SHAREDTARGET),)
|
|
-@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi
|
|
cp $(SHAREDTARGET) $(DESTDIR)$(sharedlibdir)
|
|
chmod 644 $(DESTDIR)$(sharedlibdir)/$(SHAREDTARGET)
|
|
ifneq ($(SHAREDLIB),$(SHAREDTARGET))
|
|
rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM)
|
|
ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB)
|
|
ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM)
|
|
($(LDCONFIG) || true) >/dev/null 2>&1
|
|
# ldconfig is for Linux
|
|
endif
|
|
ifneq ($(IMPORTLIB),)
|
|
cp $(IMPORTLIB) $(DESTDIR)$(sharedlibdir)
|
|
chmod 644 $(DESTDIR)$(sharedlibdir)/$(IMPORTLIB)
|
|
endif
|
|
endif
|
|
|
|
install-static: $(STATICLIB)
|
|
-@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
|
|
cp $(STATICLIB) $(DESTDIR)$(libdir)
|
|
chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB)
|
|
-@($(RANLIB) $(DESTDIR)$(libdir)/$(STATICLIB) || true) >/dev/null 2>&1
|
|
# The ranlib in install-static is needed on NeXTSTEP which checks file times
|
|
|
|
install-libs: install-shared install-static
|
|
-@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
|
|
-@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
|
|
cp $(SRCDIR)/zlib.3 $(DESTDIR)$(man3dir)
|
|
chmod 644 $(DESTDIR)$(man3dir)/zlib.3
|
|
cp zlib.pc $(DESTDIR)$(pkgconfigdir)
|
|
chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
|
|
|
|
install: install-libs
|
|
-@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
|
|
cp $(SRCDIR)/zlib.h zconf.h $(DESTDIR)$(includedir)
|
|
chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
|
|
|
|
uninstall-static:
|
|
cd $(DESTDIR)$(libdir) && rm -f $(STATICLIB)
|
|
|
|
uninstall-shared:
|
|
ifneq ($(SHAREDLIB),)
|
|
cd $(DESTDIR)$(sharedlibdir) && rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM)
|
|
endif
|
|
ifneq ($(IMPORTLIB),)
|
|
cd $(DESTDIR)$(sharedlibdir) && rm -f $(IMPORTLIB)
|
|
endif
|
|
|
|
uninstall: uninstall-static uninstall-shared
|
|
cd $(DESTDIR)$(includedir) && rm -f zlib.h zconf.h
|
|
cd $(DESTDIR)$(man3dir) && rm -f zlib.3
|
|
cd $(DESTDIR)$(pkgconfigdir) && rm -f zlib.pc
|
|
|
|
docs: zlib.3.pdf
|
|
|
|
zlib.3.pdf: $(SRCDIR)/zlib.3
|
|
groff -mandoc -f H -T ps $(SRCDIR)/zlib.3 | ps2pdf - zlib.3.pdf
|
|
|
|
mostlyclean: clean
|
|
clean:
|
|
@if [ -f $(ARCHDIR)/Makefile ]; then $(MAKE) -C $(ARCHDIR) clean; fi
|
|
@if [ -f test/Makefile ]; then $(MAKE) -C test clean; fi
|
|
rm -f *.o *.lo *~ \
|
|
example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
|
|
example64$(EXE) minigzip64$(EXE) \
|
|
infcover \
|
|
$(STATICLIB) $(IMPORTLIB) $(SHAREDLIB) $(SHAREDLIBV) $(SHAREDLIBM) \
|
|
foo.gz so_locations \
|
|
_match.s maketree
|
|
rm -rf objs
|
|
rm -f *.gcda *.gcno *.gcov
|
|
rm -f a.out
|
|
|
|
maintainer-clean: distclean
|
|
distclean: clean
|
|
@if [ -f $(ARCHDIR)/Makefile ]; then $(MAKE) -C $(ARCHDIR) distclean; fi
|
|
@if [ -f test/Makefile ]; then $(MAKE) -C test distclean; fi
|
|
rm -f zlib.pc configure.log zconf.h zconf.h.cmakein
|
|
-@rm -f .DS_Store
|
|
# Reset Makefile if building inside source tree
|
|
@if [ -f Makefile.in ]; then \
|
|
printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile ; \
|
|
printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile ; \
|
|
touch -r $(SRCDIR)/Makefile.in Makefile ; fi
|
|
# Reset zconf.h and zconf.h.cmakein if building inside source tree
|
|
@if [ -f zconf.h.in ]; then \
|
|
cp -p $(SRCDIR)/zconf.h.in zconf.h ; \
|
|
TEMPFILE=zconfh_$$ ; \
|
|
echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
|
|
sed -f $$TEMPFILE $(SRCDIR)/zconf.h.in > zconf.h.cmakein &&\
|
|
touch -r $(SRCDIR)/zconf.h.in zconf.h.cmakein &&\
|
|
rm $$TEMPFILE ; fi
|
|
# Cleanup these files if building outside source tree
|
|
@if [ ! -f zlib.3 ]; then rm -f zlib.3.pdf Makefile; fi
|
|
# Remove arch and test directory if building outside source tree
|
|
@if [ ! -f $(ARCHDIR)/Makefile.in ]; then rm -rf arch; fi
|
|
@if [ ! -f test/Makefile.in ]; then rm -rf test; fi
|
|
|
|
tags:
|
|
etags $(SRCDIR)/*.[ch]
|
|
|
|
depend:
|
|
makedepend -- $(CFLAGS) -- $(SRCDIR)/*.[ch]
|
|
makedepend -a -o.lo -- $(SFLAGS) -- $(SRCDIR)/*.[ch]
|
|
@sed "s=^$(SRCDIR)/\([a-zA-Z0-9_]*\.\(lo\|o\):\)=\1=g" < Makefile > Makefile.tmp
|
|
@mv -f Makefile.tmp Makefile
|
|
|
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
|
|
|
adler32.o zutil.o: $(SRCDIR)/zutil.h $(SRCDIR)/zlib.h zconf.h
|
|
gzclose.o gzlib.o gzread.o gzwrite.o: $(SRCDIR)/zlib.h zconf.h $(SRCDIR)/gzguts.h
|
|
compress.o example.o minigzip.o uncompr.o: $(SRCDIR)/zlib.h zconf.h
|
|
crc32.o: $(SRCDIR)/zutil.h $(SRCDIR)/zlib.h zconf.h $(SRCDIR)/crc32.h
|
|
deflate.o: $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/match.h $(SRCDIR)/zutil.h $(SRCDIR)/zlib.h zconf.h
|
|
deflate_fast.o: $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/match.h
|
|
deflate_medium.o: $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/match.h
|
|
deflate_slow.o: $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/match.h
|
|
infback.o inflate.o: $(SRCDIR)/zutil.h $(SRCDIR)/zlib.h zconf.h $(SRCDIR)/inftrees.h $(SRCDIR)/inflate.h $(SRCDIR)/inffast.h $(SRCDIR)/inffixed.h
|
|
inffast.o: $(SRCDIR)/zutil.h $(SRCDIR)/zlib.h zconf.h $(SRCDIR)/inftrees.h $(SRCDIR)/inflate.h $(SRCDIR)/inffast.h
|
|
inftrees.o: $(SRCDIR)/zutil.h $(SRCDIR)/zlib.h zconf.h $(SRCDIR)/inftrees.h
|
|
trees.o: $(SRCDIR)/deflate.h $(SRCDIR)/zutil.h $(SRCDIR)/zlib.h zconf.h $(SRCDIR)/trees.h
|
|
|
|
adler32.lo zutil.lo: $(SRCDIR)/zutil.h $(SRCDIR)/zlib.h zconf.h
|
|
gzclose.lo gzlib.lo gzread.lo gzwrite.lo: $(SRCDIR)/zlib.h zconf.h $(SRCDIR)/gzguts.h
|
|
compress.lo example.lo minigzip.lo uncompr.lo: $(SRCDIR)/zlib.h zconf.h
|
|
crc32.lo: $(SRCDIR)/zutil.h $(SRCDIR)/zlib.h zconf.h $(SRCDIR)/crc32.h
|
|
deflate.lo: $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/match.h $(SRCDIR)/zutil.h $(SRCDIR)/zlib.h zconf.h
|
|
deflate_fast.lo: $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/match.h
|
|
deflate_medium.lo: $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/match.h
|
|
deflate_slow.lo: $(SRCDIR)/deflate.h $(SRCDIR)/deflate_p.h $(SRCDIR)/match.h
|
|
infback.lo inflate.lo: $(SRCDIR)/zutil.h $(SRCDIR)/zlib.h zconf.h $(SRCDIR)/inftrees.h $(SRCDIR)/inflate.h $(SRCDIR)/inffast.h $(SRCDIR)/inffixed.h
|
|
inffast.lo: $(SRCDIR)/zutil.h $(SRCDIR)/zlib.h zconf.h $(SRCDIR)/inftrees.h $(SRCDIR)/inflate.h $(SRCDIR)/inffast.h
|
|
inftrees.lo: $(SRCDIR)/zutil.h $(SRCDIR)/zlib.h zconf.h $(SRCDIR)/inftrees.h
|
|
trees.lo: $(SRCDIR)/deflate.h $(SRCDIR)/zutil.h $(SRCDIR)/zlib.h zconf.h $(SRCDIR)/trees.h
|