# 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 <testprog> - build a particular test program
#
# -----------------------------------------------------------------------------

CFLAGS = $(RCC_CFLAGS) -g
RTL_CFLAGS = -I/pkg/realtime/rtlinux-2.2/linux/include -I/pkg/realtime/rtlinux-2.2/include -I/pkg/realtime/rtlinux-2.2 -I/pkg/realtime/rtlinux-2.2/include/posix -Wall -Wstrict-prototypes -O2 -D__SMP__ -D__RTL__ -D__KERNEL__ -DMODULE -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586 -fomit-frame-pointer

TESTO =	testAngles.o pumaSingular.o

# program to test singularity code

pstest:	$(VOLATILE_RCILIBS)
pstest:  pumaSingular.to $(LUSER) $(PUMA)  $(OU) $(OC)
	$(RCC) $(CFLAGS) -o $@ pumaSingular.to $(LUSER) $(PUMA) $(OU) CTRL  $(OC) $(CLIBS)
	# chmod u+s $@

# program to test Jacobian routines

testJacobian:	$(VOLATILE_RCILIBS)
testJacobian:  testJacobian.o pumaJacobian.o $(TESTO)  $(OU) $(OC)
	$(RCC) $(CFLAGS) -o $@ testJacobian.o pumaJacobian.o $(TESTO) $(OU) CTRL  $(OC) $(CLIBS)
	# chmod u+s $@

# program to test kinematic routines

testKinematics:	$(VOLATILE_RCILIBS)
testKinematics:  testKinematics.o pumaKinematic.o $(TESTO)  $(OU) $(OC)
	$(RCC) $(CFLAGS) -o $@ testKinematics.o pumaKinematic.o $(TESTO) $(OU) CTRL  $(OC) $(CLIBS)
	# chmod u+s $@

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

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

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

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

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

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

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

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

CLIST := $(CLIST) $(LCTRL)(puma_pendant.o)
COBJS := $(COBJS) puma_pendant.o
puma_pendant.o:  puma_pendant.cpp
	gcc $(CFLAGS) -c $<

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

.PHONY: libs
libs:	$(CLIST) $(LCTRL)(__.SYMDEF)
$(LCTRL)(__.SYMDEF): $(COBJS)
	ranlib $(LCTRL)

clean::
	$(RMCMD) $(JUNKFILES) *.o *.to *.tO
	$(RMCMD) testKinematics testJacobian pstest

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

