f1: f1.cpp f.h g++ -c -Wall -g f1.cpp f2: f2.cpp f.h g++ -c -Wall -g f.cpp
This makefile does not compile f2.cpp to f2.
f2.cpp
f2.
Because make only processes the first target (goal). To do both add this as the first rule:
all: f1 f2