# Makefile generated by imake - do not edit!
# $Xorg: imake.c,v 1.6 2001/02/09 02:03:15 xorgcvs Exp $

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# This Makefile was generated automatically from Imakefile, using imake,
# which is provided as part of the X Windows distribution. imake was
# written by Todd Brunhoff and Jim Fulton from the Mit X Consortium.
#
# The rules for turning an Imakefile into a Makefile are located in
# conf/Imake.tmpl and conf/Imake.rules. Platform specific parameters
# are set in the .cf files. Site specific parameters are set in the
# system's CONFIG file. Rules and templates for RCCL/RCI created by
# John Lloyd, McGill University, November 27, 1990.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

      TARGET_DEFS = -D"LINUX_CFG"
              RCC = rcc

               CC = gcc
               LD = ld
             LDIR = ../lib
             BDIR = ../bin

             FCMD = undefined

            RMCMD = /bin/rm -f
        JUNKFILES = *.BAK .*.BAK *~ *.CKP .*.CKP \\\#* *.o *.to *.tO core makelog

C_INCS :=
C_DEFS :=  $(TARGET_DEFS)
C_OPNS :=

C_DEFS := $(C_DEFS) -D"RWU"

       RCC_CFLAGS = $(C_OPNS) $(C_INCS) $(C_DEFS) $(TRACE)

            LUSER = $(LDIR)/rciUser.a
            LCTRL = $(LDIR)/rciCtrl.a
            LPUMA = $(LDIR)/libPuma.a

            LAUXK =

            LLIBC = $(LDIR)/libC.a
           LCTREE = $(LDIR)/libCtree.a
 VOLATILE_RCILIBS = $(LUSER) $(LCTRL)
      ALL_RCILIBS = $(LUSER) $(LCTREE) $(LCTRL) $(LAUXK) $(LLIBC)

.SUFFIXES:	.to .tO

.c.to:
	@if [ -f $*.o ] ; then \
	tmp=\#obj_tmp$$$$; mv $*.o $$tmp; fi; \
	echo $(CC) $(CFLAGS) -c -DTEST $^ '[' -o $*.to ']' ; $(CC) $(CFLAGS) -c -DTEST $^; mv $*.o $*.to; \
	if [ "$$tmp" != "" ] ; then mv $$tmp $*.o; else exit 0; fi
.c.tO:
	@if [ -f $*.o ] ; then \
	tmp=\#obj_tmp$$$$; mv $*.o $$tmp; fi; \
	echo $(RCC) $(CFLAGS) -c -DTEST CTRL $^ '[' -o $*.tO ']' ; $(RCC) $(CFLAGS) -c -DTEST CTRL $^; mv $*.o $*.tO; \
	if [ "$$tmp" != "" ] ; then mv $$tmp $*.o; else exit 0; fi

ULIST :=
CLIST :=
PLIST :=
UOBJS :=
COBJS :=
POBJS :=
UTARGS :=
VXWLO :=
VXWBO :=

define CheckForVXWDir
	if [ ! -d VXW ] ; then
	   if [ -f VXW ] ; then
	      echo error: VXW exits, but is not a directory; exit 1
	   fi
	   echo mkdir VXW
	   mkdir VXW
	fi
endef

#=-=-=-=-=-=-=-=-=-=-=-=- Imakefile starts here -=-=-=-=-=-=-=-=-=-=-=-=-=

# -----------------------------------------------------------------------------
#
# make libs	- build library routines and install them in the appropriate
#		  modules in ../lib
#
# make install	- build the program rciProbe in ../bin
#
# make <prog>	- build a particular program.
#
# -----------------------------------------------------------------------------

CFLAGS = $(RCC_CFLAGS) -g

# program to test the IO driver allocator and interface

iotest:	$(VOLATILE_RCILIBS)
iotest:  IOdriver.to  $(OU) $(OC)
	$(RCC) $(CFLAGS) -o $@ IOdriver.to $(OU) CTRL  $(OC) $(CLIBS) $(LCTRL)
	# chmod u+s $@

# program to peek and poke the rciBus and rciIOPage address spaces

rciProbe:  $(VOLATILE_RCILIBS)
rciProbe:  rciProbe.o rciProbeCtrl.o
	$(RCC) $(CFLAGS) -o $@ rciProbe.o CTRL rciProbeCtrl.o $(CLIBS)
	# chmod u+s $@
UTARGS := $(UTARGS) $(BDIR)/rciProbe

$(BDIR)/rciProbe:  $(VOLATILE_RCILIBS)
$(BDIR)/rciProbe:  rciProbe.o rciProbeCtrl.o
	$(RCC) $(CFLAGS) -o $@ rciProbe.o CTRL rciProbeCtrl.o $(CLIBS)
	# chmod u+s $@
	strip $@

rciProbeCtrl.o:  rciProbeCtrl.c
	$(RCC) $(CFLAGS) -c CTRL $<

# program to test the device drivers themselves

driverTest:	$(VOLATILE_RCILIBS)
driverTest:  driverTest.o driverTestCtrl.o $(OU) $(OC)
	$(RCC) $(CFLAGS) -o $@ driverTest.o $(OU) CTRL driverTestCtrl.o $(OC) $(CLIBS)
	# chmod u+s $@
driverTest.real.o:  driverTest.real.c
	$(RCC) $(CFLAGS) -c CTRL $<

ULIST := $(ULIST) $(LUSER)(IOdriver.o)
UOBJS := $(UOBJS) IOdriver.o

ULIST := $(ULIST) $(LUSER)(IOdriverTable.o)
UOBJS := $(UOBJS) IOdriverTable.o

CLIST := $(CLIST) $(LCTRL)(driErrorMsgs.o)
COBJS := $(COBJS) driErrorMsgs.o
driErrorMsgs.o:  driErrorMsgs.c
	$(RCC) $(CFLAGS) -c CTRL $<

CLIST := $(CLIST) $(LCTRL)(priDriver.o)
COBJS := $(COBJS) priDriver.o
priDriver.o:  priDriver.c
	$(RCC) $(CFLAGS) -c CTRL $<

CLIST := $(CLIST) $(LCTRL)(simDriver.o)
COBJS := $(COBJS) simDriver.o
simDriver.o:  simDriver.c
	$(RCC) $(CFLAGS) -c CTRL $<

CLIST := $(CLIST) $(LCTRL)(memDriver.o)
COBJS := $(COBJS) memDriver.o
memDriver.o:  memDriver.c
	$(RCC) $(CFLAGS) -c CTRL $<

CLIST := $(CLIST) $(LCTRL)(drjDriver.o)
COBJS := $(COBJS) drjDriver.o
drjDriver.o:  drjDriver.c
	$(RCC) $(CFLAGS) -c CTRL $<

CLIST := $(CLIST) $(LCTRL)(vemDriver.o)
COBJS := $(COBJS) vemDriver.o
vemDriver.o:  vemDriver.c
	$(RCC) $(CFLAGS) -c CTRL $<

CLIST := $(CLIST) $(LCTRL)(xydDriver.o)
COBJS := $(COBJS) xydDriver.o
xydDriver.o:  xydDriver.c
	$(RCC) $(CFLAGS) -c CTRL $<

CLIST := $(CLIST) $(LCTRL)(xy2dDriver.o)
COBJS := $(COBJS) xy2dDriver.o
xy2dDriver.o:  xy2dDriver.c
	$(RCC) $(CFLAGS) -c CTRL $<

CLIST := $(CLIST) $(LCTRL)(pioDriver.o)
COBJS := $(COBJS) pioDriver.o
pioDriver.o:  pioDriver.c
	$(RCC) $(CFLAGS) -c CTRL $<

CFLAGS = $(RCC_CFLAGS) -g -O2

CLIST := $(CLIST) $(LCTRL)(triDriver.o)
COBJS := $(COBJS) triDriver.o
triDriver.o:  triDriver.c
	$(RCC) $(CFLAGS) -c CTRL $<

.PHONY: libs
libs:	$(ULIST) $(LUSER)(__.SYMDEF)
$(LUSER)(__.SYMDEF): $(UOBJS)
	ranlib $(LUSER)
.PHONY: libs
libs:	$(CLIST) $(LCTRL)(__.SYMDEF)
$(LCTRL)(__.SYMDEF): $(COBJS)
	ranlib $(LCTRL)
install:	$(UTARGS)

clean::
	$(RMCMD) $(JUNKFILES) *.o *.to *.tO
	$(RMCMD) iotest driverTest rciProbe

depend::
	/bin/ls *.c | sed -e 's/.c$$/.s/' | xargs rm -f
	@if [ -f DependFile ] ; then \
	echo mv DependFile DependFile.BAK; \
	mv DependFile DependFile.BAK; else exit 0; fi
	$(CC) -MM -I$$RCCL/h $(C_INCS) $(C_DEFS)  *.c \
	> DependFile

DependFile:
include DependFile

vpath %.h ..
vpath %.c ..
vpath %.s ..
vxw:		$(LDIR)/vxw.o
$(LDIR)/vxw.o:
	(cd $(LDIR); $(MAKE) $(MFLAGS) vxw)

#=-=-=-=-=-=-=-=-=-=-=-=-= Imakefile ends here =-=-=-=-=-=-=-=-=-=-=-=-=-=

depend::

clean::

# XXX line used by make depend - DO NOT DELETE XXX

