\documentclass{article}

\usepackage{index}

\newindex{default}{idx}{ind}{}

\begin{document}

  \def\DIREC{\bgroup\catcode`\#=12 \doDIREC}
  \def\doDIREC#1{\egroup\texttt{#1}\index{#1}}

  \DIREC{#include}

  \printindex

\end{document}
