gdb/tui: Fix 'layout asm' before the inferior has started
[deliverable/binutils-gdb.git] / zlib / win32 / Makefile.msc
CommitLineData
5ca28f79 1# Makefile for zlib using Microsoft (Visual) C
9c7e3b0e 2# zlib is copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
5ca28f79
L
3#
4# Usage:
5# nmake -f win32/Makefile.msc (standard build)
6# nmake -f win32/Makefile.msc LOC=-DFOO (nonstandard build)
7# nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" \
8# OBJA="inffas32.obj match686.obj" (use ASM code, x86)
9# nmake -f win32/Makefile.msc AS=ml64 LOC="-DASMV -DASMINF -I." \
10# OBJA="inffasx64.obj gvmat64.obj inffas8664.obj" (use ASM code, x64)
11
da09a436
JB
12# The toplevel directory of the source tree.
13#
14TOP = .
15
5ca28f79
L
16# optional build flags
17LOC =
18
19# variables
20STATICLIB = zlib.lib
21SHAREDLIB = zlib1.dll
22IMPLIB = zdll.lib
23
24CC = cl
25AS = ml
26LD = link
27AR = lib
28RC = rc
29CFLAGS = -nologo -MD -W3 -O2 -Oy- -Zi -Fd"zlib" $(LOC)
30WFLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
31ASFLAGS = -coff -Zi $(LOC)
32LDFLAGS = -nologo -debug -incremental:no -opt:ref
33ARFLAGS = -nologo
34RCFLAGS = /dWIN32 /r
35
36OBJS = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj \
37 gzwrite.obj infback.obj inflate.obj inftrees.obj inffast.obj trees.obj uncompr.obj zutil.obj
38OBJA =
39
40
41# targets
42all: $(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
da09a436
JB
50$(SHAREDLIB): $(TOP)/win32/zlib.def $(OBJS) $(OBJA) zlib1.res
51 $(LD) $(LDFLAGS) -def:$(TOP)/win32/zlib.def -dll -implib:$(IMPLIB) \
5ca28f79
L
52 -out:$@ -base:0x5A4C0000 $(OBJS) $(OBJA) zlib1.res
53 if exist $@.manifest \
54 mt -nologo -manifest $@.manifest -outputresource:$@;2
55
56example.exe: example.obj $(STATICLIB)
57 $(LD) $(LDFLAGS) example.obj $(STATICLIB)
58 if exist $@.manifest \
59 mt -nologo -manifest $@.manifest -outputresource:$@;1
60
61minigzip.exe: minigzip.obj $(STATICLIB)
62 $(LD) $(LDFLAGS) minigzip.obj $(STATICLIB)
63 if exist $@.manifest \
64 mt -nologo -manifest $@.manifest -outputresource:$@;1
65
66example_d.exe: example.obj $(IMPLIB)
67 $(LD) $(LDFLAGS) -out:$@ example.obj $(IMPLIB)
68 if exist $@.manifest \
69 mt -nologo -manifest $@.manifest -outputresource:$@;1
70
71minigzip_d.exe: minigzip.obj $(IMPLIB)
72 $(LD) $(LDFLAGS) -out:$@ minigzip.obj $(IMPLIB)
73 if exist $@.manifest \
74 mt -nologo -manifest $@.manifest -outputresource:$@;1
75
da09a436 76{$(TOP)}.c.obj:
5ca28f79
L
77 $(CC) -c $(WFLAGS) $(CFLAGS) $<
78
da09a436
JB
79{$(TOP)/test}.c.obj:
80 $(CC) -c -I$(TOP) $(WFLAGS) $(CFLAGS) $<
5ca28f79 81
da09a436 82{$(TOP)/contrib/masmx64}.c.obj:
5ca28f79
L
83 $(CC) -c $(WFLAGS) $(CFLAGS) $<
84
da09a436 85{$(TOP)/contrib/masmx64}.asm.obj:
5ca28f79
L
86 $(AS) -c $(ASFLAGS) $<
87
da09a436 88{$(TOP)/contrib/masmx86}.asm.obj:
5ca28f79
L
89 $(AS) -c $(ASFLAGS) $<
90
da09a436 91adler32.obj: $(TOP)/adler32.c $(TOP)/zlib.h $(TOP)/zconf.h
5ca28f79 92
da09a436 93compress.obj: $(TOP)/compress.c $(TOP)/zlib.h $(TOP)/zconf.h
5ca28f79 94
da09a436 95crc32.obj: $(TOP)/crc32.c $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/crc32.h
5ca28f79 96
da09a436 97deflate.obj: $(TOP)/deflate.c $(TOP)/deflate.h $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h
5ca28f79 98
da09a436 99gzclose.obj: $(TOP)/gzclose.c $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/gzguts.h
5ca28f79 100
da09a436 101gzlib.obj: $(TOP)/gzlib.c $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/gzguts.h
5ca28f79 102
da09a436 103gzread.obj: $(TOP)/gzread.c $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/gzguts.h
5ca28f79 104
da09a436 105gzwrite.obj: $(TOP)/gzwrite.c $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/gzguts.h
5ca28f79 106
da09a436
JB
107infback.obj: $(TOP)/infback.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/inftrees.h $(TOP)/inflate.h \
108 $(TOP)/inffast.h $(TOP)/inffixed.h
5ca28f79 109
da09a436
JB
110inffast.obj: $(TOP)/inffast.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/inftrees.h $(TOP)/inflate.h \
111 $(TOP)/inffast.h
5ca28f79 112
da09a436
JB
113inflate.obj: $(TOP)/inflate.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/inftrees.h $(TOP)/inflate.h \
114 $(TOP)/inffast.h $(TOP)/inffixed.h
5ca28f79 115
da09a436 116inftrees.obj: $(TOP)/inftrees.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/inftrees.h
5ca28f79 117
da09a436 118trees.obj: $(TOP)/trees.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h $(TOP)/deflate.h $(TOP)/trees.h
5ca28f79 119
da09a436 120uncompr.obj: $(TOP)/uncompr.c $(TOP)/zlib.h $(TOP)/zconf.h
5ca28f79 121
da09a436 122zutil.obj: $(TOP)/zutil.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h
5ca28f79 123
da09a436 124gvmat64.obj: $(TOP)/contrib\masmx64\gvmat64.asm
5ca28f79 125
da09a436 126inffasx64.obj: $(TOP)/contrib\masmx64\inffasx64.asm
5ca28f79 127
da09a436
JB
128inffas8664.obj: $(TOP)/contrib\masmx64\inffas8664.c $(TOP)/zutil.h $(TOP)/zlib.h $(TOP)/zconf.h \
129 $(TOP)/inftrees.h $(TOP)/inflate.h $(TOP)/inffast.h
5ca28f79 130
da09a436 131inffas32.obj: $(TOP)/contrib\masmx86\inffas32.asm
5ca28f79 132
da09a436 133match686.obj: $(TOP)/contrib\masmx86\match686.asm
5ca28f79 134
da09a436 135example.obj: $(TOP)/test/example.c $(TOP)/zlib.h $(TOP)/zconf.h
5ca28f79 136
da09a436 137minigzip.obj: $(TOP)/test/minigzip.c $(TOP)/zlib.h $(TOP)/zconf.h
5ca28f79 138
da09a436
JB
139zlib1.res: $(TOP)/win32/zlib1.rc
140 $(RC) $(RCFLAGS) /fo$@ $(TOP)/win32/zlib1.rc
5ca28f79
L
141
142# testing
143test: example.exe minigzip.exe
144 example
145 echo hello world | minigzip | minigzip -d
146
147testdll: example_d.exe minigzip_d.exe
148 example_d
149 echo hello world | minigzip_d | minigzip_d -d
150
151
152# cleanup
153clean:
154 -del $(STATICLIB)
155 -del $(SHAREDLIB)
156 -del $(IMPLIB)
157 -del *.obj
158 -del *.res
159 -del *.exp
160 -del *.exe
161 -del *.pdb
162 -del *.manifest
163 -del foo.gz
This page took 0.265777 seconds and 4 git commands to generate.