### choose the server options

#TARGET = c128
TARGET = c64
#TARGET = vic20
#TARGET = pet3001
#TARGET = pet4001

RAMEXP = none
#RAMEXP = piaexp        # the PIA-based expansion for the C64 and the 128
#RAMEXP = reuexp        # see also the actionreuplay definition in prserver.a65
#RAMEXP = piaexp | reuexp       # both of the above
#RAMEXP = pet96

CABLE = prlink          # the default 8-bit/4-bit cable
#CABLE = pc64           # the 4-bit/4-bit PC64 cable
#CABLE = c64net         # the 4-bit/2-bit 64NET cable (slow)

### choose the cable object for the clients (should correspond to the above)

CABLEOBJ = prtrans8.obj   # the 8-bit/4-bit cable
#CABLEOBJ = prtrans4.obj  # the 4-bit/4-bit PC64 cable
#CABLEOBJ = prtrans2.obj  # the 64NET cable (slow)
OPTIONS = /D "DEFAULT_PORT=3"    # default printer port
#OPTIONS = /D "DEFAULT_PORT=1"   # default printer port

## generic
OPTIONS = $(OPTIONS) /D "WRAP_AROUND"     # allow address wraparound in prsave

### choose the compiler flags (for MS Visual C++ v1.5)

CFLAGS = /nologo /AL /O /G0 $(OPTIONS)
LFLAGS = /NOLOGO /PACKC:61440 /STACK:10240 /ONERROR:NOEXE

MAINOBJ = prload.obj prsave.obj prrfile.obj prwfile.obj prdisk.obj prcart.obj \
	  prcommon.obj
PRTARGETS = prserver.prg prrfile.prg prwfile.prg prdisk.prg

all:    prmain.exe prprgs

prmain.exe: prmain.obj $(MAINOBJ) $(CABLEOBJ)
	link $(LFLAGS) $**,$@,,llibce.lib,nul

prmain2.exe: prmain.obj $(MAINOBJ) prtrans2.obj
	link $(LFLAGS) $**,$@,,llibce.lib,nul

prmain4.exe: prmain.obj $(MAINOBJ) prtrans4.obj
	link $(LFLAGS) $**,$@,,llibce.lib,nul

prmain8.exe: prmain.obj $(MAINOBJ) prtrans8.obj
	link $(LFLAGS) $**,$@,,llibce.lib,nul

prprgs: chosen.del $(PRTARGETS)

chosen.del:
	del chosen.inc

clean: chosen.del
	del *.obj
	del *.bak
	del *.lst
	del *.map

reallyclean: clean
	del *.prg
	del *.exe

prserver.prg: prserver.a65 chosen.inc
	dasm %s -o$@

prrfile.prg: prrfile.a65 chosen.inc
	dasm %s -o$@

prwfile.prg: prwfile.a65 chosen.inc
	dasm %s -o$@

prdisk.prg: prdisk.a65 chosen.inc
	dasm %s -o$@

chosen.inc:
	echo target = $(TARGET) >  chosen.inc
	echo ramexp = $(RAMEXP) >> chosen.inc
	echo cable  = $(CABLE)  >> chosen.inc
