# ARexx Interface Library (Rxil) makefile
# Lattice 'C'


# Note that this makefile operates on a "replacement" basis.
# Any library module which is added or changed will be merely replaced
# in the library.  The implication is that if a module should be
# deleted for whatever reason, it would remain in the library.
# Removal should be done manually, or the library should be deleted,
# a total rebuild performed.



# *** Change these to fit your system.

SRC=Cstuff:Mine/Lib/Rxil/
OBJ=Cstuff:Mine/Lib/Rxil/obj/
DEST=MyLib:
S=myin:rxil.h



# On command line to make:
#
#		DFLAG=-d1		Line only debugging in CPR
#		DFLAG=-d3		Full debugging in CPR
#
# Default here is to put a small amount of debugging info in.
# Note that this define is used only for the demo, not the library
# modules themselves.
DFLAG = -d1


# And override this with LDFLAG=NODEBUG
LDFLAG = ADDSYM



LFLAGS= BATCH VERBOSE 

CFLAGS= -b1 -cft -mat -q3e -r1s -j85e86e87e88e -v



# Rule to make a 32 bit int object file (for the Library)
.c.o:
	lc $(CFLAGS) -d0 -o$@ $*.c
	oml $(DEST)rxil.lib r $@




all:	$(DEST)rxil.lib   demo



#---------------------   The Demo Program   -----------------------

demo:	demo.o
	blink   $(LFLAGS) $(LDFLAG) \
		FROM   LIB:c.o $?   LIB:rexxglue.o \
		TO   $@ \
		LIBRARY   LIB:lc.lib   LIB:amiga.lib   LIB:rxil.lib \
		MAP $*.map F,H,L,O,S,X \

#		PLAIN  INDENT 0  HEIGHT 60  PWIDTH 20  SWIDTH 32  WIDTH 80


demo.o:	demo.c	$S
	lc $(CFLAGS) $(DFLAG) -o$@ $*.c



#--------------------   The Library   -----------------------------

# These are the library modules
PIECES= $(OBJ)cancel.o \
		$(OBJ)check_port.o \
		$(OBJ)check_result.o \
		$(OBJ)cleanup.o \
		$(OBJ)console.o \
		$(OBJ)create_rxi.o \
		$(OBJ)delete_port.o \
		$(OBJ)diag.o \
		$(OBJ)dispatch.o \
		$(OBJ)handle_return.o \
		$(OBJ)init.o \
		$(OBJ)launch.o \
		$(OBJ)lock.o \
		$(OBJ)misc.o \
		$(OBJ)set_result.o \
		$(OBJ)to_rexx.o



$(DEST)rxil.lib:	$(PIECES)




$(OBJ)cancel.o:			$(SRC)cancel.c			$S

$(OBJ)check_port.o:		$(SRC)check_port.c		$S

$(OBJ)check_result.o:	$(SRC)check_result.c	$S

$(OBJ)cleanup.o:		$(SRC)cleanup.c			$S

$(OBJ)console.o:		$(SRC)console.c			$S

$(OBJ)create_rxi.o:		$(SRC)create_rxi.c		$S

$(OBJ)delete_port.o:	$(SRC)delete_port.c		$S

$(OBJ)diag.o:			$(SRC)diag.c			$S

$(OBJ)dispatch.o:		$(SRC)dispatch.c		$S

$(OBJ)handle_return.o:	$(SRC)handle_return.c	$S

$(OBJ)init.o:			$(SRC)init.c			$S

$(OBJ)launch.o:			$(SRC)launch.c			$S

$(OBJ)lock.o:			$(SRC)lock.c			$S

$(OBJ)misc.o:			$(SRC)misc.c			$S

$(OBJ)rexxcom.o:		$(SRC)rexxcom.c			$S

$(OBJ)set_result.o:		$(SRC)set_result.c		$S

$(OBJ)to_rexx.o:		$(SRC)to_rexx.c			$S

