[comp.windows.x] Imakefiles

toddb@tekcrl.crl (Todd Brunhoff) (08/20/88)

>> I don't like to use Imakefiles...  So, I don't have a fully populated
>> X11 src tree sitting around.  Thus, Imakefiles are difficult to use
>> when building just one piece of X11 s/w....  However, when I build code
>> after the initial X11 installation, I want to link against the
>> installed library's and include the installed header files.  I don't
>> want to go looking in $(TOP)/.... for these.  How can we meet these two
>> needs together?

The usage of imake has become convoluted: the command line arguments that
are required make it too much trouble to use interactively at the keyboard.
I believe that the right solution is:
    1. make the current use of options for the imake command (the ones
	used in the makefiles) the defaults for imake.
    2. implement a method of generating "absolute" imake include files
	from the stuff that lives in util/imake.includes such that
	all the include and library file names are absolute
With these changes, you install these generated imake include files in
imake's system-wide directory (right now its /usr/lib/local/imake.includes),
and then imake could be used by itself in any directory
to generate a makefile.  Instead of saying 'make Makefile', you
could simply type

	imake

And your Makefile would appear.  This would help in general, because
sometimes I pick up software up off the net that has an Imakefile, but
the only way to generate a makefile is to install the software
somewhere in the x11 source tree; something I'm not always willing to
do.

---------------
Usenet:       {ucbvax,decvax,allegra,uw-beaver,hplabs}!tektronix!crl!toddb
{CS,ARPA}net: toddb%tekcrl.crl.tek.com@relay.cs.net                  c--Q Q
US:           Todd Brunhoff; Visual Systems Lab; Tektronix, Inc.         `
              Box 500  MS 50-662, Beaverton OR 97077                     -
Phone:        (503) 627-1121

jim@EXPO.LCS.MIT.EDU (Jim Fulton) (08/20/88)

Here is a little script that I find useful for building a Iakefile from an
Imakefile when the source isn't in my X tree.  I call it "ximake":

	% cat ximake
	exec /x11/util/imake/imake -DTOPDIR=/x11 -TImake.tmpl \
	-I/x11/util/imake.includes $*

where /x11 is the name of the top of your build tree.  I then just say

	% ximake Makefile

and I have a Makefile.


Jim

p.s. I agree completely with Todd that that imake is currently too hard to use.
I'm hoping to make things easier in th years to come.

solomon@gjetost.cs.wisc.edu (Marvin Solomon) (08/24/88)

There is a bug in util/imake.includes/Imake.rules that prevents imake
from working correctly if invoked from a directory that is not a descendent
of the root of the X source tree.  The 'subdirMakefiles:' rule recursively
invokes imake in a subdirectory, with TOPDIR set to '$(TOP)/..'.  But if the
path to the top from here is (e.g.) ../Xsrc, the path to the top from a
subdir is '../../Xsrc', not '../Xsrc/..'.  The current rules only work if
you are a descendent of TOP, so that $(TOP) is entirely composed of '../..'.

Context diffs follow.

*** /tmp/,RCSt1001753	Tue Aug 23 17:02:14 1988
--- Imake.rules	Tue Aug 23 17:01:46 1988
***************
*** 461,467
  subdirMakefiles:							@@\
  	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak				@@\
  	-$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak	@@\
! 	cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(TOP)/..; \	@@\
  	$(MAKE) $(MFLAGS) Makefiles 					@@\
  									@@\
  subsubdirMakefiles:							@@\

--- 461,467 -----
  subdirMakefiles:							@@\
  	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak				@@\
  	-$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak	@@\
! 	cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=../$(TOP); \	@@\
  	$(MAKE) $(MFLAGS) Makefiles 					@@\
  									@@\
  subsubdirMakefiles:							@@\
***************
*** 467,473
  subsubdirMakefiles:							@@\
  	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak				@@\
  	-$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak	@@\
! 	cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(TOP)/../..; \	@@\
  	$(MAKE) $(MFLAGS) Makefiles 					@@\
  									@@\
  subsubsubdirMakefiles:							@@\

--- 467,473 -----
  subsubdirMakefiles:							@@\
  	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak				@@\
  	-$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak	@@\
! 	cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=../../$(TOP); \	@@\
  	$(MAKE) $(MFLAGS) Makefiles 					@@\
  									@@\
  subsubsubdirMakefiles:							@@\
***************
*** 473,479
  subsubsubdirMakefiles:							@@\
  	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak				@@\
  	-$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak @@\
! 	cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(TOP)/../../..; \	@@\
  	$(MAKE) $(MFLAGS) Makefiles 					@@\
  									@@\
  subsubsubsubdirMakefiles:						@@\

--- 473,479 -----
  subsubsubdirMakefiles:							@@\
  	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak				@@\
  	-$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak @@\
! 	cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=../../../$(TOP); \	@@\
  	$(MAKE) $(MFLAGS) Makefiles 					@@\
  									@@\
  subsubsubsubdirMakefiles:						@@\
***************
*** 479,483
  subsubsubsubdirMakefiles:						@@\
  	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak				@@\
  	-$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak @@\
! 	cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=$(TOP)/../../../..; \	@@\
  	$(MAKE) $(MFLAGS) Makefiles

--- 479,483 -----
  subsubsubsubdirMakefiles:						@@\
  	$(RM) $(MAKEFILE_SUBDIR)/Makefile.bak				@@\
  	-$(MV) $(MAKEFILE_SUBDIR)/Makefile $(MAKEFILE_SUBDIR)/Makefile.bak @@\
! 	cd $(MAKEFILE_SUBDIR); $(IMAKE_CMD) -DTOPDIR=../../../../$(TOP); \	@@\
  	$(MAKE) $(MFLAGS) Makefiles
	Marvin Solomon
	Computer Sciences Department
	University of Wisconsin, Madison WI
	solomon@cs.wisc.edu
	...seismo!uwvax!solomon