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