NUCLEO_CPPFLAGS = $(shell nucleo-config --cppflags)
NUCLEO_CXXFLAGS = $(shell nucleo-config --cxxflags)
NUCLEO_LDFLAGS  = $(shell nucleo-config --ldflags)
NUCLEO_LIBS     = $(shell nucleo-config --libs)

CPPFLAGS = $(NUCLEO_CPPFLAGS)
CXXFLAGS = $(NUCLEO_CXXFLAGS)
LDFLAGS  = $(NUCLEO_LDFLAGS)
LIBS     = $(NUCLEO_LIBS)

all: hello difference difference2

hello: hello.cxx
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LIBS)

difference: difference.cxx
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LIBS)

difference2: difference2.cxx
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LIBS)

clean:
	rm -f *~ *.o

distclean: clean
	rm -f hello difference difference2
