1 | # Makefile for zlib -- Microsoft (Visual) C
|
---|
2 | #
|
---|
3 | # Authors:
|
---|
4 | # Cosmin Truta, 11-Mar-2003
|
---|
5 | # Christian Spieler, 19-Mar-2003
|
---|
6 | #
|
---|
7 | # Last updated:
|
---|
8 | # Cosmin Truta, 27-Aug-2003
|
---|
9 | #
|
---|
10 | # Usage:
|
---|
11 | # nmake -f win32/Makefile.msc (standard build)
|
---|
12 | # nmake -f win32/Makefile.msc LOC=-DFOO (nonstandard build)
|
---|
13 | # nmake -f win32/Makefile.msc LOC=-DASMV OBJA=match.obj (use ASM code)
|
---|
14 |
|
---|
15 |
|
---|
16 | # optional build flags
|
---|
17 | LOC =
|
---|
18 |
|
---|
19 |
|
---|
20 | # variables
|
---|
21 | STATICLIB = zlib.lib
|
---|
22 | SHAREDLIB = zlib1.dll
|
---|
23 | IMPLIB = zdll.lib
|
---|
24 |
|
---|
25 | CC = cl
|
---|
26 | AS = ml
|
---|
27 | LD = link
|
---|
28 | AR = lib
|
---|
29 | RC = rc
|
---|
30 | CFLAGS = -nologo -MD -O2 $(LOC)
|
---|
31 | ASFLAGS = -coff
|
---|
32 | LDFLAGS = -nologo -release
|
---|
33 | ARFLAGS = -nologo
|
---|
34 | RCFLAGS = /dWIN32 /r
|
---|
35 |
|
---|
36 | OBJS = adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infback.obj \
|
---|
37 | inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
|
---|
38 | OBJA =
|
---|
39 |
|
---|
40 |
|
---|
41 | # targets
|
---|
42 | all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) \
|
---|
43 | example.exe minigzip.exe example_d.exe minigzip_d.exe
|
---|
44 |
|
---|
45 | $(STATICLIB): $(OBJS) $(OBJA)
|
---|
46 | $(AR) $(ARFLAGS) -out:$@ $(OBJS) $(OBJA)
|
---|
47 |
|
---|
48 | $(IMPLIB): $(SHAREDLIB)
|
---|
49 |
|
---|
50 | $(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlib1.res
|
---|
51 | $(LD) $(LDFLAGS) -def:win32/zlib.def -dll -implib:$(IMPLIB) \
|
---|
52 | -out:$@ $(OBJS) $(OBJA) zlib1.res
|
---|
53 |
|
---|
54 | example.exe: example.obj $(STATICLIB)
|
---|
55 | $(LD) $(LDFLAGS) example.obj $(STATICLIB)
|
---|
56 |
|
---|
57 | minigzip.exe: minigzip.obj $(STATICLIB)
|
---|
58 | $(LD) $(LDFLAGS) minigzip.obj $(STATICLIB)
|
---|
59 |
|
---|
60 | example_d.exe: example.obj $(IMPLIB)
|
---|
61 | $(LD) $(LDFLAGS) -out:$@ example.obj $(IMPLIB)
|
---|
62 |
|
---|
63 | minigzip_d.exe: minigzip.obj $(IMPLIB)
|
---|
64 | $(LD) $(LDFLAGS) -out:$@ minigzip.obj $(IMPLIB)
|
---|
65 |
|
---|
66 | .c.obj:
|
---|
67 | $(CC) -c $(CFLAGS) $<
|
---|
68 |
|
---|
69 | .asm.obj:
|
---|
70 | $(AS) -c $(ASFLAGS) $<
|
---|
71 |
|
---|
72 | adler32.obj: adler32.c zlib.h zconf.h
|
---|
73 |
|
---|
74 | compress.obj: compress.c zlib.h zconf.h
|
---|
75 |
|
---|
76 | crc32.obj: crc32.c zlib.h zconf.h crc32.h
|
---|
77 |
|
---|
78 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
|
---|
79 |
|
---|
80 | gzio.obj: gzio.c zutil.h zlib.h zconf.h
|
---|
81 |
|
---|
82 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
|
---|
83 | inffast.h inffixed.h
|
---|
84 |
|
---|
85 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
|
---|
86 | inffast.h
|
---|
87 |
|
---|
88 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
|
---|
89 | inffast.h inffixed.h
|
---|
90 |
|
---|
91 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
|
---|
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
|
---|