+all: oble
-all:
- gcc `pkg-config --cflags opencv` -o hello-world hello-world.cpp `pkg-config --libs opencv`
+PKGS = opencv x11 xext xscrnsaver
+CXXFLAGS += $(shell pkg-config --cflags $(PKGS))
+LDFLAGS += $(shell pkg-config --libs $(PKGS))
+
+OBJS = idle_x11.o oble.o
+
+idle_x11.o: idle_x11.h
+oble.o: oble.h
+
+oble: $(OBJS)
+ gcc $(LDFLAGS) -o $@ $(OBJS)
+
+test: all
+ ./oble -c /usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml
+
+dependencies:
+ sudo aptitude install -y libxss-dev
+
+clean:
+ rm -rf oble *.o
+
+new: clean all
+
+.PHONY: clean