# Build on device:
#   apt install g++
#   make
# All deps (spidev, gpiochip, i2c-dev, termios) are kernel headers — no apt libs needed.

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

TARGETS   = lora_tx lora_rx imu_test gps_test

all: $(TARGETS)

lora_tx: lora_tx.cpp lr1121_malnus.hpp
	$(CXX) $(CXXFLAGS) $< -lpthread -o $@

lora_rx: lora_rx.cpp lr1121_malnus.hpp
	$(CXX) $(CXXFLAGS) $< -lpthread -o $@

imu_test: imu_test.cpp icm20948.hpp
	$(CXX) $(CXXFLAGS) $< -lpthread -o $@

gps_test: gps_test.cpp gps.hpp
	$(CXX) $(CXXFLAGS) $< -o $@

clean:
	rm -f $(TARGETS)

.PHONY: all clean
