CC = egcs
LD = egcs
AR = ar
ARFLAGS = r
NDDSGEN = nddsgen
SYSLIBS = -lm -lpthread

INSTALL_DIR = $(NOMAD_HOME)

DEFINES = 

MODULE = Teleop

INCLUDES = -I$(NDDSHOME)/include/unix \
           -I$(NDDSHOME)/include/share \
	   -I$(INSTALL_DIR)/include

LIBS = 	$(NDDSHOME)/lib/i86Linux5.1/libndds.a    \
       	$(NDDSHOME)/lib/i86Linux5.1/libutilsip.a \
       	$(NDDSHOME)/lib/i86Linux5.1/libutilsxx.a \
	$(SYSLIBS)

ARCHIVE      = lib$(MODULE)Ndds.a

all : $(ARCHIVE)
	/bin/rm -fr h/ objs/

install: all
	/bin/rm -fr h/ objs/
	cp $(ARCHIVE)  $(INSTALL_DIR)/lib/`uname`/.
	cp teleopMsgs.h $(INSTALL_DIR)/include/.
	cp teleopMsgsDef.h $(INSTALL_DIR)/include/.

$(ARCHIVE) : teleopMsgs.o
	$(AR) $(ARFLAGS) $(ARCHIVE) teleopMsgs.o 

teleopMsgs.o : teleopMsgs.c teleopMsgs.h
	$(CC) -o $@ $(DEFINES) $(INCLUDES) -c $<

teleopMsgs.c : teleopMsgs.x
	$(NDDSGEN) teleopMsgs.x $(SM_DRIVER_PUBLICATIONS) -replace

teleopMsgs.h : teleopMsgs.x
	$(NDDSGEN) teleopMsgs.x $(SM_DRIVER_PUBLICATIONS) -replace
clean:
	/bin/rm -f *.o core $(ARCHIVE) teleopMsgs.c teleopMsgs.h 

