2011-03-01 20:45:26 +01:00
|
|
|
# Makefile for zlib
|
|
|
|
# Copyright (C) 1995-2010 Jean-loup Gailly.
|
|
|
|
# For conditions of distribution and use, see copyright notice in zlib.h
|
|
|
|
|
|
|
|
CC=gcc
|
|
|
|
CPP=gcc -E
|
|
|
|
|
|
|
|
CFLAGS= -O3 -c -fomit-frame-pointer
|
|
|
|
|
2011-03-12 10:36:46 +01:00
|
|
|
LDIMPORT:= -nostdlib --out-implib libzimp.a
|
2011-03-04 06:55:41 +01:00
|
|
|
|
2011-03-12 10:36:46 +01:00
|
|
|
LDFLAGS:= -shared -s -T ../newlib/dll.lds --image-base 0
|
2011-03-04 06:55:41 +01:00
|
|
|
|
2011-03-01 20:45:26 +01:00
|
|
|
INCLUDES= -I../newlib/include
|
|
|
|
|
2011-03-04 06:55:41 +01:00
|
|
|
LIBPATH:= -L../newlib
|
2011-03-01 20:45:26 +01:00
|
|
|
|
2011-03-04 06:55:41 +01:00
|
|
|
LIBS:= -lamz -lgcc -lcimp
|
2011-03-01 20:45:26 +01:00
|
|
|
|
|
|
|
AR=ar rc
|
|
|
|
|
|
|
|
OBJC = adler32.o compress.o crc32.o deflate.o \
|
|
|
|
gzclose.o gzlib.o gzread.o gzwrite.o \
|
|
|
|
infback.o inffast.o inflate.o inftrees.o \
|
|
|
|
trees.o uncompr.o zutil.o
|
|
|
|
|
|
|
|
|
|
|
|
# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
|
|
|
|
OBJA =
|
|
|
|
|
|
|
|
OBJS = $(OBJC) $(OBJA)
|
|
|
|
|
2011-03-12 10:36:46 +01:00
|
|
|
all: libz.a zlib.dll
|
2011-03-01 20:45:26 +01:00
|
|
|
|
|
|
|
libz.a: $(OBJS)
|
|
|
|
$(AR) $@ $(OBJS)
|
|
|
|
|
2011-03-12 10:36:46 +01:00
|
|
|
zlib.dll: $(OBJECTS) Makefile
|
|
|
|
# dlltool -d zlib.def -Dlibz.dll -e exports.o -l libzimp.a
|
|
|
|
ld $(LDFLAGS) $(LDIMPORT) $(LIBPATH) -o $@ $(OBJS) $(LIBS) zlib.def
|
2011-03-04 06:55:41 +01:00
|
|
|
|
|
|
|
|
2011-03-01 20:45:26 +01:00
|
|
|
%.o: %.c Makefile
|
|
|
|
$(CC) $(CFLAGS) $(INCLUDES) -o $@ $<
|
|
|
|
|
|
|
|
|