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