Rev 1905 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1905 | Rev 1907 | ||
---|---|---|---|
1 | # Makefile for zlib |
1 | # Makefile for zlib |
2 | # Copyright (C) 1995-2010 Jean-loup Gailly. |
2 | # Copyright (C) 1995-2010 Jean-loup Gailly. |
3 | # For conditions of distribution and use, see copyright notice in zlib.h |
3 | # For conditions of distribution and use, see copyright notice in zlib.h |
4 | 4 | ||
5 | CC=gcc |
5 | CC=gcc |
6 | CPP=gcc -E |
6 | CPP=gcc -E |
7 | 7 | ||
8 | CFLAGS= -O3 -c -fomit-frame-pointer |
8 | CFLAGS= -O3 -c -fomit-frame-pointer |
9 | 9 | ||
10 | LDIMPORT:= -nostdlib |
10 | LDIMPORT:= -nostdlib --out-implib libzimp.a |
11 | 11 | ||
12 | LDFLAGS:= -shared -s -T ../newlib/dll.lds -Map map --image-base 0 |
12 | LDFLAGS:= -shared -s -T ../newlib/dll.lds --image-base 0 |
13 | 13 | ||
14 | INCLUDES= -I../newlib/include |
14 | INCLUDES= -I../newlib/include |
15 | 15 | ||
16 | LIBPATH:= -L../newlib |
16 | LIBPATH:= -L../newlib |
17 | 17 | ||
18 | LIBS:= -lamz -lgcc -lcimp |
18 | LIBS:= -lamz -lgcc -lcimp |
19 | 19 | ||
20 | AR=ar rc |
20 | AR=ar rc |
21 | 21 | ||
22 | OBJC = adler32.o compress.o crc32.o deflate.o \ |
22 | OBJC = adler32.o compress.o crc32.o deflate.o \ |
23 | gzclose.o gzlib.o gzread.o gzwrite.o \ |
23 | gzclose.o gzlib.o gzread.o gzwrite.o \ |
24 | infback.o inffast.o inflate.o inftrees.o \ |
24 | infback.o inffast.o inflate.o inftrees.o \ |
25 | trees.o uncompr.o zutil.o |
25 | trees.o uncompr.o zutil.o |
26 | 26 | ||
27 | 27 | ||
28 | # to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo |
28 | # to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo |
29 | OBJA = |
29 | OBJA = |
30 | 30 | ||
31 | OBJS = $(OBJC) $(OBJA) |
31 | OBJS = $(OBJC) $(OBJA) |
32 | 32 | ||
33 | all: libz.a libz.dll |
33 | all: libz.a zlib.dll |
34 | 34 | ||
35 | libz.a: $(OBJS) |
35 | libz.a: $(OBJS) |
36 | $(AR) $@ $(OBJS) |
36 | $(AR) $@ $(OBJS) |
37 | 37 | ||
38 | libz.dll: $(OBJECTS) Makefile |
38 | zlib.dll: $(OBJECTS) Makefile |
39 | dlltool -d zlib.def -Dlibz.dll -e exports.o -l libzimp.a |
39 | # dlltool -d zlib.def -Dlibz.dll -e exports.o -l libzimp.a |
40 | ld $(LDFLAGS) $(LDIMPORT) --exclude-all-symbols $(LIBPATH) -o $@ $(OBJS) exports.o $(LIBS) |
40 | ld $(LDFLAGS) $(LDIMPORT) $(LIBPATH) -o $@ $(OBJS) $(LIBS) zlib.def |
41 | 41 | ||
42 | 42 | ||
43 | %.o: %.c Makefile |
43 | %.o: %.c Makefile |
44 | $(CC) $(CFLAGS) $(INCLUDES) -o $@ $<> |
44 | $(CC) $(CFLAGS) $(INCLUDES) -o $@ $<> |