Subversion Repositories Kolibri OS

Rev

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

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