####################################################################################
# The testapp_makefile of LPT/USB testing application.
# Author: Matt Longmire, SBIG
####################################################################################
# How to run this script:
# 1) change directory to 'sbig'
# 2) make 
# Note: Linker uses shared libraries and do not forget to put
# *.so libraries to the /usr/lib directory and 
# setenv LD_LIBRARY_PATH to this path. See README.txt for details. 
####################################################################################
APP_NAME   = testapp
S_APP      = testmain.cpp csbigcam.cpp csbigimg.cpp
O_APP      = testmain.o csbigcam.o csbigimg.o
####################################################################################
APP_SRC    = $(S_APP)
APP_OBJ    = $(O_APP)
INCLUDE    = -I .
LIBRARY    = -L../drv -L/usr/lib
APP_CFLAGS = -O2 $(RPM_OPT_FLAGS) $(INCLUDE) $(LIBRARY) -Wall
APP_CC     = g++
####################################################################################
all: $(APP_NAME)
####################################################################################
# APP_NAME
####################################################################################
$(APP_NAME): $(APP_OBJ)
#	  $(APP_CC) $(APP_CFLAGS) -o $(APP_NAME) $(APP_OBJ) -lsbigudrv -lcfitsio -lm
	  $(APP_CC) $(APP_CFLAGS) -o $(APP_NAME) $(APP_OBJ) -lsbigudrv32 -lm
	  chmod a+x $(APP_NAME)

testmain.o : testmain.cpp csbigcam.h csbigimg.h
	  $(APP_CC) $(APP_CFLAGS) -o testmain.o -c testmain.cpp

csbigcam.o : csbigcam.cpp csbigcam.h csbigimg.h
	  $(APP_CC) $(APP_CFLAGS) -o csbigcam.o -c csbigcam.cpp

csbigimg.o : csbigimg.cpp csbigimg.h
	  $(APP_CC) $(APP_CFLAGS) -o csbigimg.o -c csbigimg.cpp
####################################################################################
clean:
		rm -f *.o
		rm -f *.so
		rm -f *.a
####################################################################################
