CC = g++ CFLAGS = -Wall -g -std=c++17 PROGS = pointer reference passbyreference styleguide usepoint poll1 poll2 PROGS2 = brokenpassbyreference constmadness all: $(PROGS) pointer: pointer.cc $(CC) $(CFLAGS) -o $@ $< reference: reference.cc $(CC) $(CFLAGS) -o $@ $< passbyreference: passbyreference.cc $(CC) $(CFLAGS) -o $@ $< brokenpassbyreference: brokenpassbyreference.cc $(CC) $(CFLAGS) -o $@ $< constmadness: constmadness.cc $(CC) $(CFLAGS) -o $@ $< styleguide: styleguide.cc $(CC) $(CFLAGS) -o $@ $< 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 $< poll1: poll1.cc $(CC) $(CFLAGS) -o $@ $< poll2: poll2.cc $(CC) $(CFLAGS) -o $@ $< clean: rm -f $(PROGS) $(PROGS2) *.o