head	1.1;
branch	1.1.1;
access;
symbols
	ZIP_2_3:1.1.1.2
	NET:1.1.1
	libgcj-2_95_1-release:1.1.1.1
	libgcj-2_95-release:1.1.1.1
	libgcj-2_95-branch:1.1.1.1.0.2
	libgcj-2_95-branchpoint:1.1.1.1
	LIBGCJ_0_1:1.1.1.1
	CYGNUS:1.1.1;
locks; strict;
comment	@# @;


1.1
date	99.04.07.14.52.46;	author tromey;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	99.04.07.14.52.46;	author tromey;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2000.06.15.00.57.53;	author bryce;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@# Makefile for Zip, ZipNote, ZipCloak and ZipSplit

# what you can make ...
all:
	@@echo ''
	@@echo 'Make what?  You must say what system to make Zip for--e.g.'
	@@echo '"make generic".  Choices: generic, generic_gcc,'
	@@echo 'att6300, coherent, cray_v3, minix,'
	@@echo 'sco_x286, xenix, zilog.'
	@@echo 'See the files install.doc and zip.doc for more information.'
	@@echo ''

list:   all

MAKE = make -f unix/Makefile
SHELL = /bin/sh

# (to use the Gnu compiler, change cc to gcc in CC and BIND)
CC = cc
BIND = $(CC)
AS = $(CC) -c
E =
CPP = /lib/cpp

# probably can change this to 'install' if you have it
INSTALL = cp

# target directories - where to install executables and man pages to
prefix = /usr/local
BINDIR = $(prefix)/bin
manext=1
MANDIR = $(prefix)/man/man$(manext)

# flags
#   CFLAGS    flags for C compile
#   LFLAGS1   flags after output file spec, before obj file list
#   LFLAGS2   flags after obj file list (libraries, etc)
CFLAGS = -O -I. -DUNIX
LFLAGS1 =
LFLAGS2 = -s

# object file lists
OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o crypt.o ttyio.o \
       unix.o crc32.o crctab.o
OBJI = deflate.o trees.o bits.o
OBJA =
OBJU = zipfile_.o fileio_.o util_.o globals.o
OBJN = zipnote.o  $(OBJU)
OBJC = zipcloak.o $(OBJU) crctab.o crypt_.o ttyio.o
OBJS = zipsplit.o $(OBJU)

ZIP_H = zip.h ziperr.h tailor.h unix/osdep.h

# suffix rules
.SUFFIXES:
.SUFFIXES: _.o .o .c .doc .1
.c_.o:
	rm -f $*_.c; ln $< $*_.c
	$(CC) -c $(CFLAGS) -DUTIL $*_.c
	rm -f $*_.c
.c.o:
	$(CC) -c $(CFLAGS) $<

.1.doc:
	nroff -man $< | col -b | uniq > $@@

# rules for zip, zipnote, zipcloak, zipsplit, and zip.doc.
$(OBJZ): $(ZIP_H)
$(OBJI): $(ZIP_H)
$(OBJN): $(ZIP_H)
$(OBJS): $(ZIP_H)
$(OBJC): $(ZIP_H)
zip.o zipup.o crypt.o ttyio.o bits.o zipcloak.o crypt_.o: crypt.h
zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h
zip.o crypt.o ttyio.o zipcloak.o crypt_.o: ttyio.h
zipup.o: unix/zipup.h

match.o: match.S
	$(CPP) match.S > _match.s
	$(AS) _match.s
	mv _match.o match.o
	rm -f _match.s

unix.o: unix/unix.c
	$(CC) -c $(CFLAGS) unix/unix.c

ZIPS = zip$E zipnote$E zipsplit$E zipcloak$E

zips: $(ZIPS)
zipsman: zip zipnote zipsplit zipcloak zip.doc

zip$E: $(OBJZ) $(OBJI) $(OBJA)
	$(BIND) -o zip$E $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2)
zipnote$E: $(OBJN)
	$(BIND) -o zipnote$E $(LFLAGS1) $(OBJN) $(LFLAGS2)
zipcloak$E: $(OBJC)
	$(BIND) -o zipcloak$E $(LFLAGS1) $(OBJC) $(LFLAGS2)
zipsplit$E: $(OBJS)
	$(BIND) -o zipsplit$E $(LFLAGS1) $(OBJS) $(LFLAGS2)

# install
install:        $(ZIPS)
	$(INSTALL) $(ZIPS) unix/zipgrep $(BINDIR)
	$(INSTALL) man/zip.1 $(MANDIR)/zip.$(manext)
	$(INSTALL) man/zipgrep.1 $(MANDIR)/zipgrep.$(manext)

uninstall:
	-cd $(BINDIR); rm -f $(ZIPS)
	-cd $(MANDIR); rm -f zip.$(manext)

dist:
	zip -u9T zip`sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*/\1/' \
			  -e s/[.]//g -e q revision.h` \
	  `awk '/^Makefile/,/vms_zip.rnh/ {print $$1}' < contents`

flags:  unix/configure
	sh unix/configure "${CC}" "${CFLAGS}"

# These symbols, when #defined using -D have these effects on compilation:
# ZMEM                  - includes C language versions of memset(), memcpy(),
#                         and memcmp() (util.c).
# HAVE_DIRENT_H         - use <dirent.h> instead of <sys/dir.h>
# NODIR                 - for 3B1, which has neither getdents() nor opendir().
# HAVE_NDIR_H           - use <ndir.h> (unix/unix.c).
# HAVE_SYS_DIR_H        - use <sys/dir.h>
# HAVE_SYS_NDIR_H       - use <sys/ndir.h>
# UTIL                  - select routines for utilities (note, cloak, split)
# NO_RMDIR              - remove directories using a system("rmdir ...") call.
# NO_PROTO              - cannot handle ANSI prototypes
# NO_CONST              - cannot handle ANSI const

#               Generic targets:

generic: flags
	eval $(MAKE) zips `cat flags`

generic_gcc:
	$(MAKE) generic CC=gcc CPP="$(CC) -E"

# AT&T 6300 PLUS (don't know yet how to allocate 64K bytes):
att6300:
	$(MAKE) zips LFLAGS1="-Ml" \
	CFLAGS="-DUNIX -I. -O -Ml -DNODIR -DRMDIR -DDYN_ALLOC -DMEDIUM_MEM -DWSIZE=16384"

# Coherent (AS definition not needed for gcc)
coherent:
	$(MAKE) zips CFLAGS="-DUNIX -I. -O -DDIRENT -DASMV" AS="as -gx" \
                     OBJA=match.o

# Cray Unicos 6.1, Standard C compiler 3.0 (all routines except trees.c
# may be compiled with vector3; internal compiler bug in 3.0.2.3 and
# earlier requires vector2 for trees.c)
cray_v3:
	$(MAKE) zips CC="scc" \
                CFLAGS="-DUNIX -I. -O -h vector2 -h scalar3 -DHAVE_DIRENT_H"

# DEC OSF/1
#  with OSF/1 v3.2, default compiler in ANSI mode worked.
# should work with make generic
#dec_osf1:
#	$(MAKE) zips CFLAGS="-DUNIX -I. -O -Olimit 1000 -std"

# Some older OSF/1 versions may need -DOSF to work around bug in errno.h.
# should work with make generic
#dec_osf1_old:
#	$(MAKE) zips CFLAGS="-DUNIX -I. -O -Olimit 1000 -DOSF"

# MINIX 1.5.10 with Bruce Evans 386 patches and gcc/GNU make
minix:
	$(MAKE) zips CFLAGS="-DUNIX -I. -O -DDIRENT -DMINIX" CC=gcc
	chmem =262144 zip


# SCO Xenix 286 release 2.2.3, Development System 2.2.1
sco_x286:
	$(MAKE) zips CFLAGS="-I. -O -LARGE -Mel2 -DRMDIR -DTERMIO -DMEDIUM_MEM \
	  -DWSIZE=16384" LFLAGS1="-LARGE -Mel2" LFLAGS2="-lx -s"

# SCO Xenix
xenix:
	$(MAKE) zips CFLAGS="-DUNIX -I. -O" LFLAGS2="-lx -s"

# zilog zeus 3.21
zilog:
	$(MAKE) zips CFLAGS="-DUNIX -I. -O -DZMEM -DNDIR -DRMDIR" \
                CC="scc -i" BIND="scc"


# clean up after making stuff and installing it
clean:
	rm -f *.o $(ZIPS) flags

###############################################################################
## The following targets are used for developing by the Info-Zip group
## or should be considered as experimental.

# This one's for Mark:
it:
	$(MAKE) zipsman CFLAGS="-DUNIX -I. -O -Wall"\
	LFLAGS2="-s -object" VPATH="${HOME}/Unix/bin"

# and these are for Jean-loup:

gcc_d:
	$(MAKE) zip CFLAGS="-DUNIX -I. -g -DDEBUG -DMMAP" CC=gcc LFLAGS2="-g"
	mv zip zipd

old_gcc:
	$(MAKE) zips CFLAGS="-DUNIX -I. -O -fstrength-reduce" CC=gcc LFLAGS2=""
	strip $(ZIPS)

big_gcc:
	$(MAKE) zips CFLAGS="-DUNIX -I. -O2 -DBIG_MEM -W -Wall" CC=gcc \
                LFLAGS2=""
	strip $(ZIPS)

mmap_gcc:
	$(MAKE) zips CFLAGS="-DUNIX -I. -O2 -DMMAP -W -Wall" CC=gcc LFLAGS2=""
	strip $(ZIPS)

mmap:
	$(MAKE) zips CFLAGS="-DUNIX -I. -O -DMMAP"

# end of Makefile
@


1.1.1.1
log
@Initial import of libgcj
@
text
@@


1.1.1.2
log
@Imported zip 2.3
@
text
@d8 3
a10 3
	@@echo 'att6300nodir, coherent, cray_v3, lynx, minix, os390, qnx,'
	@@echo 'qnxnto, solaris, solaris_gcc'
	@@echo 'See the files INSTALL and zip.txt for more information.'
a16 1
LN = ln -s
d18 1
a18 1
# (to use the Gnu compiler, change cc to gcc in CC)
a26 6
# probably can change this to 'install -d' if you have it
# XXX NextStep 3.3 and Openstep 4.x don't know about -p !
INSTALL_D = mkdir -p
CHMOD = chmod
BINFLAGS = 555
MANFLAGS = 444
a32 3
ZIPMANUAL = MANUAL
PKGDIR = IZzip
VERSION = Version 2.3
d38 1
a38 1
CFLAGS = -O2 -I. -DUNIX $(LOCAL_ZIP)
d45 1
a45 1
OBJI = deflate.o trees.o
d47 1
a47 1
OBJU = zipfile_.o fileio_.o util_.o globals.o unix_.o
d58 1
a58 1
	rm -f $*_.c; $(LN) $< $*_.c
d67 1
a67 1
# rules for zip, zipnote, zipcloak, zipsplit, and the Zip MANUAL.
d73 1
a73 1
zip.o zipup.o crypt.o ttyio.o zipcloak.o crypt_.o: crypt.h
a83 5
crc_i386.o: crc_i386.S
	$(CPP) crc_i386.S > crc_i386.s
	$(AS) crc_i386.s
	rm -f crc_i386.s

a86 5
unix_.o: unix/unix.c
	rm -f unix_.c; $(LN) unix/unix.c unix_.c
	$(CC) -c $(CFLAGS) -DUTIL unix_.c
	rm -f unix_.c

d90 1
a90 1
zipsman: $(ZIPS) $(ZIPMANUAL)
a100 4
$(ZIPMANUAL): man/zip.1
	nroff -man man/zip.1 | col -b | uniq > $(ZIPMANUAL)


d103 1
a103 4
	-$(INSTALL_D) $(BINDIR)
	$(INSTALL) $(ZIPS) $(BINDIR)
	-cd $(BINDIR); $(CHMOD) $(BINFLAGS) $(ZIPS)
	-$(INSTALL_D) $(MANDIR)
d105 1
a105 1
	$(CHMOD) $(MANFLAGS) $(MANDIR)/zip.$(manext)
d111 5
d138 1
a138 1
	$(MAKE) generic CC=gcc CPP="gcc -E"
d141 3
a143 7
att6300nodir:
	$(MAKE) zips LFLAGS1="-Ml -s" \
	CFLAGS="-DUNIX -I. -O -Ml -DNO_RMDIR -DDYN_ALLOC -DMEDIUM_MEM \
-DWSIZE=16384 -DNO_STDLIB_H -DNO_STDDEF_H -DNO_RENAME \
-DNO_MKTIME -DNO_SIZE_T -DNO_VOID -DNO_PROTO -DNO_DIR \
-DNO_CONST -DHAVE_TERMIO_H" \
	"LFLAGS2="
d148 1
a148 1
		     OBJA=match.o
d155 1
a155 1
		CFLAGS="-DUNIX -I. -O -h vector2 -h scalar3 -DHAVE_DIRENT_H"
d157 10
a166 3
# LynxOS
lynx:
	$(MAKE) generic CC=gcc CPP="gcc -E" CFLAGS="$(CFLAGS) -DNO_UNDERLINE -DLynx -DLYNX LFLAGS2="$LFLAGS2 -lc_p"
d173 15
a187 66
# IBM OS/390 (formerly MVS) compiled under "OpenEdition" shell
# You can make the zip executable with IBM's make, but you will
# get errors dealing with the _.o targets for the other executables
# (zipcloak, etc).  GNU make will build all the executables.
# If you have GNU make in your path as gmake, uncomment the following:
#MAKE = gmake -f unix/Makefile
os390:
	${MAKE} zips CFLAGS="$(CF) -I. -DUNIX -DOS390 -DEBCDIC -DSYSV \
-DSYSV -DNO_PARAM_H" LFLAGS2=""

# QNX is "special" because out /bin/sh is ksh and it doesn't grok the
# configure script properly, generating a bad flags file.  D'oh! [cjh]
#
# QNX/Neutrino is "special" because you don't have any native development
# tools yet.  Set ARCH to "x86", "ppcbe", "ppcle", "mipsbe", or "mipsle"
# to produce x86, PowerPC (big- or little-endian) and MIPS (big-
# or little-endian) using gcc. [cjh]
qnx:
	$(MAKE) zips LN=ln CC=cc CFLAGS="-DUNIX -I. -O -DHAVE_DIRENT_H \
-DHAVE_TERMIOS_H -DNO_MKTEMP"

qnxnto:
	@@if [ "$(ARCH)" = "" ] ; then \
		echo "You didn't set ARCH; I'll assume you meant ARCH=x86..." ; \
		echo "" ; \
		$(MAKE) zips LN=ln CC="qcc -Vgcc_ntox86" \
			CFLAGS="-g -DUNIX -I. -O -DHAVE_DIRENT_H -DHAVE_TERMIOS_H -DNO_MKTEMP" \
			LFLAGS2=-g ; \
	else \
		echo "Making zip for $(ARCH)..." ; \
		echo "" ; \
		$(MAKE) zips LN=ln CC="qcc -Vgcc_nto$(ARCH)" \
			CFLAGS="-g -DUNIX -I. -O -DHAVE_DIRENT_H -DHAVE_TERMIOS_H -DNO_MKTEMP" \
			LFLAGS2=-g ; \
	fi

# Solaris:  Generic, plus generation of installable package.
solaris:	generic svr4package

# Solaris with GCC: generic_gcc, plus generation of installable package
solaris_gcc:	generic_gcc svr4package

# Package generation interface (by JBush). Originally tested under Sun Solaris.
# Other SVr4s may be very similar, and could possibly use this.
# Note:  Expects version info to be stored in VERSION macro variable.
# See "README" under ./unix/Packaging
svr4package:
	@@echo "Creating SVR4 package for Unix ..."
	-@@rm -rf ./$(PKGDIR) ./$(PKGDIR)_`uname -p`.pkg
	-@@sed -e "s/.VERSION./$(VERSION)/g" \
	      -e "s/.PSTAMP./$(LOGNAME)_`date | tr  ' ' '_'`/g" \
	      -e "s/.ARCH./Solaris_`uname -rp | tr ' ' ','`/g" \
	      ./unix/Packaging/pkginfo.in > ./unix/Packaging/pkginfo
	-@@sed -e "s/.ARCH./`uname -p`/g" \
	      ./unix/Packaging/preinstall.in > ./unix/Packaging/preinstall
	/usr/bin/pkgmk -d . -b . -r . -f ./unix/Packaging/prototype $(PKGDIR)
	/usr/bin/pkgtrans -o -s . $(PKGDIR)_`uname -p`.pkg $(PKGDIR)
	@@echo " "
	@@echo "To install, copy $(PKGDIR)_`uname -p`.pkg to the target system, and"
	@@echo "issue the command (as root):  pkgadd -d $(PKGDIR)_`uname -p`.pkg"
	@@echo " "

# make a distribution
dist:	$(ZIPMANUAL)
	eval zip -r9 zip`sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*/\1/' \
			  -e 's/[.]//g' -e 's/ .*//g' -e q revision.h` *
a191 1
	rm -rf $(PKGDIR)
d193 32
@


