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