# AUTHOR: Michael Wagner
# CREATED 4/15/99
# DESCRIPTION: The makefile for a sensor driver. Change SENSOR_NAME
# as well as the LIBS that need to be included.
# TBD: Have this file include a sensor-specific makefile for necessary libs 
# and such.

SENSOR_NAME = hiResSensor
#SENSOR_NAME = armSensor

INSTALL_DIR = $(NOMAD_HOME)

DEFINES = -D_UNIX -g

SYSLIBS = -lm -lpthread

ARCH = $(shell uname)

LIBS =  $(NOMAD_HOME)/lib/$(ARCH)/libSensorsNdds.a \
	$(NOMAD_HOME)/lib/$(ARCH)/libDatabaseNdds.a \
	$(NDDSHOME)/lib/$(ARCH)/libndds.a \
	$(NDDSHOME)/lib/$(ARCH)/libutilsip.a \
	$(NDDSHOME)/lib/$(ARCH)/libutilsxx.a \
	$(NOMAD_HOME)/lib/$(ARCH)/lib$(SENSOR_NAME).a \
	$(NOMAD_HOME)/lib/$(ARCH)/libFrameGrabber.a \
	$(NOMAD_HOME)/lib/$(ARCH)/libHiResPtu.a \
	$(NOMAD_HOME)/lib/$(ARCH)/libppm.a \
	$(NOMAD_HOME)/lib/$(ARCH)/libDatabase.a \
	$(NOMAD_HOME)/lib/$(ARCH)/libacqHiResDriver.a \
	$(NOMAD_HOME)/lib/$(ARCH)/libLensController.a \
	$(NOMAD_HOME)/lib/$(ARCH)/libTeleopNdds.a \
	$(NOMAD_HOME)/lib/$(ARCH)/libTelemetryNdds.a \
	$(NOMAD_HOME)/lib/$(ARCH)/libSAS_Config.a \
	$(SYSLIBS)

INCS = 	-I$(NOMAD_HOME)/include/ \
	-I$(NDDSHOME)/include/share \
	-I$(NDDSHOME)/include/unix \
	-I/usr/local/ptu-cpi/include/ \
	-I/usr/local/pxc/pxc200

all: $(SENSOR_NAME)

install: all
	cp $(SENSOR_NAME) $(INSTALL_DIR)/bin/$(ARCH)/. 

$(SENSOR_NAME): sensorMain.cpp sensorMain.h
	/bin/rm -f currentSensor.h
	/bin/rm -f currentSensorDef.h
	ln -s ../$(SENSOR_NAME)/$(SENSOR_NAME).h currentSensor.h
	ln -s ../$(SENSOR_NAME)/$(SENSOR_NAME)Def.h currentSensorDef.h
	g++ -o $(SENSOR_NAME) sensorMain.cpp $(LIBS) $(INCS) $(DEFINES) 

clean:
	/bin/rm -f $(SENSOR_NAME)






