Fossil SCM

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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button