# 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 World -	make the whole world
# make system - make libraries and binaries
# make clean -  clean away objects and junk files
# make depend - make include file dependencies
#
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

IMAKECMD = imake
IMAKESRC = localbin
IMAKEREF = conf
#
# directories which contain Makefiles which are built from 'imake'
#
IMAKEDIRS = 	arc chase demo.rccl demo.rci doc drivers fastmath 		lib libCtree localbin locallib programs rccl 		rci robotTypes robots 		puma elbow stan scara 		toolbox util robotsim pdb speedtest jls

# MS removed lsi11 and man, added jls

AUXK_DIR =

VXWLIBDIRS =	chase drivers fastmath libCtree locallib rccl rci 		robotTypes robots util puma elbow stan scara

VXWBINDIRS =    drivers programs

RCCLIBDIRS =	chase drivers fastmath rccl robotTypes robots util rci pdb 		puma elbow stan scara

RCCBINDIRS =	arc programs robotsim drivers robots jls

SUPPORT =	bin/xargs bin/packdeps

World:
		@echo ""
		@echo "Building `cat VERSION`"
		@echo ""
		@echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
		@echo "* Be sure you have made any necessary changes to the *"
		@echo "* site configuration file conf/site.conf.            *"
		@echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
		@echo ""
		@echo ""
# MS Remove the rebuild of imake for Linux machines

		mv Makefile Makefile.bak
		$(MAKE) $(MFLAGS) -f Makefile.bak Makefile
		$(MAKE) $(MFLAGS) Makefiles
		$(MAKE) $(MFLAGS) rciConfig
		$(MAKE) $(MFLAGS) clean
		$(RMCMD) */DependFile
		$(MAKE) $(MFLAGS) depend
		$(MAKE) $(MFLAGS) xcompiledir
		$(MAKE) $(MFLAGS) system
		@echo "make World completed"

P = $$RCCL/lib/

rciConfig:	bin/makeRciConfig
		bin/makeRciConfig h/rciConfig.h rci/rciConfig.c
		$(RMCMD) sys
		ln -s "/sys" sys

	$(RMCMD) conf/.rcc
	echo 'cc = ' gcc >> conf/.rcc
	echo 'begin = $Pbegin.o' >> conf/.rcc
	echo 'end = $Pend.o' >> conf/.rcc
	echo 'ctrl = $PrciCtrl.a' >> conf/.rcc

	echo 'util = $PrciUser.a $PrciCtrl.a $PlibC.a -lm' >> conf/.rcc

	echo 'user = $PrciUser.a $PlibCtree.a' >> conf/.rcc
	echo 'include = $$RCCL/h' >> conf/.rcc
	$(RMCMD) conf/defaultRobot
	echo "puma" > conf/defaultRobot
	$(RMCMD) conf/$(EMPTY)*.JLS
	( echo '/*** DO NOT DELETE/,/*** AND DO NOT DELETE/c' ; 	echo '/* *** DO NOT DELETE THIS LINE: system Makefile uses it */' ; 	echo '#if VXWORKS_CFG' ; 	echo '#define FASTMATH_ENABLED' 0 ; 	echo '#else' ; 	echo '#define FASTMATH_ENABLED' 1 ; 	echo '#endif' ; 	echo '/* *** AND DO NOT DELETE THIS LINE EITHER */' ; 	  echo . ; echo w ; echo q ) | ed - h/fastmath.h

xcompiledir:

		echo "Not building moper code, so no Xcompiler needed"

system:
		cd libCtree; $(MAKE) $(MFLAGS) libs
		cd locallib; $(MAKE) $(MFLAGS) libs
		cd localbin; $(MAKE) $(MFLAGS) install

		$(MAKE) $(MFLAGS) libs
		$(MAKE) $(MFLAGS) bins

# MS Comment		$(MAKE) $(MFLAGS) manpages

depend::	$(SUPPORT)
		@for i in $(IMAKEDIRS) $(AUXK_DIR) ; do		  (cd $$i ; echo making depends in $$i -- ; 		   $(MAKE) $(MFLAGS) depend) ; 		done ;

libs:
		@(cd lib; echo lib -- ; $(MAKE) $(MFLAGS) libs); 		for i in $(RCCLIBDIRS) ; do		  (cd $$i ; echo $$i -- ; $(MAKE) $(MFLAGS) libs) ; 		done

bins:
		@for i in $(RCCBINDIRS) ; do		  (cd $$i ; echo $$i -- ; $(MAKE) $(MFLAGS) install) ; 		done

vxlibs:
		@(cd lib; echo lib -- ; $(MAKE) $(MFLAGS) VXW); 		for i in $(VXWLIBDIRS) ; do		  (cd $$i ; echo $$i -- ; $(MAKE) $(MFLAGS) vxlibs) ; 		done

vxbins:
		@for i in $(VXWBINDIRS) ; do		  (cd $$i ; echo $$i -- ; $(MAKE) $(MFLAGS) vxbins) ; 		done

vxw:		vxlibs vxbins
		cd lib; $(MAKE) $(MFLAGS) vxw

manpages:
		cd man; $(MAKE) $(MFLAGS) man;

clean::
		-@find bin ! \( -name README -o -name bin -o -name packdeps 			     -o -name imake -o -name rmkmf \) 		   -exec rm -f {} \;

		@for i in $(IMAKEDIRS) $(AUXK_DIR) gnuMake ; do		  (cd $$i ; echo cleaning $$i -- ; 		   $(MAKE) $(MFLAGS) clean ) ; 		done ;

		$(RMCMD) lock/$(EMPTY)*
		(cd conf; $(RMCMD) *.JLS $(JUNKFILES) )
		$(RMCMD) $(JUNKFILES)

		$(RMCMD) -r */VXW

bin/xargs:	localbin/xargs.c
		cd localbin; $(MAKE) $(MFLAGS) ../bin/xargs

bin/packdeps:	localbin/packdeps
		cp localbin/packdeps bin

bin/makeRciConfig: localbin/makeRciConfig.c
		cd localbin; $(MAKE) $(MFLAGS) ../bin/makeRciConfig

Makefile:
		@if [ -f Makefile ]; then 			echo "mv Makefile Makefile.BAK"; 			mv Makefile Makefile.BAK; 		else exit 0; fi

		$(IMAKECMD) -I$(IMAKEREF) -DRCCLRootDir=`pwd`

Makefiles:	bin/rmkmf
		RCCL=`pwd`; 		export RCCL; 		for i in $(IMAKEDIRS) $(AUXK_DIR) ; do 		  (cd $$i ; echo creating Makefile in $$i -- ; ../bin/rmkmf);		done

bin/rmkmf:	localbin/rmkmf
		cp localbin/rmkmf bin/rmkmf
		chmod 755 localbin/rmkmf

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

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

depend::

clean::

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

