'makedepend', 'imake' and 'xmkmf' in X11R6.4 distributions

Samy Alex ZAIMI zaimi@kiwi.iamp.tohoku.ac.jp
Sun May 23 21:40:00 GMT 1999

Hello everyone,
I would like to give some hints for proper use of
'makedepend' with X11R6. This could become part of
a FAQ or something.
The maintainers of X11R6 distributions should read
the part that concerns configuration of
'cygwin.cf' and 'cygwin32.cf' in the folder

First of all, for those who do not know what I am
talking about :
1. 'imake' is a tool similar to 'make' that comes
with X11 binary distribution. The purpose is to
produce one or several 'Makefile' from a model
incidently called 'Imakefile'. Some packaged
programs contain such Imakefile, but this is by no
way a very spread rule.
2. 'xmkmf' is a shell script that automates the
above process, and calls 'imake' with proper
options (like the path where to search for config
3. when 'xmkmf' is launched with the option '-a',
it does more or less a 'imake (options) ; make
Makefiles ; make depend ; make all'. Note that
'make depend' actually calls 'makedepend'.

Q: So what is 'makedepend' ?
A: It is just a utility that builds dependencies
by scanning each '*.c' files that are about to be

Q: How does it work ?
A: It scans c files, and search an absolute access
path for all included files (headers, sources).

Q: What's the problem ?
A: The search paths. They are hard coded. And most
oftenly they never match local installations. So,
if one intends to use heavily this tool, he/she'd
better recompile it from scratch, so that local
search paths are properly configured.

Q: How do I recompile 'makedepend' ?
A: First of all, download the sources, from
' ftp://ftp.x.org/pub/R6.4/xc/config/makedepend/ '
or any mirror.

Q: Next ?
A: Edit the file 'main.c', and change the
following few things :
1. change every occurence of "r" into "rb", and
"w" into "wb". That's safer if one uses text
mounted partitions.
2. change every occurence of "WIN32" into
"__CYGWIN__". That's the most critical step. If
you omit it, 'makedepend' won't simply work.

Q: I suppose all I have to do now is simply 'xmkmf
; make' ?
A: Not yet. There are a few bugs to correct in the
X11R6 distribution you might have. Do the
following :
1. edit in '/usr/X11R6.4/lib/X11/config' the files
named 'cygwin.cf' and 'cygwin32.cf'. Find the line
that starts by
    #define StdIncDir ...
DO change 386 in
'../../../../i386-cygwin32/include' into 586.
That's very important : if you don't do that, it
is like you didn't change anything. That's because
old cygwin distributions were released with a
subdirectory named 'i386-cygwin32'. Now, the
subdirectory is named 'i586-cygwin32'. Hence the
2. edit in the same folder, the file 'X11.rules',
find the line that starts with
    # define TopXInclude
DO change '$(XPROJECTROOT)' into '$(PROJECTROOT)'.

3. You're done. You may do now 'xmkmf ; make ;
make install'. The installed 'makedepend'
executable is tailored for you (and only for you :
don't redistribute it).


That's all I had to say. Sorry for being so
verbose. But any feedback, or comment, or anything
is most welcome.
Dr.-Ing. Sami Alex ZAIMI
Tohoku University - Sendai (Japan)

Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

More information about the Cygwin mailing list