# VTI Instruments, Inc. (Ametek Instruments)
# Copyright 2014
# Nick Barendt
#
# Makefile to build the Linux pnp driver for the EX1048

# general compilation and linker variables
EX1048_SRC_DIR = $(strip $(shell pwd))

export UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
  export CFLAGS += -lrt -lpthread 
endif

export CFLAGS += -Wall -O3 -I/$(SHARED_DIR) 
export SHARED_DIR = $(EX1048_SRC_DIR)/shared
export SCPILIB_DIR = $(EX1048_SRC_DIR)/scpilib

# update VPATH so make can find everything it needs
export VPATH += $(SHARED_DIR)

ex1048_sub_dir  = shared scpilib pnpclient

all:	
	for i in $(ex1048_sub_dir)  ; do \
		[ ! -d $$i ] || make -C $$i || exit $? ; \
	done

clean:
	for i in $(sort $(ex1048_sub_dir)) ; do \
		[ ! -d $$i ] || make -C $$i clean; \
	done
