annotate src/zlib-1.2.8/msdos/Makefile.msc @ 56:af97cad61ff0

Add updated build of PortAudio for OSX
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 03 Jan 2017 15:10:52 +0000
parents 5ea0608b923f
children
rev   line source
Chris@43 1 # Makefile for zlib
Chris@43 2 # Microsoft C 5.1 or later
Chris@43 3 # Last updated: 19-Mar-2003
Chris@43 4
Chris@43 5 # To use, do "make makefile.msc"
Chris@43 6 # To compile in small model, set below: MODEL=S
Chris@43 7
Chris@43 8 # If you wish to reduce the memory requirements (default 256K for big
Chris@43 9 # objects plus a few K), you can add to the LOC macro below:
Chris@43 10 # -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
Chris@43 11 # See zconf.h for details about the memory requirements.
Chris@43 12
Chris@43 13 # ------------- Microsoft C 5.1 and later -------------
Chris@43 14
Chris@43 15 # Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
Chris@43 16 # should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
Chris@43 17 # to the declaration of LOC here:
Chris@43 18 LOC = $(LOCAL_ZLIB)
Chris@43 19
Chris@43 20 # Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
Chris@43 21 CPU_TYP = 0
Chris@43 22
Chris@43 23 # Memory model: one of S, M, C, L (small, medium, compact, large)
Chris@43 24 MODEL=L
Chris@43 25
Chris@43 26 CC=cl
Chris@43 27 CFLAGS=-nologo -A$(MODEL) -G$(CPU_TYP) -W3 -Oait -Gs $(LOC)
Chris@43 28 #-Ox generates bad code with MSC 5.1
Chris@43 29 LIB_CFLAGS=-Zl $(CFLAGS)
Chris@43 30
Chris@43 31 LD=link
Chris@43 32 LDFLAGS=/noi/e/st:0x1500/noe/farcall/packcode
Chris@43 33 # "/farcall/packcode" are only useful for `large code' memory models
Chris@43 34 # but should be a "no-op" for small code models.
Chris@43 35
Chris@43 36
Chris@43 37 # variables
Chris@43 38 ZLIB_LIB = zlib_$(MODEL).lib
Chris@43 39
Chris@43 40 OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj
Chris@43 41 OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
Chris@43 42
Chris@43 43
Chris@43 44 # targets
Chris@43 45 all: $(ZLIB_LIB) example.exe minigzip.exe
Chris@43 46
Chris@43 47 .c.obj:
Chris@43 48 $(CC) -c $(LIB_CFLAGS) $*.c
Chris@43 49
Chris@43 50 adler32.obj: adler32.c zlib.h zconf.h
Chris@43 51
Chris@43 52 compress.obj: compress.c zlib.h zconf.h
Chris@43 53
Chris@43 54 crc32.obj: crc32.c zlib.h zconf.h crc32.h
Chris@43 55
Chris@43 56 deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
Chris@43 57
Chris@43 58 gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
Chris@43 59
Chris@43 60 gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h
Chris@43 61
Chris@43 62 gzread.obj: gzread.c zlib.h zconf.h gzguts.h
Chris@43 63
Chris@43 64 gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h
Chris@43 65
Chris@43 66 infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
Chris@43 67 inffast.h inffixed.h
Chris@43 68
Chris@43 69 inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
Chris@43 70 inffast.h
Chris@43 71
Chris@43 72 inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
Chris@43 73 inffast.h inffixed.h
Chris@43 74
Chris@43 75 inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
Chris@43 76
Chris@43 77 trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h
Chris@43 78
Chris@43 79 uncompr.obj: uncompr.c zlib.h zconf.h
Chris@43 80
Chris@43 81 zutil.obj: zutil.c zutil.h zlib.h zconf.h
Chris@43 82
Chris@43 83 example.obj: test/example.c zlib.h zconf.h
Chris@43 84 $(CC) -c $(CFLAGS) $*.c
Chris@43 85
Chris@43 86 minigzip.obj: test/minigzip.c zlib.h zconf.h
Chris@43 87 $(CC) -c $(CFLAGS) $*.c
Chris@43 88
Chris@43 89
Chris@43 90 # the command line is cut to fit in the MS-DOS 128 byte limit:
Chris@43 91 $(ZLIB_LIB): $(OBJ1) $(OBJ2)
Chris@43 92 if exist $(ZLIB_LIB) del $(ZLIB_LIB)
Chris@43 93 lib $(ZLIB_LIB) $(OBJ1);
Chris@43 94 lib $(ZLIB_LIB) $(OBJ2);
Chris@43 95
Chris@43 96 example.exe: example.obj $(ZLIB_LIB)
Chris@43 97 $(LD) $(LDFLAGS) example.obj,,,$(ZLIB_LIB);
Chris@43 98
Chris@43 99 minigzip.exe: minigzip.obj $(ZLIB_LIB)
Chris@43 100 $(LD) $(LDFLAGS) minigzip.obj,,,$(ZLIB_LIB);
Chris@43 101
Chris@43 102 test: example.exe minigzip.exe
Chris@43 103 example
Chris@43 104 echo hello world | minigzip | minigzip -d
Chris@43 105
Chris@43 106 clean:
Chris@43 107 -del *.obj
Chris@43 108 -del *.lib
Chris@43 109 -del *.exe
Chris@43 110 -del *.map
Chris@43 111 -del zlib_*.bak
Chris@43 112 -del foo.gz