# 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 -=-=-=-=-=-=-=-=-=-=-=-=-=

CFLAGS = $(RCC_CFLAGS) $(GOPTS) -g

SIMOBJS = hostIO.o 	  specialIO.o 	  genericIO.o 	  manipIO.o 	  manipSim.o 	  rbtControl.o 	  display.o 	  simFxns.o 	  robotsim.o 	  linkedList.o 	  configFile.o

GOBJS :=  grf4.o grf4GenDraw.o grf4GenObject.o hidden.o 	  grf4Sunview.o grf4Gl.o grf4Glwf.o grf4X11.o

RBTGO :=  rbtStan.o rbtElbow.o rbtPuma.o rbtGraphics.o

GLIBS := $(GLIBS) /usr/X11R6/lib/libX11.a -ldl
GOPTS := $(GOPTS) -DX11_GRAPHICS -D$(EMPTY)X11R6

GOPTS := $(GOPTS) -I$(EMPTY)/usr/X11R6/include

RCCLIBS =  $(LCTRL) $(LUSER) $(LCTRL) $(LAUXK)

poly:  polytest.o $(GOBJS) grf4Support.o chull.o
	$(CC) $(CFLAGS) -o $@ polytest.o $(GOBJS) grf4Support.o chull.o $(LLIBC) $(GLIBS) -lm $(CLIBS)

robotsim:  $(SIMOBJS) $(GOBJS) $(RBTGO) $(RCCLIBS)
	$(CC) $(CFLAGS) -o $@ $(SIMOBJS) $(GOBJS) $(RBTGO) $(RCCLIBS)  		       $(LCTREE) $(GLIBS) $(LLIBC) -lm $(CLIBS)

UTARGS := $(UTARGS) $(BDIR)/robotsim
$(BDIR)/robotsim:  $(SIMOBJS) $(GOBJS) $(RBTGO) 		$(RCCLIBS)
	$(CC) $(CFLAGS) -o $(BDIR)/robotsim $(SIMOBJS) $(GOBJS) $(RBTGO) 		$(RCCLIBS) $(LCTREE) $(GLIBS) $(LLIBC) -lm $(CLIBS)
	strip $(BDIR)/robotsim

# various testing programs ...

grf4Test:  grf4Test.o grf4Support.o $(GOBJS)
	$(CC) $(CFLAGS) -o $@ grf4Test.o grf4Support.o $(GOBJS) $(LLIBC) $(GLIBS) -lm $(CLIBS)

vclip:  vclip.o grf4Support.o $(GOBJS)
	$(CC) $(CFLAGS) -o $@ vclip.o grf4Support.o $(GOBJS) $(GLIBS) -lm $(CLIBS)

# utility programs ...

RCISimMuxd:  RCISimMuxd.o
	$(CC) $(CFLAGS) -o $@ RCISimMuxd.o  $(CLIBS)

UTARGS := $(UTARGS) $(BDIR)/RCISimMuxd
$(BDIR)/RCISimMuxd:  RCISimMuxd.o
	$(CC) $(CFLAGS) -o $(BDIR)/RCISimMuxd RCISimMuxd.o  $(CLIBS)
	strip $(BDIR)/RCISimMuxd

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

install:	$(UTARGS)

clean::
	$(RMCMD) $(JUNKFILES) *.o *.to *.tO
	$(RMCMD) robotsim testhostIO RCISimMuxd poly grf4Test

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) $(GOPTS) *.c \
	> DependFile

DependFile:
include DependFile

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

depend::

clean::

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

