# 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 install - build RCI robot control utility programs and install them
#		 into ../bin
#
# -----------------------------------------------------------------------------

CFLAGS = $(RCC_CFLAGS) -g

UTILP =	free primecal move power teachdemo potcal zerograv pumacal

all:		$(UTILP)

free:  $(VOLATILE_RCILIBS)
free:  free.o support.o
	$(RCC) $(CFLAGS) -o $@ free.o support.o CTRL  $(CLIBS)
	# chmod u+s $@

primecal:  $(VOLATILE_RCILIBS)
primecal:  primecal.o support.o
	$(RCC) $(CFLAGS) -o $@ primecal.o support.o CTRL  $(CLIBS)
	# chmod u+s $@

move:  $(VOLATILE_RCILIBS)
move:  move.o support.o
	$(RCC) $(CFLAGS) -o $@ move.o support.o CTRL  $(CLIBS)
	# chmod u+s $@

power:  $(VOLATILE_RCILIBS)
power:  power.o support.o
	$(RCC) $(CFLAGS) -o $@ power.o support.o CTRL  $(CLIBS)
	# chmod u+s $@

teachdemo:  $(VOLATILE_RCILIBS)
teachdemo:  teachdemo.o support.o
	$(RCC) $(CFLAGS) -o $@ teachdemo.o support.o CTRL  $(CLIBS)
	# chmod u+s $@

potcal:  $(VOLATILE_RCILIBS)
potcal:  potcal.o support.o potcalCtrl.o
	$(RCC) $(CFLAGS) -o $@ potcal.o support.o CTRL potcalCtrl.o $(CLIBS)
	# chmod u+s $@

zerograv:  $(VOLATILE_RCILIBS)
zerograv:  zerograv.o support.o zerogravCtrl.o
	$(RCC) $(CFLAGS) -o $@ zerograv.o support.o CTRL zerogravCtrl.o $(CLIBS)
	# chmod u+s $@

pumacal:  $(VOLATILE_RCILIBS)
pumacal:  pumacal.o support.o potcalCtrl.o
	$(RCC) $(CFLAGS) -o $@ pumacal.o support.o CTRL potcalCtrl.o $(CLIBS)
	# chmod u+s $@

UTARGS := $(UTARGS) $(BDIR)/free

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

UTARGS := $(UTARGS) $(BDIR)/primecal

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

UTARGS := $(UTARGS) $(BDIR)/move

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

UTARGS := $(UTARGS) $(BDIR)/power

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

UTARGS := $(UTARGS) $(BDIR)/teachdemo

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

UTARGS := $(UTARGS) $(BDIR)/potcal

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

UTARGS := $(UTARGS) $(BDIR)/zerograv

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

UTARGS := $(UTARGS) $(BDIR)/pumacal

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

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

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

install:	$(UTARGS)

clean::
	$(RMCMD) $(JUNKFILES) *.o *.to *.tO
	$(RMCMD) $(UTILP)

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

