diff options
Diffstat (limited to 'win32/Makefile.gcc')
-rw-r--r-- | win32/Makefile.gcc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/win32/Makefile.gcc b/win32/Makefile.gcc index 7f9973b..da32859 100644 --- a/win32/Makefile.gcc +++ b/win32/Makefile.gcc | |||
@@ -16,7 +16,7 @@ | |||
16 | # | 16 | # |
17 | 17 | ||
18 | LIB = libz.a | 18 | LIB = libz.a |
19 | SHAREDLIB = libz.so | 19 | SHAREDLIB = zlib.dll |
20 | VER = 1.2.0 | 20 | VER = 1.2.0 |
21 | 21 | ||
22 | CC = gcc | 22 | CC = gcc |
@@ -32,6 +32,8 @@ LDFLAGS = $(LOC) -s | |||
32 | AR = ar | 32 | AR = ar |
33 | ARFLAGS = rcs | 33 | ARFLAGS = rcs |
34 | 34 | ||
35 | RC = windres | ||
36 | |||
35 | CP = cp -fp | 37 | CP = cp -fp |
36 | # If GNU install is available, replace $(CP) with install. | 38 | # If GNU install is available, replace $(CP) with install. |
37 | INSTALL = $(CP) | 39 | INSTALL = $(CP) |
@@ -43,12 +45,14 @@ exec_prefix = $(prefix) | |||
43 | OBJS = adler32.o compress.o crc32.o deflate.o gzio.o infback.o \ | 45 | OBJS = adler32.o compress.o crc32.o deflate.o gzio.o infback.o \ |
44 | inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o | 46 | inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o |
45 | 47 | ||
48 | DLLDEF = win32/zlibgcc.def | ||
49 | |||
46 | # to use the asm code: make OBJA=match.o | 50 | # to use the asm code: make OBJA=match.o |
47 | OBJA = | 51 | OBJA = |
48 | 52 | ||
49 | TEST_OBJS = example.o minigzip.o | 53 | TEST_OBJS = example.o minigzip.o |
50 | 54 | ||
51 | all: $(LIB) example minigzip | 55 | all: $(LIB) $(SHAREDLIB) example minigzip |
52 | 56 | ||
53 | test: all | 57 | test: all |
54 | ./example | 58 | ./example |
@@ -60,12 +64,18 @@ test: all | |||
60 | libz.a: $(OBJS) | 64 | libz.a: $(OBJS) |
61 | $(AR) $(ARFLAGS) $@ $(OBJS) | 65 | $(AR) $(ARFLAGS) $@ $(OBJS) |
62 | 66 | ||
67 | $(SHAREDLIB): $(OBJS) $(DLLDEF) zlibrc.o | ||
68 | dllwrap --driver-name $(CC) --def $(DLLDEF) -o $@ $(OBJS) zlibrc.o | ||
69 | |||
63 | example: example.o $(LIB) | 70 | example: example.o $(LIB) |
64 | $(LD) -o $@ $< $(LIB) | 71 | $(LD) -o $@ $< $(LIB) |
65 | 72 | ||
66 | minigzip: minigzip.o $(LIB) | 73 | minigzip: minigzip.o $(LIB) |
67 | $(LD) -o $@ $< $(LIB) | 74 | $(LD) -o $@ $< $(LIB) |
68 | 75 | ||
76 | zlibrc.o: win32/zlib.rc | ||
77 | -$(RC) -o $@ --define GCC_WINDRES win32/zlib.rc | ||
78 | |||
69 | 79 | ||
70 | # INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env . | 80 | # INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env . |
71 | 81 | ||
@@ -87,6 +97,7 @@ clean: | |||
87 | $(RM) *.o | 97 | $(RM) *.o |
88 | $(RM) *.exe | 98 | $(RM) *.exe |
89 | $(RM) libz.a | 99 | $(RM) libz.a |
100 | $(RM) zlib.dll | ||
90 | $(RM) foo.gz | 101 | $(RM) foo.gz |
91 | 102 | ||
92 | adler32.o: zlib.h zconf.h | 103 | adler32.o: zlib.h zconf.h |