I have 3 files
main.cpp
a.h
b.h
main.cpp includes both a.h and b.h b.h includes a.h
could anyone explain me how should I write a make file for this?
Is this correct?
objects = main.o
sources = main.cpp
myProj: $(objects)
g++ -o myProj $(objects)
main.o: a.h b.h
$(objects): $(sources)
g++ -c $(sources)
clean:
rm $(objects) myProj
I dont know how to specify the dependency of b.h on a.h