#============================================================================
# Makefile for VMS Zip, ZipCloak, ZipNote  and ZipSplit          Greg Roelofs
# Version:  1.8f   [for use with Todd Aven's MAKE/VMS 3.4]       25 June 1992
#============================================================================

# Most recent revisions:  25 June 1992


#####################
# MACRO DEFINITIONS #
#####################

CRYPTO =
CLOAK =
CFLAGS =
UFLAGS = /def=UTIL
# Uncomment next three lines for decryption version:
#CRYPTO = crypt.obj,
#CLOAK = zipcloak.exe
#CFLAGS = /def=CRYPT
#UFLAGS = /def=(UTIL,CRYPT)

CC = cc
LIB =
# Uncomment next two lines to use the GNU compiler (also add /undef=__STDC__
# to CFLAGS and UFLAGS, possibly split UFLAGS into two /def's, and possibly
# replace /obj=$@ [below] with copy/rename/delete setup).  NOT TESTED.
#CC = gcc
#LIB = gnu_cc:[000000]gcclib.olb/lib,

E = .exe
O = .obj
LD = link
LDFLAGS =

ZIPS = zip$E zipnote$E zipsplit$E $(CLOAK)

# object file lists
OBJZ = zip$O, zipfile$O, zipup$O, fileio$O, $(CRYPTO) util$O,-
   globals$O, VMSmunch$O, vms$O
OBJI = deflate$O, trees$O, bits$O
OBJN = zipnote$O, zipfile_$O, zipup_$O, fileio_$O, util_$O,-
   globals$O, VMSmunch$O
OBJS = zipsplit$O, zipfile_$O, zipup_$O, fileio_$O, util_$O,-
   globals$O, VMSmunch$O
OBJC = zipcloak$O, zipfile_$O, zipup_$O, fileio_$O, util$O,-
   globals$O, VMSmunch$O, crypt_$O


###############################################
# BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES #
###############################################

default:	$(ZIPS)


# suffix rules
*.obj:	*.c				# `*.c' necessary?
	$(CC) $(CFLAGS) $<

*_.obj:	*.c				# `$*' not legal
	$(CC) $(UFLAGS) /obj=$@ $<


# executables makerules (trailing `$' makes line a data line)
zip$E:		$(OBJZ), $(OBJI)
	$(LD) $(LDFLAGS) $(OBJZ), $(OBJI), $(LIB) sys$input/opt
	sys$share:vaxcrtl.exe/shareable $

zipnote$E:	$(OBJN)
	$(LD) $(LDFLAGS) $(OBJN), $(LIB) sys$input/opt
	sys$share:vaxcrtl.exe/shareable $

zipcloak$E:	$(OBJC)
	$(LD) $(LDFLAGS) $(OBJC), $(LIB) sys$input/opt
	sys$share:vaxcrtl.exe/shareable $

zipsplit$E:	$(OBJS)
	$(LD) $(LDFLAGS) $(OBJS), $(LIB) sys$input/opt
	sys$share:vaxcrtl.exe/shareable $

# dependencies for zip, zipnote, zipcloak, and zipsplit
$(OBJZ):	zip.h ziperr.h tailor.h
$(OBJI):	zip.h ziperr.h tailor.h
$(OBJN):	zip.h ziperr.h tailor.h
$(OBJS):	zip.h ziperr.h tailor.h
$(OBJC):	zip.h ziperr.h tailor.h
fileio$O:	VMSmunch.h
vms$O:          vms.c zip.h
VMSmunch$O:     VMSmunch.c VMSmunch.h
zip$O:		revision.h
zipcloak$O:	revision.h
zipfile$O:	VMSmunch.h
zipnote$O:	revision.h
zipsplit$O:	revision.h
zipup$O:	revision.h


clean:
	del *.obj;*
	del *.exe;* 		# use "purge/log" instead?


# the backslash '\' is the continuation character if it occurs as
# the last non-white character on the line.
# the hyphen '-' is the DCL continuation character, so if it occurs
# as the last non-white character on the line, the next line will
# not have the dollar sign '$' prepended.


################################
# INDIVIDUAL MACHINE MAKERULES #
################################

generic:	default		# first try if unknown
generic2:	default		# second try if unknown
vax:		default
vms:		default

all:		$(ZIPS)
zip:		zip$E
zipcloak:	zipcloak$E
zipnote:	zipnote$E
zipsplit:	zipsplit$E
