# Makefile for DefMod2 build for and under RISC OS

VPATH=@ ^.sources ^.support

INCLUDES = -I@.^. -I@.^.sources. -I@.^.support. -ICLib:
DEFINES = -DTRACE=0 -DRISCOS -DEXECUTE_ON_RISCOS 

CC    = cc ${INCLUDES} ${DEFINES} -facfK -wp -throwback -depend !Depend 	
LINK  = Link
YACC  = yacc
CP    = copy
RM    = rm

LIBS  = CLib:o.Stubs

#Lists of derived objects
C =   	 c.defmod

OBJS = 	 o.trace \
       	 o.asmhelp \
      	 o.callback \
      	 o.chelp \
      	 o.def \
      	 o.defmod \
      	 o.cheader \
      	 o.hdr \
      	 o.lookup \
      	 o.objasm \
      	 o.realloc \
      	 o.resource \
      	 o.riscos \
      	 o.riscosa \
      	 o.cstrong \
      	 o.x

#Externally visible targets
all: DefMod
   @Echo Made 'all'

release: DefMod
   %Copy DefMod Root:Library.DefMod ~CFLNRV
   @%Echo Made 'release'

cleaner:
   ${RM} ${C} ${OBJS} DefMod
   @Echo Made 'clean'

#Internal targets
DefMod: 	${OBJS} ${C} ${LIBS}
   		${LINK} -output DefMod ${OBJS} ${LIBS}
   		SetType DefMod Absolute
   		Squeeze DefMod
   		Access DefMod WR/R

#General rules
.SUFFIXES: .o .c .y .s
.c.o:;     ${CC} -c -o $@ $<
.y.c:;     ${YACC} $<
           ${CP} y/tab/c c.$* ~CDF~V
.s.o:;   ObjAsm -stamp -quit -I <OSLib$SWILibDir> $< $@

#------------------------------------------------------------------------
# Dynamic dependencies:
