9e052883 |
1 | # Makefile for zlib |
2 | # Borland C++ for Win32 |
3 | # |
4 | # Usage: |
5 | # make -f win32/Makefile.bor |
6 | |
7 | # ------------ Borland C++ ------------ |
8 | |
9 | # Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7) |
10 | # should be added to the environment via "set LOCAL_ZLIB=-DFOO" or |
11 | # added to the declaration of LOC here: |
12 | LOC = $(LOCAL_ZLIB) |
13 | |
14 | CC = bcc32 |
15 | AS = bcc32 |
16 | LD = bcc32 |
17 | AR = tlib |
18 | CFLAGS = -a -d -k- -O2 $(LOC) |
19 | ASFLAGS = $(LOC) |
20 | LDFLAGS = $(LOC) |
21 | |
22 | |
23 | # variables |
24 | ZLIB_LIB = zlib.lib |
25 | |
26 | OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj |
27 | OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj |
28 | #OBJA = |
29 | OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj |
30 | OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj |
31 | #OBJPA= |
32 | |
33 | |
34 | # targets |
35 | all: $(ZLIB_LIB) example.exe minigzip.exe |
36 | |
37 | .c.obj: |
38 | $(CC) -c $(CFLAGS) $< |
39 | |
40 | .asm.obj: |
41 | $(AS) -c $(ASFLAGS) $< |
42 | |
43 | adler32.obj: adler32.c zlib.h zconf.h |
44 | |
45 | compress.obj: compress.c zlib.h zconf.h |
46 | |
47 | crc32.obj: crc32.c zlib.h zconf.h crc32.h |
48 | |
49 | deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h |
50 | |
51 | gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h |
52 | |
53 | gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h |
54 | |
55 | gzread.obj: gzread.c zlib.h zconf.h gzguts.h |
56 | |
57 | gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h |
58 | |
59 | infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ |
60 | inffast.h inffixed.h |
61 | |
62 | inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ |
63 | inffast.h |
64 | |
65 | inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ |
66 | inffast.h inffixed.h |
67 | |
68 | inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h |
69 | |
70 | trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h |
71 | |
72 | uncompr.obj: uncompr.c zlib.h zconf.h |
73 | |
74 | zutil.obj: zutil.c zutil.h zlib.h zconf.h |
75 | |
76 | example.obj: test/example.c zlib.h zconf.h |
77 | |
78 | minigzip.obj: test/minigzip.c zlib.h zconf.h |
79 | |
80 | |
81 | # For the sake of the old Borland make, |
82 | # the command line is cut to fit in the MS-DOS 128 byte limit: |
83 | $(ZLIB_LIB): $(OBJ1) $(OBJ2) $(OBJA) |
84 | -del $(ZLIB_LIB) |
85 | $(AR) $(ZLIB_LIB) $(OBJP1) |
86 | $(AR) $(ZLIB_LIB) $(OBJP2) |
87 | $(AR) $(ZLIB_LIB) $(OBJPA) |
88 | |
89 | |
90 | # testing |
91 | test: example.exe minigzip.exe |
92 | example |
93 | echo hello world | minigzip | minigzip -d |
94 | |
95 | example.exe: example.obj $(ZLIB_LIB) |
96 | $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) |
97 | |
98 | minigzip.exe: minigzip.obj $(ZLIB_LIB) |
99 | $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) |
100 | |
101 | |
102 | # cleanup |
103 | clean: |
104 | -del $(ZLIB_LIB) |
105 | -del *.obj |
106 | -del *.exe |
107 | -del *.tds |
108 | -del zlib.bak |
109 | -del foo.gz |