Subversion Repositories Kolibri OS

Rev

Rev 1907 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1907 Rev 3926
-
 
1
# Makefile for zlib, derived from Makefile.dj2.
-
 
2
# Modified for mingw32 by C. Spieler, 6/16/98.
-
 
3
# Updated for zlib 1.2.x by Christian Spieler and Cosmin Truta, Mar-2003.
1
# Makefile for zlib
4
# Last updated: Mar 2012.
-
 
5
# Tested under Cygwin and MinGW.
-
 
6
 
2
# Copyright (C) 1995-2010 Jean-loup Gailly.
7
# Copyright (C) 1995-2003 Jean-loup Gailly.
3
# For conditions of distribution and use, see copyright notice in zlib.h
8
# For conditions of distribution and use, see copyright notice in zlib.h
-
 
9
 
-
 
10
STATICLIB = libz.a
-
 
11
SHAREDLIB = zlib.dll
-
 
12
IMPLIB    = libz.dll.a
-
 
13
 
4
 
14
PREFIX =
-
 
15
CC = $(PREFIX)gcc
-
 
16
CFLAGS = $(LOC) -U_Win32 -U_WIN32 -U__MINGW32__ -O3 -Wall -fomit-frame-pointer 
5
CC=gcc
17
 
-
 
18
AS = $(CC)
-
 
19
ASFLAGS = $(LOC) -Wall
-
 
20
 
-
 
21
LD = ld
-
 
22
LDFLAGS = $(LOC)
-
 
23
 
-
 
24
AR = $(PREFIX)ar
6
CPP=gcc -E
25
ARFLAGS = rcs
7
 
26
 
8
CFLAGS= -O3 -c -fomit-frame-pointer
27
STRIP = $(PREFIX)strip
9
 
28
 
10
LDIMPORT:= -nostdlib --out-implib libzimp.a 
29
LDIMPORT:= -nostdlib --out-implib libzimp.a 
11
 
30
 
12
LDFLAGS:=  -shared -s -T ../newlib/dll.lds --image-base 0
31
LDFLAGS:=  -shared -s -nostdlib -T ../newlib/dll.lds --entry _DllStartup --image-base=0 --out-implib $(IMPLIB) 
13
 
32
 
14
INCLUDES= -I../newlib/include
33
INCLUDES= -I../newlib/include
15
 
34
 
16
LIBPATH:= -L../newlib
35
LIBPATH:= -L../newlib
17
 
36
 
18
LIBS:=  -lamz -lgcc -lcimp
-
 
19
 
-
 
20
AR=ar rc
-
 
21
 
-
 
22
OBJC =	adler32.o compress.o crc32.o deflate.o		\
-
 
23
	gzclose.o gzlib.o gzread.o gzwrite.o		\
-
 
24
	infback.o inffast.o inflate.o inftrees.o	\
-
 
25
	trees.o uncompr.o zutil.o
37
LIBS:=  -ldll -lc.dll
-
 
38
 
26
 
39
 
27
 
40
OBJS = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \
28
# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
-
 
29
OBJA =
41
       gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
30
 
42
OBJA =
31
OBJS = $(OBJC) $(OBJA)
43
 
32
 
-
 
33
all: libz.a zlib.dll
44
all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB)
-
 
45
 
-
 
46
 
-
 
47
.c.o:
-
 
48
	$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
-
 
49
 
-
 
50
.S.o:
-
 
51
	$(AS) $(ASFLAGS) -c -o $@ $<
-
 
52
 
-
 
53
$(STATICLIB): $(OBJS) $(OBJA)
-
 
54
	$(AR) $(ARFLAGS) $@ $(OBJS) $(OBJA)
34
 
-
 
35
libz.a: $(OBJS)
-
 
-
 
55
 
-
 
56
$(IMPLIB): $(SHAREDLIB)
-
 
57
 
-
 
58
$(SHAREDLIB): zlib.def $(OBJS) $(OBJA)
-
 
59
	$(LD) $(LDFLAGS) $(LIBPATH) -o $@ zlib.def $(OBJS) $(OBJA) $(LIBS) 
-
 
60
	$(STRIP) $@
-
 
61
	sed -f ../newlib/cmd1.sed zlib.def > mem
-
 
62
	sed -f ../newlib/cmd2.sed mem >zlib.inc 
-
 
63
 
-
 
64
 
-
 
65
 
-
 
66
adler32.o: zlib.h zconf.h
-
 
67
compress.o: zlib.h zconf.h
-
 
68
crc32.o: crc32.h zlib.h zconf.h
-
 
69
deflate.o: deflate.h zutil.h zlib.h zconf.h
36
	$(AR) $@ $(OBJS)
70
gzclose.o: zlib.h zconf.h gzguts.h
37
 
71
gzlib.o: zlib.h zconf.h gzguts.h
38
zlib.dll: $(OBJECTS) Makefile
72
gzread.o: zlib.h zconf.h gzguts.h
39
#	dlltool -d zlib.def -Dlibz.dll -e exports.o -l libzimp.a
73
gzwrite.o: zlib.h zconf.h gzguts.h
40
	ld $(LDFLAGS) $(LDIMPORT) $(LIBPATH) -o $@ $(OBJS) $(LIBS) zlib.def 
74
inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
41
 
75
inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
42
 
76
infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
43
%.o: %.c Makefile
77
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
44
	$(CC) $(CFLAGS) $(INCLUDES) -o $@ $<
78
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
-
 
79
uncompr.o: zlib.h zconf.h
-
 
80
zutil.o: zutil.h zlib.h zconf.h
-
 
81
 
-
 
82
$(STATICLIB):>
-
 
83
 
-
 
84
.S.o:
-
 
85
>