# Build on the device. Needs:
#   apt install g++ pkg-config libcamera-dev libevent-dev libjpeg-turbo8-dev
# (Raspberry Pi OS Bullseye+; on older releases the turbo package is libjpeg-dev.)

CXX      ?= g++
CXXFLAGS ?= -O2 -std=c++17 -pipe -Wall -Wextra
PKGS      = libcamera libevent libevent_pthreads libturbojpeg

camera: camera.cpp event_loop.cpp event_loop.hpp
	$(CXX) $(CXXFLAGS) camera.cpp event_loop.cpp \
		$(shell pkg-config --cflags --libs $(PKGS)) -lpthread \
		-o camera

clean:
	rm -f camera

.PHONY: clean
