# 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 arc 	- creates a version of arc, in this directory, that does
#		  not have built in robot kinematic functions.
# make arc.rbt  - creates a version of arc, in this directory, that does
#		  have built in kinematic functions for specific robots
#		  which are known to RCCL/RCI.
#
# make install	- puts a copy of arc.rbt into ../bin/arc
#
# -----------------------------------------------------------------------------

CFLAGS = $(RCC_CFLAGS) -O

GENOBJS = 	arc.o doubleOp.o integerOp.o matrixFunc.o scalarFunc.o 		input.o output.o error.o fileIO.o symtable.o 		matrixAlloc.o matrixLib.o talloc.o 		transFunc.o transLib.o actions.o gtype.o 		helpFileName.o invert.o

RBTLIBS = 	$(LUSER) $(LCTRL) $(LUSER) $(LCTRL) $(LAUXK) $(LLIBC)

ARC_LIBS = $(LLIBC) -lm
ARCRBT_LIBS = $(RBTLIBS) -lm

ARC_OBJS = $(GENOBJS) function.o
ARCRBT_OBJS = $(GENOBJS) function.ro robots.o

arc:  $(ARC_OBJS)
	$(CC) $(CFLAGS) -o $@ $(ARC_OBJS) $(ARC_LIBS) $(CLIBS)

arc.rbt:  $(ARCRBT_OBJS)
	$(CC) $(CFLAGS) -o $@ $(ARCRBT_OBJS) $(ARCRBT_LIBS) $(CLIBS)

UTARGS := $(UTARGS) $(BDIR)/arc
$(BDIR)/arc:  $(ARCRBT_OBJS)
	$(CC) $(CFLAGS) -o $(BDIR)/arc $(ARCRBT_OBJS) $(ARCRBT_LIBS) $(CLIBS)
	strip $(BDIR)/arc

UTARGS := $(UTARGS) ../man/man1/arc.1
../man/man1/arc.1:  arc.1
	cp arc.1 $@

function.ro:  function.c
	@if [ -f function.o ] ; then \
	tmp=\#obj_tmp$$$$; mv function.o $$tmp; fi; \
	echo $(CC) $(CFLAGS) -c -DROBOTS $^ '[' -o function.ro ']' ; $(CC) $(CFLAGS) -c -DROBOTS $^; mv function.o function.ro; \
	if [ "$$tmp" != "" ] ; then mv $$tmp function.o; else exit 0; fi

arc.o:		lex.yy.c y.tab.c
		$(CC) $(CFLAGS) y.tab.c -c
		mv y.tab.o arc.o

y.tab.c:	arc.y
		bison arc.y
		mv arc.tab.c y.tab.c

lex.yy.c:	arc_lex.l
		flex -l  arc_lex.l

invert.o:  invert.c
	$(CC) $(CFLAGS) -c $<

matrixLib.o:	matrixLib.c
		$(CC) -c $(CFLAGS) -DNOFORTRAN matrixLib.c

install:	$(UTARGS)

clean::
	$(RMCMD) $(JUNKFILES) *.o *.to *.tO
	$(RMCMD) *.ro y.tab.c lex.yy.c arc arc.rbt

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

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

depend::

clean::

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

