####
#### Generic mi/buildtemplate
####
#### Customized for:  wc
####

####
#### Define some handy abbreviations
####
o=.$(OBJSUFFIX)
#ifdef UNIX
m=
#else
m=.$(MACHINE)
#endif UNIX

####
#### List of commands to be built.
####
CMDS=wc$m

####
#### Just saying "build" builds all the commands.
####
default: $(CMDS)

#### The final link step.
#### One block for each command to be built.
#### Format is
####	commandname: sources needed to build the command
####		$(CC) $(MIFLAGS) $(MDFLAGS) -o $@ $<

wc$m: wc$o
	$(CC) $(MIFLAGS) $(MDFLAGS) -o $@ $<

####
#### Directories where header files might be found.
####
INCLUDES= -I../$(MACHINE) -I../mi

####
#### Dependencies on header files.  Note that the
####  object file (not the source file) depends on the header file.
####

####
#### How to install.  (UNIX installation should be done better.)
####
install:
#ifdef UNIX
	rcp $(CMDS) $(UNIXDESTDIR)
#else
	$(NETINSTALL) -p "$(CMDS)" $(VSYS)/bin
#endif UNIX

####
#### Some final boilerplate
####
clean:
	rm -f .emacs_* *.CKP *.BAK *$o $(CMDS)

relink:
	rm -f $(CMDS)
