# Project:  FSFS


# Toolflags:
.SUFFIXES:  .c .s .o
CCflags     = -c -depend !Depend -I,C: -throwback -zM -fa
Linkflags   = -rmf -o $@ 
ObjAsmflags = -depend !Depend -ThrowBack -Stamp -quit -CloseExec
CMHGflags   = 
Squeezeflags = -o $@
LinkModuleflags = $@


# A list of files, referred by the resultant object file
c_files      = o.init o.entrypoint

asm_files    = o.modbaseadr o.veneer

libraries    = C:o.stubs


# Final targets:
@.FSFS:      $(c_files) $(asm_files)
             @echo Linking...
             @link $(linkflags) o.modheader $(c_files) $(asm_files) $(libraries)
             @echo Compilation finished.

# A macro for building the C code
.c.o:;       @echo Compiling $<...
             @cc $(ccflags) $< -o $@

# A macro for building the assembler code
.s.o:;       @echo Assembling $<
             @objasm $(objasmflags) -from $< -to $@


# User-editable dependencies:
# Static dependencies:
# Dynamic dependencies:
o.modbaseadr: s.modbaseadr
o.entrypoint:	c.entrypoint
o.entrypoint:	C:h.kernel
o.entrypoint:	C:h.swis
o.veneer: s.veneer
o.init:	c.init
o.init:	C:h.kernel
o.init:	C:h.swis
