CC		= gcc
CCflags		= -O2 -mstubs -mthrowback
CCoptions	= -mno-apcs-stack-check -mno-poke-function-name -mno-apcs-rentrant
AS		= as
ASflags		= -gcc -objasm -upper -throwback
Link		= link
Linkflags	= -nounused -module -r -b &0

# Pseudo targets to suppress messages and setup .c.o template system

.SUFFIXES:	.c .s .o

Objs 		= o.gmodule o.functions o.gmdwopt_mod

# Main target

All:		MDWOpt o.mdwopt_lib

MDWOpt:		$(Objs)
		$(Link) -o MDWOpt $(Linkflags) $(Objs)

Clean:
		ifthere o.* then wipe o.* ~cfr~v
		remove MDWOpt

# Dependencies:

o.gmdwopt_mod:	c.mdwopt_mod
		$(CC) -c $(CCflags) $(CCoptions) c.mdwopt_mod -o o.gmdwopt_mod

o.mdwopt_lib:	s.mdwopt_lib
		$(AS) $(ASflags)  s.mdwopt_lib

o.gmodule:	s.module
		$(AS) $(ASflags) -D__RELOCATE__ s.module -o o.gmodule

o.functions:	s.functions
		$(AS) $(ASflags) s.functions
