##
#  Makefile for the Go2 library
#  
#  The Gocator 2000 API
#  Copyright (C) 2010 by LMI Technologies Inc.
#  
#  Redistributions of files must retain the above copyright notice.
##

cp = cp -f
rm = rm -f
mkdir = mkdir -p
CC = gcc -fPIC -fno-stack-protector -fvisibility=hidden
DEFS = -DGO2_INTERNAL -DZAPI_STATIC
LINK = ld -shared 
LIBNAME = ../lib/libGo2.so
INCLUDES =  -I../include
CFLAGS = -g $(INCLUDES) $(DEFS)
INSTALLPATH = /lib

SRCS = src/Go2Api.c                                     
        src/Go2Data.c                                           \
        src/Go2DataTypes.c                                      \
        src/Go2Health.c                                         \
        src/Go2Log.c                                            \
        src/Go2Measurement.c                                    \
        src/Go2Object.c                                         \
        src/Go2Output.c                                         \
        src/Go2OutputChannels.c                                 \
        src/Go2Range.c                                          \
        src/Go2Profile.c                                        \
        src/Go2ProfileTypes.c                                   \
        src/Go2Part.c                                           \
        src/Go2PartTypes.c                                      \
        src/Go2Sensor.c                                         \
        src/Go2System.c                                         \
        src/Go2Measurements/Go2PartArea.c                       \
        src/Go2Measurements/Go2PartBoundingBoxLength.c          \
        src/Go2Measurements/Go2PartBoundingBoxWidth.c           \
        src/Go2Measurements/Go2PartBoundingBoxX.c               \
        src/Go2Measurements/Go2PartBoundingBoxY.c               \
        src/Go2Measurements/Go2PartEllipseAngle.c               \
        src/Go2Measurements/Go2PartEllipseMajor.c               \
        src/Go2Measurements/Go2PartEllipseMinor.c               \
        src/Go2Measurements/Go2PartEllipseRatio.c               \
        src/Go2Measurements/Go2PartHeight.c                     \
        src/Go2Measurements/Go2PartHoleRadius.c                 \
        src/Go2Measurements/Go2PartHoleX.c                      \
        src/Go2Measurements/Go2PartHoleY.c                      \
        src/Go2Measurements/Go2PartHoleZ.c                      \
        src/Go2Measurements/Go2PartOpeningAngle.c               \
        src/Go2Measurements/Go2PartOpeningLength.c              \
        src/Go2Measurements/Go2PartOpeningWidth.c               \
        src/Go2Measurements/Go2PartOpeningX.c                   \
        src/Go2Measurements/Go2PartOpeningY.c                   \
        src/Go2Measurements/Go2PartOpeningZ.c                   \
        src/Go2Measurements/Go2PartPlaneXAngle.c                \
        src/Go2Measurements/Go2PartPlaneYAngle.c                \
        src/Go2Measurements/Go2PartPlaneZOffset.c               \
        src/Go2Measurements/Go2PartPositionX.c                  \
        src/Go2Measurements/Go2PartPositionY.c                  \
        src/Go2Measurements/Go2PartPositionZ.c                  \
        src/Go2Measurements/Go2PartStudBaseX.c                  \
        src/Go2Measurements/Go2PartStudBaseY.c                  \
        src/Go2Measurements/Go2PartStudBaseZ.c                  \
        src/Go2Measurements/Go2PartStudRadius.c                 \
        src/Go2Measurements/Go2PartStudTipX.c                   \
        src/Go2Measurements/Go2PartStudTipY.c                   \
        src/Go2Measurements/Go2PartStudTipZ.c                   \
        src/Go2Measurements/Go2PartVolume.c                     \
        src/Go2Measurements/Go2ProfileAngleX.c                  \
        src/Go2Measurements/Go2ProfileBoxArea.c                 \
        src/Go2Measurements/Go2ProfileBridgeValue.c             \
        src/Go2Measurements/Go2ProfileCenterX.c                 \
        src/Go2Measurements/Go2ProfileCenterZ.c                 \
        src/Go2Measurements/Go2ProfileCircleRadius.c            \
        src/Go2Measurements/Go2ProfileCircleX.c                 \
        src/Go2Measurements/Go2ProfileCircleZ.c                 \
        src/Go2Measurements/Go2ProfileDifferenceArea.c          \
        src/Go2Measurements/Go2ProfileDifferencePeak.c          \
        src/Go2Measurements/Go2ProfileDistance.c                \
        src/Go2Measurements/Go2ProfileFlush.c                   \
        src/Go2Measurements/Go2ProfileGap.c                     \
        src/Go2Measurements/Go2ProfileGrooveDepth.c             \
        src/Go2Measurements/Go2ProfileGrooveWidth.c             \
        src/Go2Measurements/Go2ProfileGrooveX.c                 \
        src/Go2Measurements/Go2ProfileGrooveZ.c                 \
        src/Go2Measurements/Go2ProfileHeight.c                  \
        src/Go2Measurements/Go2ProfileIsectAngle.c              \
        src/Go2Measurements/Go2ProfileIsectArea.c               \
        src/Go2Measurements/Go2ProfileIsectX.c                  \
        src/Go2Measurements/Go2ProfileIsectZ.c                  \
        src/Go2Measurements/Go2ProfileLineErrorMax.c            \
        src/Go2Measurements/Go2ProfileLineErrorMin.c            \
        src/Go2Measurements/Go2ProfileLinePercentile.c          \
        src/Go2Measurements/Go2ProfileLineStdDev.c              \
        src/Go2Measurements/Go2ProfilePositionX.c               \
        src/Go2Measurements/Go2ProfilePositionZ.c               \
        src/Go2Measurements/Go2ProfileStripHeight.c             \
        src/Go2Measurements/Go2ProfileStripWidth.c              \
        src/Go2Measurements/Go2ProfileStripX.c                  \
        src/Go2Measurements/Go2ProfileStripZ.c                  \
        src/Go2Measurements/Go2ProfileWidth.c                   \
        src/Go2Measurements/Go2RangeDifference.c                \
        src/Go2Measurements/Go2RangePositionZ.c         
        
OBJS = src/Go2Api.o                                             \
        src/Go2Data.o                                           \
        src/Go2DataTypes.o                                      \
        src/Go2Health.o                                         \
        src/Go2Log.o                                            \
        src/Go2Measurement.o                                    \
        src/Go2Object.o                                         \
        src/Go2Output.o                                         \
        src/Go2OutputChannels.o                                 \
        src/Go2Range.o                                          \
        src/Go2Profile.o                                        \
        src/Go2ProfileTypes.o                                   \
        src/Go2Part.o                                           \
        src/Go2PartTypes.o                                      \
        src/Go2Sensor.o                                         \
        src/Go2System.o                                         \
        src/Go2Measurements/Go2PartArea.o                       \
        src/Go2Measurements/Go2PartBoundingBoxLength.o          \
        src/Go2Measurements/Go2PartBoundingBoxWidth.o           \
        src/Go2Measurements/Go2PartBoundingBoxX.o               \
        src/Go2Measurements/Go2PartBoundingBoxY.o               \
        src/Go2Measurements/Go2PartEllipseAngle.o               \
        src/Go2Measurements/Go2PartEllipseMajor.o               \
        src/Go2Measurements/Go2PartEllipseMinor.o               \
        src/Go2Measurements/Go2PartEllipseRatio.o               \
        src/Go2Measurements/Go2PartHeight.o                     \
        src/Go2Measurements/Go2PartHoleRadius.o                 \
        src/Go2Measurements/Go2PartHoleX.o                      \
        src/Go2Measurements/Go2PartHoleY.o                      \
        src/Go2Measurements/Go2PartHoleZ.o                      \
        src/Go2Measurements/Go2PartOpeningAngle.o               \
        src/Go2Measurements/Go2PartOpeningLength.o              \
        src/Go2Measurements/Go2PartOpeningWidth.o               \
        src/Go2Measurements/Go2PartOpeningX.o                   \
        src/Go2Measurements/Go2PartOpeningY.o                   \
        src/Go2Measurements/Go2PartOpeningZ.o                   \
        src/Go2Measurements/Go2PartPlaneXAngle.o                \
        src/Go2Measurements/Go2PartPlaneYAngle.o                \
        src/Go2Measurements/Go2PartPlaneZOffset.o               \
        src/Go2Measurements/Go2PartPositionX.o                  \
        src/Go2Measurements/Go2PartPositionY.o                  \
        src/Go2Measurements/Go2PartPositionZ.o                  \
        src/Go2Measurements/Go2PartStudBaseX.o                  \
        src/Go2Measurements/Go2PartStudBaseY.o                  \
        src/Go2Measurements/Go2PartStudBaseZ.o                  \
        src/Go2Measurements/Go2PartStudRadius.o                 \
        src/Go2Measurements/Go2PartStudTipX.o                   \
        src/Go2Measurements/Go2PartStudTipY.o                   \
        src/Go2Measurements/Go2PartStudTipZ.o                   \
        src/Go2Measurements/Go2PartVolume.o                     \
        src/Go2Measurements/Go2ProfileAngleX.o                  \
        src/Go2Measurements/Go2ProfileBoxArea.o                 \
        src/Go2Measurements/Go2ProfileBridgeValue.o             \
        src/Go2Measurements/Go2ProfileCenterX.o                 \
        src/Go2Measurements/Go2ProfileCenterZ.o                 \
        src/Go2Measurements/Go2ProfileCircleRadius.o            \
        src/Go2Measurements/Go2ProfileCircleX.o                 \
        src/Go2Measurements/Go2ProfileCircleZ.o                 \
        src/Go2Measurements/Go2ProfileDifferenceArea.o          \
        src/Go2Measurements/Go2ProfileDifferencePeak.o          \
        src/Go2Measurements/Go2ProfileDistance.o                \
        src/Go2Measurements/Go2ProfileFlush.o                   \
        src/Go2Measurements/Go2ProfileGap.o                     \
        src/Go2Measurements/Go2ProfileGrooveDepth.o             \
        src/Go2Measurements/Go2ProfileGrooveWidth.o             \
        src/Go2Measurements/Go2ProfileGrooveX.o                 \
        src/Go2Measurements/Go2ProfileGrooveZ.o                 \
        src/Go2Measurements/Go2ProfileHeight.o                  \
        src/Go2Measurements/Go2ProfileIsectAngle.o              \
        src/Go2Measurements/Go2ProfileIsectArea.o               \
        src/Go2Measurements/Go2ProfileIsectX.o                  \
        src/Go2Measurements/Go2ProfileIsectZ.o                  \
        src/Go2Measurements/Go2ProfileLineErrorMax.o            \
        src/Go2Measurements/Go2ProfileLineErrorMin.o            \
        src/Go2Measurements/Go2ProfileLinePercentile.o          \
        src/Go2Measurements/Go2ProfileLineStdDev.o              \
        src/Go2Measurements/Go2ProfilePositionX.o               \
        src/Go2Measurements/Go2ProfilePositionZ.o               \
        src/Go2Measurements/Go2ProfileStripHeight.o             \
        src/Go2Measurements/Go2ProfileStripWidth.o              \
        src/Go2Measurements/Go2ProfileStripX.o                  \
        src/Go2Measurements/Go2ProfileStripZ.o                  \
        src/Go2Measurements/Go2ProfileWidth.o                   \
        src/Go2Measurements/Go2RangeDifference.o                \
        src/Go2Measurements/Go2RangePositionZ.o         
        
ARCS = ../lib/libzApi.a

.c.o:
	$(rm) -f $@
	$(CC) $(CFLAGS) -c $*.c -o $@

all: $(LIBNAME)

$(LIBNAME) : $(OBJS)
	$(rm) $@
	$(LINK) $(OBJS) $(ARCS) -o $(LIBNAME)

clean:
	$(rm) $(OBJS) $(LIBNAME) core *~
	
install: 
	$(cp) $(LIBNAME) $(INSTALLPATH)
