Re: [gtk-list] Makefiles



On Wed, 02 Feb 2000 17:45:29 +0000 (GMT), Phil Huish <se96ph> wrote:
> I've got my main file in my main source directory,
> this directory has a directory for the GTK frontend files and a directory
> for the files that deal with the inside of the game...
> 
> how do i write a makefile that understands this...

The difficult answer: In the main Make, use this for target "all:"

  all:
          $MAKE -C subdir1 all
          $MAKE -C subdir2 all

This assumes that you use GNU make. If you don't, use:

  all:
          (cd subdir1 ; make all)
          (cd subdir2 ; make all)


The easy answer: use automake + autoconf to handle your Makefiles. With
automake, it's just a matter of using the SUBDIRS variable in the main
Makefile:

  SUBDIRS = subdir1 subdir2

and all your subdirectories will be visited by make.


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2785859  Fax: +31-15-2781843  Email J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]