# Makefile for cpp_onnx_demo.cpp
#
# Usage:
#   make ORT_HOME=/opt/onnxruntime
#   ./cpp_onnx_demo path/to/bayaneunets-v1.0.0.onnx
#
# ORT_HOME should point at an unpacked Microsoft onnxruntime release from
# https://github.com/microsoft/onnxruntime/releases — pick a prebuilt
# linux-x64 archive. Defaults to /usr/local (where most distros' system
# onnxruntime packages land), so on a system with `apt install
# libonnxruntime-dev` you can just `make` with no args.

ORT_HOME ?= /usr/local

CXX      ?= g++
CXXFLAGS ?= -std=c++17 -O2 -Wall -Wextra
LDFLAGS  ?=
LIBS     ?= -lonnxruntime

cpp_onnx_demo: cpp_onnx_demo.cpp
	$(CXX) $(CXXFLAGS) \
		-I$(ORT_HOME)/include \
		-o $@ $< \
		-L$(ORT_HOME)/lib $(LDFLAGS) $(LIBS) \
		-Wl,-rpath,$(ORT_HOME)/lib

clean:
	rm -f cpp_onnx_demo

.PHONY: clean
