| 1 |
# Makefile for Zip, ZipCloak, ZipNote and ZipSplit for |
| 2 |
# djgpp 2.x |
| 3 |
# |
| 4 |
# This simple modified version of makefile.dj2 adds bzip2 support |
| 5 |
# to Zip for djgpp 2.x and was donated by Robert Riebisch. |
| 6 |
# |
| 7 |
# Given standard djgpp 2.x and bzip2 installations, this should create a |
| 8 |
# version of Zip 3.0 with bzip2 support. Additional information is in |
| 9 |
# bzip2/install.txt. |
| 10 |
# |
| 11 |
# 27 June 2008 |
| 12 |
|
| 13 |
VPATH=.;msdos |
| 14 |
# ------------- djgpp ------------- |
| 15 |
CPPFLAGS=-I. -DDOS -DASM_CRC -DBZIP2_SUPPORT $(LOCAL_ZIP) |
| 16 |
ASFLAGS=$(CPPFLAGS) |
| 17 |
CFLAGS=-Wall -O2 $(CPPFLAGS) |
| 18 |
UTILFLAGS=-c -DUTIL $(CFLAGS) -o |
| 19 |
CC=gcc |
| 20 |
LD=gcc |
| 21 |
LDFLAGS=-s |
| 22 |
|
| 23 |
# ------------- file packer -------- |
| 24 |
# Laszlo Molnar who wrote DJ Packer and Markus F. X. J. Oberhumer who wrote |
| 25 |
# the compression library used by the DJ Packer have collaborated on the |
| 26 |
# Ultimate Packer for eXecutables, which has recently been released. Look |
| 27 |
# for upx???d.zip at http://upx.sourceforge.net |
| 28 |
# As an alternative, look for "djp.exe", now two years old, in the archive |
| 29 |
# mlp107[b,s].zip, found in the same location as csdpmi?[b,s].zip (see below). |
| 30 |
# If you have got an executable packer in your PATH, you may reduce the |
| 31 |
# size of the disk image of the zip*.exe's by uncommenting the lines |
| 32 |
# containing $(DJP) below where the exe's are built. |
| 33 |
#DJP=djp -q |
| 34 |
DJP=upx -qq --best |
| 35 |
|
| 36 |
# variables |
| 37 |
|
| 38 |
#set CRC32 to crc_gcc.o or nothing, depending on whether ASM_CRC is defined: |
| 39 |
CRCA_O = crc_gcc.o |
| 40 |
|
| 41 |
OBJZ = zip.o crypt.o ttyio.o zipfile.o zipup.o fileio.o util.o \ |
| 42 |
crc32.o $(CRCA_O) globals.o |
| 43 |
OBJI = deflate.o trees.o match.o msdos.o |
| 44 |
OBJU = zipfile_.o fileio_.o util_.o globals.o msdos_.o |
| 45 |
OBJN = zipnote.o $(OBJU) |
| 46 |
OBJC = zipcloak.o crc32_.o crypt_.o ttyio.o $(OBJU) |
| 47 |
OBJS = zipsplit.o $(OBJU) |
| 48 |
LIBS = -lbz2 |
| 49 |
|
| 50 |
ZIP_H = zip.h ziperr.h tailor.h msdos/osdep.h |
| 51 |
|
| 52 |
# rules |
| 53 |
|
| 54 |
.SUFFIXES: # Delete make's default suffix list |
| 55 |
.SUFFIXES: .exe .out .a .ln .o .c .cc .C .p .f .F .y .l .s .S .h |
| 56 |
|
| 57 |
.c.o: |
| 58 |
$(CC) -c $(CFLAGS) $< -o $@ |
| 59 |
|
| 60 |
zips: zip.exe zipnote.exe zipsplit.exe zipcloak.exe |
| 61 |
|
| 62 |
zip.o: zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h |
| 63 |
|
| 64 |
zipfile.o: zipfile.c $(ZIP_H) crc32.h |
| 65 |
|
| 66 |
zipup.o: zipup.c $(ZIP_H) revision.h crc32.h crypt.h msdos/zipup.h |
| 67 |
|
| 68 |
fileio.o: fileio.c $(ZIP_H) crc32.h |
| 69 |
|
| 70 |
util.o: util.c $(ZIP_H) |
| 71 |
|
| 72 |
globals.o: globals.c $(ZIP_H) |
| 73 |
|
| 74 |
deflate.o: deflate.c $(ZIP_H) |
| 75 |
|
| 76 |
trees.o: trees.c $(ZIP_H) |
| 77 |
|
| 78 |
crc_gcc.o: crc_i386.S |
| 79 |
$(CC) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S |
| 80 |
|
| 81 |
crc32.o: crc32.c $(ZIP_H) crc32.h |
| 82 |
|
| 83 |
crypt.o: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h |
| 84 |
|
| 85 |
ttyio.o: ttyio.c $(ZIP_H) crypt.h ttyio.h |
| 86 |
|
| 87 |
msdos.o: msdos/msdos.c $(ZIP_H) |
| 88 |
|
| 89 |
zipcloak.o: zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h |
| 90 |
|
| 91 |
zipnote.o: zipnote.c $(ZIP_H) revision.h |
| 92 |
|
| 93 |
zipsplit.o: zipsplit.c $(ZIP_H) revision.h |
| 94 |
|
| 95 |
zipfile_.o: zipfile.c $(ZIP_H) crc32.h |
| 96 |
$(CC) $(UTILFLAGS) $@ zipfile.c |
| 97 |
|
| 98 |
fileio_.o: fileio.c $(ZIP_H) crc32.h |
| 99 |
$(CC) $(UTILFLAGS) $@ fileio.c |
| 100 |
|
| 101 |
util_.o: util.c $(ZIP_H) |
| 102 |
$(CC) $(UTILFLAGS) $@ util.c |
| 103 |
|
| 104 |
crc32_.o: crc32.c $(ZIP_H) crc32.h |
| 105 |
$(CC) $(UTILFLAGS) $@ crc32.c |
| 106 |
|
| 107 |
crypt_.o: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h |
| 108 |
$(CC) $(UTILFLAGS) $@ crypt.c |
| 109 |
|
| 110 |
msdos_.o: msdos/msdos.c $(ZIP_H) |
| 111 |
$(CC) $(UTILFLAGS) $@ msdos/msdos.c |
| 112 |
|
| 113 |
|
| 114 |
match.o: match.S |
| 115 |
$(CC) $(ASFLAGS) -x assembler-with-cpp -c -o $@ match.S |
| 116 |
|
| 117 |
zip.exe: $(OBJZ) $(OBJI) |
| 118 |
echo $(OBJZ) > zip.rsp |
| 119 |
echo $(OBJI) >> zip.rsp |
| 120 |
echo $(LIBS) >> zip.rsp |
| 121 |
$(LD) $(LDFLAGS) -o $@ @zip.rsp |
| 122 |
del zip.rsp |
| 123 |
# stubedit $@ dpmi=cwsdpmi.exe |
| 124 |
# $(DJP) $@ |
| 125 |
|
| 126 |
zipcloak.exe: $(OBJC) |
| 127 |
$(LD) $(LDFLAGS) $(OBJC) -o $@ |
| 128 |
# stubedit $@ dpmi=cwsdpmi.exe |
| 129 |
# $(DJP) $@ |
| 130 |
|
| 131 |
zipnote.exe: $(OBJN) |
| 132 |
$(LD) $(LDFLAGS) $(OBJN) -o $@ |
| 133 |
# stubedit $@ dpmi=cwsdpmi.exe |
| 134 |
# $(DJP) $@ |
| 135 |
|
| 136 |
zipsplit.exe: $(OBJS) |
| 137 |
$(LD) $(LDFLAGS) $(OBJS) -o $@ |
| 138 |
# stubedit $@ dpmi=cwsdpmi.exe |
| 139 |
# $(DJP) $@ |
| 140 |
|
| 141 |
# These stand alone executables require dpmi services to run. When |
| 142 |
# running in a DOS window under windows 3.1 or later, the dpmi server |
| 143 |
# is automatically present. Under DOS, if a dpmi server is not installed, |
| 144 |
# by default the program will look for "cwsdpmi.exe." If found, it will |
| 145 |
# be loaded for the duration of the program. |
| 146 |
# cwsdpmi is a "free" dpmi server written by Charles W. Sandmann |
| 147 |
# ([email protected]). It may be found, among other sites, on SimTel |
| 148 |
# and its mirrors in the .../vendors/djgpp/v2misc directory. |