diff options
Diffstat (limited to 'msdos/Makefile.msc')
-rw-r--r-- | msdos/Makefile.msc | 114 |
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 ------------- |
13 | MODEL=-AL | 13 | |
14 | CFLAGS=-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: | ||
17 | LOC = $(LOCAL_ZLIB) | ||
18 | |||
19 | # Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc. | ||
20 | CPU_TYP = 0 | ||
21 | |||
22 | # Memory model: one of S, M, C, L (small, medium, compact, large) | ||
23 | MODEL=L | ||
24 | |||
16 | CC=cl | 25 | CC=cl |
26 | CFLAGS=-nologo -A$(MODEL) -G$(CPU_TYP) -W3 -Oait -Gs $(LOC) | ||
27 | #-Ox generates bad code with MSC 5.1 | ||
28 | LIB_CFLAGS=-Zl $(CFLAGS) | ||
29 | |||
17 | LD=link | 30 | LD=link |
18 | LDFLAGS=/e/st:0x1500/noe | 31 | LDFLAGS=/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 | |||
19 | O=.obj | 35 | O=.obj |
20 | 36 | ||
21 | # variables | 37 | # variables |
@@ -28,69 +44,73 @@ OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \ | |||
28 | OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\ | 44 | OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\ |
29 | infutil$(O)+inffast$(O) | 45 | infutil$(O)+inffast$(O) |
30 | 46 | ||
31 | all: zlib.lib example.exe minigzip.exe | 47 | ZLIB_H = zlib.h zconf.h |
48 | ZUTIL_H = zutil.h $(ZLIB_H) | ||
32 | 49 | ||
33 | adler32.obj: adler32.c zutil.h zlib.h zconf.h | 50 | ZLIB_LIB = zlib_$(MODEL).lib |
34 | $(CC) -c $(CFLAGS) $*.c | ||
35 | 51 | ||
36 | compress.obj: compress.c zlib.h zconf.h | 52 | all: $(ZLIB_LIB) example.exe minigzip.exe |
37 | $(CC) -c $(CFLAGS) $*.c | ||
38 | 53 | ||
39 | crc32.obj: crc32.c zutil.h zlib.h zconf.h | 54 | # individual dependencies and action rules: |
40 | $(CC) -c $(CFLAGS) $*.c | 55 | adler32.obj: adler32.c $(ZLIB_H) |
56 | $(CC) -c $(LIB_CFLAGS) $*.c | ||
41 | 57 | ||
42 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h | 58 | compress.obj: compress.c $(ZLIB_H) |
43 | $(CC) -c $(CFLAGS) $*.c | 59 | $(CC) -c $(LIB_CFLAGS) $*.c |
44 | 60 | ||
45 | gzio.obj: gzio.c zutil.h zlib.h zconf.h | 61 | crc32.obj: crc32.c $(ZLIB_H) |
46 | $(CC) -c $(CFLAGS) $*.c | 62 | $(CC) -c $(LIB_CFLAGS) $*.c |
47 | 63 | ||
48 | infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h\ | 64 | deflate.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 | ||
52 | infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h\ | 67 | gzio.obj: gzio.c $(ZUTIL_H) |
53 | infcodes.h inffast.h | 68 | $(CC) -c $(LIB_CFLAGS) $*.c |
54 | $(CC) -c $(CFLAGS) $*.c | ||
55 | 69 | ||
56 | inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h | 70 | infblock.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 | ||
59 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h | 73 | infcodes.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 | ||
62 | infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h | 76 | inflate.obj: inflate.c $(ZUTIL_H) infblock.h |
63 | $(CC) -c $(CFLAGS) $*.c | 77 | $(CC) -c $(LIB_CFLAGS) $*.c |
64 | 78 | ||
65 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h | 79 | inftrees.obj: inftrees.c $(ZUTIL_H) inftrees.h |
66 | $(CC) -c $(CFLAGS) $*.c | 80 | $(CC) -c $(LIB_CFLAGS) $*.c |
67 | 81 | ||
68 | trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h | 82 | infutil.obj: infutil.c $(ZUTIL_H) inftrees.h infutil.h |
69 | $(CC) -c $(CFLAGS) $*.c | 83 | $(CC) -c $(LIB_CFLAGS) $*.c |
70 | 84 | ||
71 | uncompr.obj: uncompr.c zlib.h zconf.h | 85 | inffast.obj: inffast.c $(ZUTIL_H) inftrees.h infutil.h inffast.h |
72 | $(CC) -c $(CFLAGS) $*.c | 86 | $(CC) -c $(LIB_CFLAGS) $*.c |
73 | 87 | ||
74 | zutil.obj: zutil.c zutil.h zlib.h zconf.h | 88 | trees.obj: trees.c deflate.h $(ZUTIL_H) |
75 | $(CC) -c $(CFLAGS) $*.c | 89 | $(CC) -c $(LIB_CFLAGS) $*.c |
90 | |||
91 | uncompr.obj: uncompr.c $(ZLIB_H) | ||
92 | $(CC) -c $(LIB_CFLAGS) $*.c | ||
93 | |||
94 | zutil.obj: zutil.c $(ZUTIL_H) | ||
95 | $(CC) -c $(LIB_CFLAGS) $*.c | ||
76 | 96 | ||
77 | example.obj: example.c zlib.h zconf.h | 97 | example.obj: example.c $(ZLIB_H) |
78 | $(CC) -c $(CFLAGS) $*.c | 98 | $(CC) -c $(CFLAGS) $*.c |
79 | 99 | ||
80 | minigzip.obj: minigzip.c zlib.h zconf.h | 100 | minigzip.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: |
84 | zlib.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 | ||
89 | example.exe: example.obj zlib.lib | 109 | example.exe: example.obj $(ZLIB_LIB) |
90 | $(LD) $(LDFLAGS) example.obj,,,zlib.lib; | 110 | $(LD) $(LDFLAGS) example.obj,,,$(ZLIB_LIB); |
91 | 111 | ||
92 | minigzip.exe: minigzip.obj zlib.lib | 112 | minigzip.exe: minigzip.obj $(ZLIB_LIB) |
93 | $(LD) $(LDFLAGS) minigzip.obj,,,zlib.lib; | 113 | $(LD) $(LDFLAGS) minigzip.obj,,,$(ZLIB_LIB); |
94 | 114 | ||
95 | test: example.exe minigzip.exe | 115 | test: example.exe minigzip.exe |
96 | example | 116 | example |