CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    'Make' confusion

    Can anyone explain precisely (and hopefully, concisely!) the differences between:-

    Makefile
    Makefile.in
    Makefile.am

    My understanding is that Makefile tends to be platform & compiler specific whereas Makefile.am tries to be non compiler and platform specific (but requires different make tools). But where does Makefile.in fit into the equation?

    Also, is it possible (or useful) to generate any of these files from any of the others?
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  2. #2
    Join Date
    Jul 2002
    Posts
    2,543

    Re: 'Make' confusion

    Makefile.in is file which is used as input for Autoconf program. Autoconf produces configure script, and this script produces Makefile. Having Makefile.in file, you can think about Makefile as auto-generated file.
    All this (and much more) is described in this excellent book:
    http://www.freesoftwaremagazine.com/...tomake_libtool

    My guess is that Makefile.am is source file for Automake program, like .in for Autoconf. But I did not reach this place in the book yet

    Part 1 of the book contains number of figures describing relationship between auto tools, input and output files, like this one: http://www.freesoftwaremagazine.com/...l_dataflow.png
    Enjoy reading...

  3. #3
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Re: 'Make' confusion

    Thanks for the links Alex. That book does look very interesting. Am I right in thinking that autoconf is only available for gnu related platforms? In other words, if I had a Makefile.am, is there anything I could use to turn it into a Makefile that could work with Microsoft's nmake?
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  4. #4
    Join Date
    Jul 2002
    Posts
    2,543

    Re: 'Make' confusion

    AFAIK, auto tools are used to produce makefiles that may build a program on any Unix and Linux platform. Unix/Linux problem is binary and libraries compatibility: binaries built on some Linux distribution, may not run on another Linux distribution or Unix. So, the program must be built on destination computer.
    In Windows, there is no such problem: any program runs on any Windows version, unless it uses some version-specific API.
    About using Linux/Unix makefiles in Windows: both .am am .in files cannot be executed by Microsoft's nmake, because they contain auto tools specific definitions. Resulting Makefile may run on Windows, if it doesn't contain Linux/Unix specific stuff.
    I am just learning this issue, so my answer may not be correct for 100%. In my Windows/Linux portable project, I use different makefiles for Windows and Linux. Windows makefile is pretty static and doesn't cause any problems. In Linux, I am fighting with auto tools...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured