Pintool Makefile

Pintool Makefile

Unfortunately there hasn’t been a new blogpost in a while. Today’s
blogpost will be a short one.

So, anyone that has been using pintool on windows has faced the beautiful
Nmakefile that you get to use. And it only works using the Visual
Studio Command Prompt, which is basically cmd.exe with some extra
environment variables set.

Being a bash user nowadays (yes, you can have bash on windows using e.g.
Cygwin), it is useful to me to be able to
build my pintools from the bash terminal, rather than the command prompt.
(Note that Git for Windows also
ships with a bash terminal and a nice amount of bash utilities, such as
grep etc.)

That being said, the bash Pintool Makefile can be found
(Click on the raw button at github in order to get it in

You will want to set the PINTOOL variable to the relative or
absolute path in which you’ve installed (read: unpacked) pintool. Finally,
set the DLLS variable to the name of your dll (you can also do
multiple dll’s, if you want to build multiple pintools.) Note that a
pintool called abc.dll is built from the sourcefile abc.cpp.

From now on, you can build your pintool(s) simply by executing make
in your bash terminal. If you want to delete the compiled files, simply
run make clean. (In the Makefile you can see that the *.dll
etc are single-quoted, this is because the windows port of make
simply crashes when you try to run e.g. rm *.dll directly. If
anyone has a solution for me.. please do tell, and I’ll buy you a beer in

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>