CC = g++ CFLAGS = -Wall -g -std=c++11 PROGS = usepoint poll all: $(PROGS) usepoint: usepoint.o Point.o $(CC) $(CFLAGS) -o $@ $^ usepoint.o: usepoint.cc Point.h $(CC) $(CFLAGS) -c $< Point.o: Point.cc Point.h $(CC) $(CFLAGS) -c $< poll: poll.cc $(CC) $(CFLAGS) -o $@ $< clean: rm -f $(PROGS) *.o