summaryrefslogtreecommitdiff
path: root/msdos/Makefile.msc
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:20:29 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:20:29 -0700
commit14763ac7c6c03bca62c39e35c03cf5bfc7728802 (patch)
treef1055d11ef7b282b698ce7c40e1a9c061413cbdf /msdos/Makefile.msc
parentc34c1fcbb19852ca35216ad66276f4f86af3fc22 (diff)
downloadzlib-14763ac7c6c03bca62c39e35c03cf5bfc7728802.tar.gz
zlib 1.1.3v1.1.3
Diffstat (limited to 'msdos/Makefile.msc')
-rw-r--r--msdos/Makefile.msc114
1 files changed, 67 insertions, 47 deletions
diff --git a/msdos/Makefile.msc b/msdos/Makefile.msc
index 1a6d663..562201d 100644
--- a/msdos/Makefile.msc
+++ b/msdos/Makefile.msc
@@ -2,20 +2,36 @@
# Microsoft C 5.1 or later
# To use, do "make makefile.msc"
-# To compile in small model, set below: MODEL=-AS
+# To compile in small model, set below: MODEL=S
# If you wish to reduce the memory requirements (default 256K for big
-# objects plus a few K), you can add to CFLAGS below:
+# objects plus a few K), you can add to the LOC macro below:
# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
# See zconf.h for details about the memory requirements.
# ------------- Microsoft C 5.1 and later -------------
-MODEL=-AL
-CFLAGS=-Oait -Gs -nologo -W3 $(MODEL)
-#-Ox generates bad code with MSC 5.1
+
+# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
+# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
+# to the declaration of LOC here:
+LOC = $(LOCAL_ZLIB)
+
+# Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
+CPU_TYP = 0
+
+# Memory model: one of S, M, C, L (small, medium, compact, large)
+MODEL=L
+
CC=cl
+CFLAGS=-nologo -A$(MODEL) -G$(CPU_TYP) -W3 -Oait -Gs $(LOC)
+#-Ox generates bad code with MSC 5.1
+LIB_CFLAGS=-Zl $(CFLAGS)
+
LD=link
-LDFLAGS=/e/st:0x1500/noe
+LDFLAGS=/noi/e/st:0x1500/noe/farcall/packcode
+# "/farcall/packcode" are only useful for `large code' memory models
+# but should be a "no-op" for small code models.
+
O=.obj
# variables
@@ -28,69 +44,73 @@ OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
infutil$(O)+inffast$(O)
-all: zlib.lib example.exe minigzip.exe
+ZLIB_H = zlib.h zconf.h
+ZUTIL_H = zutil.h $(ZLIB_H)
-adler32.obj: adler32.c zutil.h zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
+ZLIB_LIB = zlib_$(MODEL).lib
-compress.obj: compress.c zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
+all: $(ZLIB_LIB) example.exe minigzip.exe
-crc32.obj: crc32.c zutil.h zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
+# individual dependencies and action rules:
+adler32.obj: adler32.c $(ZLIB_H)
+ $(CC) -c $(LIB_CFLAGS) $*.c
-deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
+compress.obj: compress.c $(ZLIB_H)
+ $(CC) -c $(LIB_CFLAGS) $*.c
-gzio.obj: gzio.c zutil.h zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
+crc32.obj: crc32.c $(ZLIB_H)
+ $(CC) -c $(LIB_CFLAGS) $*.c
-infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h\
- infcodes.h infutil.h
- $(CC) -c $(CFLAGS) $*.c
+deflate.obj: deflate.c deflate.h $(ZUTIL_H)
+ $(CC) -c $(LIB_CFLAGS) $*.c
-infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h\
- infcodes.h inffast.h
- $(CC) -c $(CFLAGS) $*.c
+gzio.obj: gzio.c $(ZUTIL_H)
+ $(CC) -c $(LIB_CFLAGS) $*.c
-inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h
- $(CC) -c $(CFLAGS) $*.c
+infblock.obj: infblock.c $(ZUTIL_H) infblock.h inftrees.h infcodes.h infutil.h
+ $(CC) -c $(LIB_CFLAGS) $*.c
-inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
- $(CC) -c $(CFLAGS) $*.c
+infcodes.obj: infcodes.c $(ZUTIL_H) inftrees.h infutil.h infcodes.h inffast.h
+ $(CC) -c $(LIB_CFLAGS) $*.c
-infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
- $(CC) -c $(CFLAGS) $*.c
+inflate.obj: inflate.c $(ZUTIL_H) infblock.h
+ $(CC) -c $(LIB_CFLAGS) $*.c
-inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
- $(CC) -c $(CFLAGS) $*.c
+inftrees.obj: inftrees.c $(ZUTIL_H) inftrees.h
+ $(CC) -c $(LIB_CFLAGS) $*.c
-trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
+infutil.obj: infutil.c $(ZUTIL_H) inftrees.h infutil.h
+ $(CC) -c $(LIB_CFLAGS) $*.c
-uncompr.obj: uncompr.c zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
+inffast.obj: inffast.c $(ZUTIL_H) inftrees.h infutil.h inffast.h
+ $(CC) -c $(LIB_CFLAGS) $*.c
-zutil.obj: zutil.c zutil.h zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
+trees.obj: trees.c deflate.h $(ZUTIL_H)
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+uncompr.obj: uncompr.c $(ZLIB_H)
+ $(CC) -c $(LIB_CFLAGS) $*.c
+
+zutil.obj: zutil.c $(ZUTIL_H)
+ $(CC) -c $(LIB_CFLAGS) $*.c
-example.obj: example.c zlib.h zconf.h
+example.obj: example.c $(ZLIB_H)
$(CC) -c $(CFLAGS) $*.c
-minigzip.obj: minigzip.c zlib.h zconf.h
+minigzip.obj: minigzip.c $(ZLIB_H)
$(CC) -c $(CFLAGS) $*.c
# we must cut the command line to fit in the MS/DOS 128 byte limit:
-zlib.lib: $(OBJ1) $(OBJ2)
- if exist zlib.lib del zlib.lib
- lib zlib $(OBJ1);
- lib zlib $(OBJ2);
+$(ZLIB_LIB): $(OBJ1) $(OBJ2)
+ if exist $(ZLIB_LIB) del $(ZLIB_LIB)
+ lib $(ZLIB_LIB) $(OBJ1);
+ lib $(ZLIB_LIB) $(OBJ2);
-example.exe: example.obj zlib.lib
- $(LD) $(LDFLAGS) example.obj,,,zlib.lib;
+example.exe: example.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) example.obj,,,$(ZLIB_LIB);
-minigzip.exe: minigzip.obj zlib.lib
- $(LD) $(LDFLAGS) minigzip.obj,,,zlib.lib;
+minigzip.exe: minigzip.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) minigzip.obj,,,$(ZLIB_LIB);
test: example.exe minigzip.exe
example