Fossil SCM

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