REL_PLATFORM=sun3
PLATFORM=-DSUN3

#PLATFORM=SUN4
#REL_PLATFORM=sun4

DEBUG=-g

DS_DIR1  = /usr/ds/release/LATEST/sunthree/lib
DS_DIR2  = /usr/ds/release/LATEST/sunthree/lib

LDS_DIR = /home/andre/hoshah/c++/ds
FIXED_OBJ = ${LDS_DIR}/streamfix/streamfix.o
LDS_OBJ = ${LDS_DIR}/../corcomp/generic/Clistbase.o ${LDS_DIR}/ds_cxface.o ${LDS_DIR}/ds.o ${LDS_DIR}/gen_error.o ${LDS_DIR}/vtab.o

DS_LIB = ${DS_DIR2}/libdswidge.a ${DS_DIR1}/libds.a ${DS_DIR1}/liboops.a

VERSION=1.0 SUN-P2
RELEASED=\
vopen.h \
vopen.o \
unixtime.h \
unixtime.o \
cwrap.o \
escseqp.h \
escseqp.o \
escseq.o

TESTS=\
test_vopen

SHDIR = ../comp/shared
VAXPAS=vopen.pas test_vopen.pas

JUNK=*.pas *.o *.obj ${TESTS} *.out *junk* *.list .em* scaldkit input.index *.dat

.SUFFIXES:
.SUFFIXES: .ex .o .obj .pas .p .c

final:	${RELEASED} ${TESTS} scaldkit
pmax: final

test_vopen:	test_vopen.o vopen.o cwrap.o 
	pc -g -o test_vopen test_vopen.o vopen.o cwrap.o ${SHDIR}/fio.o

tstdsvopen.junk:  test_dsvopen.o myds_vopen.o cwrap.o 
	pc ${DEBUG}  -o tstdsvopen.junk test_dsvopen.o myds_vopen.o cwrap.o ../comp/shared/ds_fio.o ../comp/shared/fio.o foo.o ${FIXED_OBJ} ${LDS_OBJ} ${DS_LIB} ${DS_LIB} -lC

__ctdt.o: tstdsvopen.junk
	-(nm tstdsvopen.junk | /usr/lib/munch >__ctdt.c)
	cc -c __ctdt.c

tstdsvopen:	tstdsvopen.junk __ctdt.o
	pc ${DEBUG} -o tstdsvopen test_dsvopen.o myds_vopen.o cwrap.o ../comp/shared/ds_fio.o ../comp/shared/fio.o foo.o ${FIXED_OBJ} ${LDS_OBJ} ${DS_LIB} ${DS_LIB} __ctdt.o  -lC

.p.o:
	pc -c ${DEBUG} $(PLATFORM) -C $*.p       # PFLAGS intentionally ignored

.c.o:
	cc -c $(PLATFORM) $*.c
.p.pas:
	/lib/cpp -E -I$(INCL) $(PLATFORM) $*.p | sed -e "/^#/d" > $*.pas

test_vopen.o:
	pc -L ${DEBUG} -c $(PLATFORM) test_vopen.p

test_dsvopen.o:
	pc -L ${DEBUG} -c $(PLATFORM) test_dsvopen.p
vopen.o: vopen.p vopen.h
unixtime.o: unixtime.p unixtime.h
escseqp.o: escseqp.p escseqp.h
test_vopen.o: test_vopen.p vopen.h

scaldkit: makefile
	rm -f scaldkit

	for f in ${RELEASED} ;\
	do\
	    echo "$$f tools/pascal/shared/$$f 644 bin bin" >>scaldkit ;\
	done
kit:
	sh ./releasetosystools $(REL_PLATFORM)
clean:
	rm -f $(JUNK) *.o 
realclean:
	rm -f $(JUNK) *.o 

vax:
	make "PLATFORM=-DVAX" $(VAXPAS)
	@echo Copy $(VAXPAS), cwrap.c and \*.com to the VAX
s32:
	make -f makefile.s32
	@echo Copy $(VAXPAS), cwrap.c and \*.com to the VAX




