##########   ISERVER makefile ##################
#
#  03-Jun-91 lr
#    makefile modifed for different machines
#  25-May-91 lr modified to talk to pcserver

######## files #######################
#
# original inmos general purpose files
#
ISSRCS=iserver.c filec.c hostc.c serverc.c
ISOBJS=iserver.o filec.o hostc.o serverc.o

####### SGI Iris 4D #####
#
#HW=B014
#LINKMODULE=sgi_link

########## sun3 / sunos 4.0 / sun c (BSD Universe) #######
#
#   use these two lines for a B011
#HW=B011
#LINKMODULE=b011link
#   or these two for a B014 with S502 device driver
#HW=B014
#LINKMODULE=b014link

######### pc / msdos 3+ / microsoft c 5.1 [and masm 5.1] ########
#
#   use the next 2 lines for b004, b008 or b010  with assembler support
#HW=B004
#OBJECTS=iserver$(O) filec$(O) hostc$(O) serverc$(O) msdosc$(O) b004fast$(O) b004asm$(O)
#   use the next 3 lines for b004/8/10 using c only
#HW=B004
#LINKMODULE=b004link
#OBJECTS=iserver$(O) filec$(O) hostc$(O) serverc$(O) msdosc$(O) $(LINKMODULE)$(O)
#   use the next 3 lines for b008 if you have S701 device driver
#HW=B008
#LINKMODULE=b008link
#OBJECTS=iserver$(O) filec$(O) hostc$(O) serverc$(O) msdosc$(O) $(LINKMODULE)$(O)
#   use the next line for NEC PC
#CFLAGS=-c -Ox -DMSC -DNEC -DBOARD_ID=B010 # -DBOARD_ID=B015
#   or this for regular PC
#CFLAGS=-c -Ox -DMSC -DBOARD_ID=$(HW)
#   and uncomment this for all versions
#LINK=cl -Ox -o iserver$(E) /F 4000 $(OBJECTS)


############ b004 type subsystem, helios 1.0
#
#HW=B008
#LINKMODULE=helios
#CC=cc 
#CFLAGS=-s $*.s -dHELIOS -dBOARD_ID=$(HW) -t4 -wd -ec -j,/helios/include/
#E=
#O=.s
#OBJECTS=iserver$(O) filec$(O) hostc$(O) serverc$(O) $(LINKMODULE)$(O)
#LINK=asm -v /helios/lib/cstart.o $(OBJECTS) -o iserver$(E) -s 10000


############ vax / vms / vax vms c v2.3
#
#LINKMODULE=qt0link
#HW=QT0
#CC=cc 
#CFLAGS=/DEFINE=(BOARD_ID=$(HW),VMS)
#E=.exe
#O=.obj
#OBJECTS=iserver$(O) filec$(O) hostc$(O) serverc$(O) $(LINKMODULE)$(O)
#LINK=link iserver,filec,hostc,serverc,qt0link

#
####### here there is a complete listing of sources ######
#

ASMSRC=b004asm.asm b010asm.asm
CSRC=b004link.c b008link.c b011link.c b014_link.c b014link.c filec.c\
	helios.c hostc.c iserver.c link.c msdosc.c pcs_link.c\
	qt0link.c s386link.c serverc.c sgi_link.c udplink.c vmtm_link.c
OSRC=Makefile vmserr.msg iserver.proto README
INCSRC=b014.h inmos.h pack.h udplink.h iserver.h pcs_link.h vmtm.h

SRC= $(ASMSRC) $(CSRC) $(OSRC) $(INCSRC)

############ the targets ##################

make:
	echo "Which machine ? sparc, mips, iris, next, vax"

iserver:	$(ISOBJS) $(IOOBJS)
		cc -o iserver $(ISOBJS) $(IOOBJS)

$(ISOBJS):	iserver.h inmos.h Makefile pack.h

pcs_link.o:	inmos.h pcs_link.h Makefile

sgi_link.o:	b014.h Makefile

#
#  these two targets are just for b00[4,8,10] with asm support
#
b004fast.obj:		b004link.c inmos.h
			$(CC) $(CFLAGS) -DB4ASM -Fob004fast.obj b004link.c

b004asm.obj:		b004asm.asm
			masm /ML /MX b004asm;

ifs.tar.Z: $(SRC)
	- rm ifs.tar*
	tar cvf ifs.tar $(SRC)
	compress ifs.tar

clean:
	- rm core *.out iserver
	- rm *.o
	- rm *.log *.aux *.dvi

islint.out: $(ISSRCS) $(IOSRCS) Makefile
	- rm islint.out
	lint $(CFLAGS) $(ISSRCS) $(IOSRCS) > islint.out

######### make options for different machines #############
# add -DDEB in CFLAGS to add debugging code
# Sparcstation, pcserver
sparc:
	make iserver "CFLAGS=-DSPARC -DPCSERVER -DBOARD_ID=PCS" \
	"IOOBJS=pcs_link.o" "IOSRCS=pcs_link.c"

sparc.lint:
	make islint.out "CFLAGS=-DSPARC -DPCSERVER -DBOARD_ID=PCS" \
	"IOOBJS=pcs_link.o" "IOSRCS=pcs_link.c"

# SGI Iris, pcserver
iris:
	make iserver "CFLAGS=-DIRIS -DPCSERVER -DBOARD_ID=PCS" \
	"IOOBJS=pcs_link.o" "IOSRCS=pcs_link.c"

iris.b014:
	make iserver "CFLAGS=-DIRIS -DBOARD_ID=B014" \
	"IOOBJS=sgi_link.o" "IOSRCS=sgi_link.c"

next:
	make iserver "CFLAGS=-DNEXT -bsd -DPCSERVER -DBOARD_ID=PCS" \
	"IOOBJS=pcs_link.o" "IOSRCS=pcs_link.c"

# microVAX3500, Ultrix 2.2.1, pcserver
vax:
	make iserver "CFLAGS=-DVAX -DPCSERVER -DBOARD_ID=PCS" \
	"IOOBJS=pcs_link.o" "IOSRCS=pcs_link.c"

# DECstation2100, Ultrix 4.1, pcserver
mips:
	make iserver "CFLAGS=-DMIPS -DPCSERVER -DBOARD_ID=PCS" \
	"IOOBJS=pcs_link.o" "IOSRCS=pcs_link.c"

######### end of Makefile for iserver - unix version ######
