CXX=$(CROSS_COMPILE)g++
ws:=
ws:=$(ws) $(ws)
PLATFORM=$(subst $(ws),_,$(filter-out eabi% elf gnu% linux none pc unknown,$(subst -,$(ws),$(shell $(CXX) -dumpmachine))))
SOURCES=xiSample.cpp
OBJECTS=$(SOURCES:.cpp=.o)
PROGRAM=xiSample

all: $(PROGRAM)

$(PROGRAM): $(OBJECTS)
	$(CXX) -g $(OBJECTS) -o $@ -L../bin/$(PLATFORM) -Wl,-rpath-link=../bin/libusb/$(PLATFORM):../bin/libtiff/$(PLATFORM) -lm3api

.cpp.o: $(patsubst %.cpp,%.o,$(wildcard *.cpp))
	$(CXX) -g -c $< -o $@

clean:
	rm -f $(PROGRAM) $(OBJECTS)
