You don't do it directly within the extconf.rb
; for whatever reason, mkmf
uses a separate file, named depend
, to specify these sorts of things. You put all of your dependencies in the same form you would if you were writing a makefile by hand; so, for a file foo.cpp
that used client.h
and wombat.h
, you would add the following line to depend
:
foo.o: client.h wombat.h`
In the process of building your Makefile
, mkmf
will copy the contents of that file into your Makefile
, causing those rules to be honoured as part of the build process.