# vhost C++ test program build
# Requires ZEBU_ROOT (source scripts/env.csh first).
# SCE-MI include/lib paths follow a standard ZeBu installation layout;
# adjust SCEMI_INC / SCEMI_LIB if the site layout differs.

CXX      ?= g++
CXXFLAGS ?= -O2 -g -std=c++17 -Wall

SCEMI_INC := $(ZEBU_ROOT)/share/scemi/include
SCEMI_LIB := $(ZEBU_ROOT)/lib

TARGET := pcie_vhost_test
SRCS   := main.cpp pcie_vhost_zebu.cpp
OBJS   := $(SRCS:.cpp=.o)

all: $(TARGET)

$(TARGET): $(OBJS)
	$(CXX) $(CXXFLAGS) -o $@ $(OBJS) -L$(SCEMI_LIB) -lSceMi -lpthread

%.o: %.cpp pcie_vhost_api.h
	$(CXX) $(CXXFLAGS) -I$(SCEMI_INC) -c $< -o $@

clean:
	rm -f $(OBJS) $(TARGET)

.PHONY: all clean
