Using BSD Make (specifically, I'm doing this on OpenBSD) I can use the wonderful incantation:
Code:
.SUFFIXES: .o .cc
.cc.o:
g++ -g -Wall -c ${.IMPSRC}
To compile C or C++ source to object files from corresponding source. But there's no dependency on the header files, which can obviously be somewhat important. Is there a quick and easy way to put the corresponding header file into this equation too?
I realize that normally alpha.h depends on beta.h and so forth, and that these special dependencies can be done the "normal" way with Make, so I am curious about the generic case that every .cc (C++ source) file depends on the .hh (C++ header) file of the same name.
Thanks for any tips.