# $Id$

## the following set are used to define oneAPI Level Zero Metric API based implementation
INTEL_L0_HEADERS ?= /usr/include

GPUCOMP = components/intel_gpu
GPU_INTERNAL = $(GPUCOMP)/internal
GPUSRCS = $(GPUCOMP)/linux_intel_gpu_metrics.c
GPUSRCS += $(GPU_INTERNAL)/src/GPUMetricInterface.cpp $(GPU_INTERNAL)/src/GPUMetricHandler.cpp
GPUHEADER=$(GPU_INTERNAL)/inc/GPUMetricInterface.h


COMPSRCS += $(GPUSRCS) $(GPULIBSRCS)
GPUOBJS = GPUMetricInterface.o GPUMetricHandler.o linux_intel_gpu_metrics.o
COMPOBJS += $(GPUOBJS)

CFLAGS += $(LDL) -g -I$(GPU_INTERNAL) -I$(GPU_INTERNAL)/inc -D_GLIBCXX_USE_CXX11_ABI=1
LDFLAGS += -ldl

GPUMetricInterface.o:  $(GPU_INTERNAL)/src/GPUMetricInterface.cpp $(GPUHEADER)
	$(CXX) -g -fpic $(CFLAGS) $(CPPFLAGS) -I$(GPU_INTERNAL)/inc -I$(INTEL_L0_HEADERS) -o GPUMetricInterface.o -c $(GPU_INTERNAL)/src/GPUMetricInterface.cpp

GPUMetricHandler.o:  $(GPU_INTERNAL)/src/GPUMetricHandler.cpp $(GPUHEADER) $(GPU_INTERNAL)/inc/GPUMetricHandler.h
	$(CXX) -g -fpic $(CFLAGS) $(CPPFLAGS) -I$(GPU_INTERNAL)/inc -I$(INTEL_L0_HEADERS) -o GPUMetricHandler.o -c $(GPU_INTERNAL)/src/GPUMetricHandler.cpp

linux_intel_gpu_metrics.o: $(GPUCOMP)/linux_intel_gpu_metrics.c $(GPUHEADER)
	$(CC) $(LIBCFLAGS) $(CFLAGS) $(CPPFLAGS) $(OPTFLAGS) -g -o linux_intel_gpu_metrics.o -c $(GPUCOMP)/linux_intel_gpu_metrics.c $(LDFLAGS)

##clean:
