diff options
Diffstat (limited to 'win32/Makefile.msc')
-rw-r--r-- | win32/Makefile.msc | 218 |
1 files changed, 126 insertions, 92 deletions
diff --git a/win32/Makefile.msc b/win32/Makefile.msc index 4dc8819..528ecaa 100644 --- a/win32/Makefile.msc +++ b/win32/Makefile.msc | |||
@@ -1,92 +1,126 @@ | |||
1 | # Makefile for Win32 zlib.dll and the static library zlibstat.lib | 1 | # Makefile for zlib -- Microsoft (Visual) C |
2 | # -- Microsoft (Visual) C. | 2 | # |
3 | # Author: Cosmin Truta, 11-Mar-2003 | 3 | # Authors: |
4 | # Christian Spieler, 19-Mar-2003 | 4 | # Cosmin Truta, 11-Mar-2003 |
5 | # | 5 | # Christian Spieler, 19-Mar-2003 |
6 | # Usage: nmake -f win32/Makefile.msc | 6 | # |
7 | 7 | # Last updated: | |
8 | CC = cl | 8 | # Cosmin Truta, 27-Aug-2003 |
9 | LD = cl | 9 | # |
10 | RC = rc | 10 | # Usage: |
11 | CFLAGS = -nologo -MD -O2 | 11 | # nmake -f win32/Makefile.msc (standard build) |
12 | LDFLAGS = -nologo | 12 | # nmake -f win32/Makefile.msc LOC=-DFOO (nonstandard build) |
13 | 13 | # nmake -f win32/Makefile.msc LOC=-DASMV OBJA=match.obj (use ASM code) | |
14 | OBJS = adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infback.obj \ | 14 | |
15 | inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj | 15 | |
16 | 16 | # optional build flags | |
17 | # targets | 17 | LOC = |
18 | all: zlib.dll zlibstat.lib example.exe minigzip.exe exampl_s.exe minigz_s.exe | 18 | |
19 | 19 | ||
20 | zlibstat.lib: $(OBJS) | 20 | # variables |
21 | lib -out:$@ $(OBJS) | 21 | STATICLIB = zlib.lib |
22 | 22 | SHAREDLIB = zlib1.dll | |
23 | zlib.dll: $(OBJS) zlib.res win32/zlib.def | 23 | IMPLIB = zdll.lib |
24 | link -release -def:win32/zlib.def -dll -out:$@ $(OBJS) zlib.res | 24 | |
25 | 25 | CC = cl | |
26 | zlib.lib: zlib.dll | 26 | AS = ml |
27 | 27 | LD = link | |
28 | example.exe: example.obj zlib.lib | 28 | AR = lib |
29 | $(LD) $(LDFLAGS) example.obj zlib.lib | 29 | RC = rc |
30 | 30 | CFLAGS = -nologo -MD -O2 $(LOC) | |
31 | minigzip.exe: minigzip.obj zlib.lib | 31 | ASFLAGS = -coff |
32 | $(LD) $(LDFLAGS) minigzip.obj zlib.lib | 32 | LDFLAGS = -nologo -release |
33 | 33 | ARFLAGS = -nologo | |
34 | exampl_s.exe: example.obj zlibstat.lib | 34 | RCFLAGS = /dWIN32 /r |
35 | $(LD) $(LDFLAGS) -o $@ example.obj zlibstat.lib | 35 | |
36 | 36 | OBJS = adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infback.obj \ | |
37 | minigz_s.exe: minigzip.obj zlibstat.lib | 37 | inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj |
38 | $(LD) $(LDFLAGS) -o $@ minigzip.obj zlibstat.lib | 38 | OBJA = |
39 | 39 | ||
40 | .c.obj: | 40 | |
41 | $(CC) -c $(CFLAGS) $< | 41 | # targets |
42 | 42 | all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) \ | |
43 | zlib.res: win32/zlib.rc | 43 | example.exe minigzip.exe example_d.exe minigzip_d.exe |
44 | $(RC) /l 0x409 /fo$@ /d WIN32 win32/zlib.rc | 44 | |
45 | 45 | $(STATICLIB): $(OBJS) $(OBJA) | |
46 | adler32.obj: adler32.c zlib.h zconf.h | 46 | $(AR) $(ARFLAGS) -out:$@ $(OBJS) $(OBJA) |
47 | 47 | ||
48 | compress.obj: compress.c zlib.h zconf.h | 48 | $(IMPLIB): $(SHAREDLIB) |
49 | 49 | ||
50 | crc32.obj: crc32.c zlib.h zconf.h crc32.h | 50 | $(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlib1.res |
51 | 51 | $(LD) $(LDFLAGS) -def:win32/zlib.def -dll -implib:$(IMPLIB) \ | |
52 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h | 52 | -out:$@ $(OBJS) $(OBJA) zlib1.res |
53 | 53 | ||
54 | gzio.obj: gzio.c zutil.h zlib.h zconf.h | 54 | example.exe: example.obj $(STATICLIB) |
55 | 55 | $(LD) $(LDFLAGS) example.obj $(STATICLIB) | |
56 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ | 56 | |
57 | inffast.h inffixed.h | 57 | minigzip.exe: minigzip.obj $(STATICLIB) |
58 | 58 | $(LD) $(LDFLAGS) minigzip.obj $(STATICLIB) | |
59 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ | 59 | |
60 | inffast.h | 60 | example_d.exe: example.obj $(IMPLIB) |
61 | 61 | $(LD) $(LDFLAGS) -out:$@ example.obj $(IMPLIB) | |
62 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ | 62 | |
63 | inffast.h inffixed.h | 63 | minigzip_d.exe: minigzip.obj $(IMPLIB) |
64 | 64 | $(LD) $(LDFLAGS) -out:$@ minigzip.obj $(IMPLIB) | |
65 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h | 65 | |
66 | 66 | .c.obj: | |
67 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h | 67 | $(CC) -c $(CFLAGS) $< |
68 | 68 | ||
69 | uncompr.obj: uncompr.c zlib.h zconf.h | 69 | .asm.obj: |
70 | 70 | $(AS) -c $(ASFLAGS) $< | |
71 | zutil.obj: zutil.c zutil.h zlib.h zconf.h | 71 | |
72 | 72 | adler32.obj: adler32.c zlib.h zconf.h | |
73 | example.obj: example.c zlib.h zconf.h | 73 | |
74 | 74 | compress.obj: compress.c zlib.h zconf.h | |
75 | minigzip.obj: minigzip.c zlib.h zconf.h | 75 | |
76 | 76 | crc32.obj: crc32.c zlib.h zconf.h crc32.h | |
77 | # testing | 77 | |
78 | test: example.exe minigzip.exe | 78 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h |
79 | example | 79 | |
80 | echo hello world | minigzip | minigzip -d | 80 | gzio.obj: gzio.c zutil.h zlib.h zconf.h |
81 | 81 | ||
82 | teststat: exampl_s.exe minigz_s.exe | 82 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ |
83 | exampl_s | 83 | inffast.h inffixed.h |
84 | echo hello world | minigz_s | minigz_s -d | 84 | |
85 | 85 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ | |
86 | # cleanup | 86 | inffast.h |
87 | clean: | 87 | |
88 | del *.obj | 88 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ |
89 | del *.dll | 89 | inffast.h inffixed.h |
90 | del *.lib | 90 | |
91 | del *.exp | 91 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h |
92 | del *.exe | 92 | |
93 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h | ||
94 | |||
95 | uncompr.obj: uncompr.c zlib.h zconf.h | ||
96 | |||
97 | zutil.obj: zutil.c zutil.h zlib.h zconf.h | ||
98 | |||
99 | example.obj: example.c zlib.h zconf.h | ||
100 | |||
101 | minigzip.obj: minigzip.c zlib.h zconf.h | ||
102 | |||
103 | zlib1.res: win32/zlib1.rc | ||
104 | $(RC) $(RCFLAGS) /fo$@ win32/zlib1.rc | ||
105 | |||
106 | |||
107 | # testing | ||
108 | test: example.exe minigzip.exe | ||
109 | example | ||
110 | echo hello world | minigzip | minigzip -d | ||
111 | |||
112 | testdll: example_d.exe minigzip_d.exe | ||
113 | example_d | ||
114 | echo hello world | minigzip_d | minigzip_d -d | ||
115 | |||
116 | |||
117 | # cleanup | ||
118 | clean: | ||
119 | -del $(STATICLIB) | ||
120 | -del $(SHAREDLIB) | ||
121 | -del $(IMPLIB) | ||
122 | -del *.obj | ||
123 | -del *.res | ||
124 | -del *.exp | ||
125 | -del *.exe | ||
126 | -del foo.gz | ||