# Host name: one of UNIX or VMS
HOST	=	VMS

# uncomment following CFLAGS & LFLAGS for TESTING
#CFLAGS	=	/standard=vaxc/define=($(HOST))/prefix=all/list/nooptimize
#LFLAGS=

# uncomment following CFLAGS & LFLAGS for PRODUCTION
CFLAGS	=	/standard=vaxc/define=($(HOST))/prefix=all/optimize/nodebug
LFLAGS	=	/nodebug/notrace

PGM	=	wc

C	=	.c
H	=	.h
O	=	.obj
OA	=	.obj-axp
OV	=	.obj-vaxc
E	=	.exe
L	=	.lis
OPT	=	.opt

# Customize BIN and LIB for local usage.
BIN	=	bin:			# Martin Marietta Labs local definition
BIN	=	sys$$common:[sysexe]	# mailuaf.exe will be in sys$system
LIB	=	lib:			# Martin Marietta Labs local definition
LIB	=	sys$$common:[syshlp]	# mailuaf.hlb will be in sys$help

# Customize INSTCMD:
#   rename/log if source directory is on same      device as   BIN & LIB.
#   copy/log   if source directory is on different device than BIN & LIB.
INSTCMD	=	rename/log
INSTCMD	=	copy/log

OBJS	=	$(PGM)$(O) fwild$(O) getred$(O)

compile:	$(PGM)$(E)

compile_only:	$(OBJS)

$(PGM)$(E):	$(OBJS) $(PGM)$(OPT)
		link /exec=$(PGM)$(E) $(LFLAGS) $(PGM)$(OPT)/opt

$(PGM)$(O):	$(PGM)$(C)

purge:
		-purge $(PGM).*,makefile.,fwild.*,getred.*

clean:
		if f$$search("$(PGM)$(L)") .nes. "" then \
			delete/nolog $(PGM)$(L);*
		if f$$search("$(PGM)$(O)") .nes. "" then \
			delete/nolog $(PGM)$(O);*
		if f$$search("fwild$(L)") .nes. "" then \
			delete/nolog fwild$(L);*
		if f$$search("fwild$(O)") .nes. "" then \
			delete/nolog fwild$(O);*
		if f$$search("getred$(L)") .nes. "" then \
			delete/nolog getred$(L);*
		if f$$search("getred$(O)") .nes. "" then \
			delete/nolog getred$(O);*

clobber:
		if f$$search("$(PGM)$(E)") .nes. "" then \
			delete/nolog $(PGM)$(E);*

install:	compile
		$(INSTCMD) $(PGM)$(E) $(BIN)$(PGM)$(E)

install_purge:	install
		if f$$search("$(BIN)$(PGM)$(E)") .nes. "" then \
			purge $(BIN)$(PGM)$(E)

save_axp_obj:	compile_only
		rename/log $(PGM)$(O) $(PGM)$(OA)
		rename/log fwild$(O) fwild$(OA)
		rename/log getred$(O) getred$(OA)

save_vaxc_obj:	compile_only
		rename/log $(PGM)$(O) $(PGM)$(OV)
		rename/log fwild$(O) fwild$(OV)
		rename/log getred$(O) getred$(OV)
