View Single Post
  #1   (View Single Post)  
Old 25th November 2008
taylor_venable taylor_venable is offline
Real Name: Taylor Venable
Security Programmer
 
Join Date: Jun 2008
Location: Indiana, USA
Posts: 6
Default (Net|Open)BSD Make: implicit C header dependencies

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.
__________________
How many shells could Shell sort sort if Shell sort could sort shells?
Reply With Quote