# VTI Instruments, Inc. (Ametek Instruments)
# Copyright 2015
#
# Makefile to build the EX10xxA Calibration

# general compilation and linker variables
EX1048_EXAMPLE_DIR = $(strip $(shell pwd) )
EX10xxA_CALIB = ex10xxa_calibration

CFLAGS  += -I../driver/shared -I../driver/scpilib -I../driver/pnpclient
LDLIBS  += -lm
LIBPATH  = ../driver/pnpclient
LIBNAME  = ex1048client

EXAMPLE_CSRC = \
	ex10xxa_cal.cpp\

EXAMPLE_OBJS = $(patsubst %.c,%.o, $(EXAMPLE_CSRC))
EXAMPLE_HDRS = 

all: $(EX10xxA_CALIB)

$(EXAMPLE_OBJS): %.o: %.c  $(EXAMPLE_HDRS) Makefile
	@test -s $(LIBPATH)/lib$(LIBNAME).so || { echo "Shared library (lib$(LIBNAME).so) required to build the example doesn't exist! Exiting..."; exit 1; }
	g++ $(CFLAGS) -c $< -o $*.o

$(EX10xxA_CALIB): $(EXAMPLE_OBJS)
	g++ $(CFLAGS) $(LDFLAGS) $(EXAMPLE_OBJS) -o $@  $(LDLIBS) -L$(LIBPATH) -l$(LIBNAME)

clean:
	rm -f *.o *.gdb
	rm -f $(EX10xxA_CALIB)
