###############
# Définitions #
###############
MODNAME	        = /AMI-CPC

C_COMPILER      = SC
C_COMPILER_OPTS = STRMER NOLINK CPU=68020 DATA=FAR

ASSEMBLER       = GENAM
ASSEMBLER_OPTS  = -vp=68020 -vo+,ow6- -l

LINKER          = SLINK
LINKER_OPTS	    = NOICONS STRIPDEBUG

STARTUP         = LIB:c.o
LIBS	        = LIB:sc.lib LIB:amiga.lib

OBJECTS         = regs.o      fctfirst.o  fcted.o     fctcb.o     fctix.o     \
                  fctiy.o     vga.o       mainasm.o   gestport.o  crtc.o      \
                  ppi.o       upd.o       process.o   invite.o    sound.o     \
                  fctddcb.o   joystick.o  debug.o     main.o

##############################
# Génération de l'exécutable #
##############################
$(MODNAME):	$(OBJECTS) $(LIBS)
    $(LINKER) FROM $(STARTUP) $(OBJECTS) TO $(MODNAME) LIB $(LIBS) $(LINKER_OPTS)


#######################################
# Génération des fichiers objets (.o) #
#######################################
.c.o:
    $(C_COMPILER) $(C_COMPILER_OPTS) $*.c
#    $(C_COMPILER) $(C_COMPILER_OPTS) DISASM=$*.ASM DEBUG=FULL $*.c
.s.o:
    $(ASSEMBLER)  $(ASSEMBLER_OPTS)  $*.s


############################
# dépendances des fichiers #
############################
regs.o      : regs.s
fctcb.o     : fctcb.s       regs.i      vga.i
fctix.o     : fctix.s       regs.i      vga.i       tools.i
fctiy.o     : fctiy.s       regs.i      vga.i       tools.i
fcted.o     : fcted.s       regs.i      vga.i       tools.i
fctddbc.o   : fctddcb.s     regs.i      vga.i
fctfirst.o  : fctfirst.s    regs.i      vga.i       tools.i
vga.o       : vga.s         regs.i      vgacst.i
ppi.o       : ppi.s
mainasm.o   : mainasm.s     regs.i      vga.i       vgacst.i    tools.i
gestport.o  : gestport.s    vgacst.i
crtc.o      : crtc.s
sound.o     : sound.c       main.h
upd.o       : upd.c
joystick.o  : joystick.c    joystick.h  main.h
process.o   : process.c     process.h
invite.o    : invite.c      invite.h    main.h
debug.o     : debug.c       debug.h     main.h
main.o      : main.c        upd.h       sound.h     process.h   invite.h  joystick.h main.h debug.h
