# Makefile for V remote demo programs
# Bill Nowicki April 1983

#include ../../buildprefix


.SUFFIXES: .b .ls .a68 .c
#ifdef X
C68FLAGS = -O -V -vx
CFLAGS = -DVAX -O -I/usr/xV/include/m68k
#else X
C68FLAGS = -O -V
CFLAGS = -DVAX -O -I/usr/V/include/m68k
#endif X
LIBS = 

LIBDIR = ../../libc/vgts

# A list of machines running 4.2 that want the demo programs installed.
# (We cannot just do a netinstall since some are 4.1 systems)
FOURPOINTWO = Gregorio Leland

#  The following can be gotten from either the V library, or
# for debugging: $(LIBDIR)/{stubs.b vtty.b}
VSTUBS =

# installed V commands
INSVCMDS = binsun.r

# test V commands
TESTVCMDS = vectime.r structime.r test.r datsun.r photo.r

# installed Unix commands
# Why doesn't datsun work any more?
INSUCMDS = photo

# test Unix commands
TESTUCMDS = test condense vectime structime

# how to compile a 68000 file
.c.b:
	cc68 $(C68FLAGS) -c $*.c 

# how to make an assembly file (Not deleting it or assembling it)
.c.s:
	cc68 $(C68FLAGS) -S $*.c

# how to make an assembly listing
.c.ls:
	cc68 $(C68FLAGS) -c -L $*.c

demos: $(INSVCMDS) $(TESTVCMDS) $(INSUCMDS) $(TESTUCMDS)

test: test.o
	cc -o test test.o -lVgts

test.r: test.b
	cc68 $(C68FLAGS) -o test.m68k test.b $(VSTUBS) $(LIBS) 
	nm68 -nh test.m68k > test.sym

datsun.r: datsun.b
	cc68 $(C68FLAGS)  -o datsun.r datsun.b $(VSTUBS) $(LIBS) 

datsun: datsun.o
	cc -o datsun datsun.o -lVgts

vectime.r: vectime.b
	cc68 $(C68FLAGS)  -o vectime.r vectime.b $(VSTUBS) $(LIBS) 

vectime: vectime.o
	cc -o vectime vectime.o -lVgts -lm

structime.r: structime.b
	cc68 $(C68FLAGS)  -o structime.r structime.b $(VSTUBS) $(LIBS) 

structime: structime.o
	cc -o structime structime.o -lVgts -lm

photo.r: photo.b
	cc68 $(C68FLAGS)  -o photo.r photo.b $(VSTUBS) $(LIBS) 

photo: photo.o
	cc -o photo photo.o -lVgts

condense: condense.o
	cc -o condense condense.o -lVgts

binsun.r: binsun.b
	cc68 $(C68FLAGS)  -o binsun.r binsun.b $(VSTUBS) $(LIBS) 

binsun: binsun.o
	cc -o binsun binsun.o -lVgts


install: demos
	$(NETINSTALL) -p "$(INSVCMDS)" $(VSYS)/bin
	$(NETINSTALL) -m 755 "$(INSUCMDS)" /usr/local/bin "$(FOURPOINTWO)"

listings:
	yapp vectime.c structime.c datsun.c photo.c test.c

clean: 
	rm -f *.b *BAK *CKP *.r *.d *.o
	rm -f $(INSVCMDS) $(TESTVCMDS) $(INSUCMDS) $(TESTUCMDS)

