Check in a nmake makefile for depend file - Programmer

This is a discussion on Check in a nmake makefile for depend file - Programmer ; I want to check in a nmake makefile if a file is present. In a unix like makefile I would write (correct me if I am wrong): ifeq (depend,$(wildcard depend)) include depend endif This should check for the presence of ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: Check in a nmake makefile for depend file

  1. Check in a nmake makefile for depend file

    I want to check in a nmake makefile if a file is present.
    In a unix like makefile I would write (correct me if I am
    wrong):

    ifeq (depend,$(wildcard depend))
    include depend
    endif

    This should check for the presence of the file "depend"
    and include it when it is present. This allows to do

    make depend
    make

    The first call would not include the file "depend" (since
    it does not exist at that time, but it would create the
    "depend" file. The second call of make includes the file
    "depend" and therefore has also rules for the header
    file dependencys. I want to do all that under windows
    with the nmake utility. How would the "if" and the
    "include" look like?

    Thank you in advance for your help

    Georg Peter


  2. Re: Check in a nmake makefile for depend file

    On May 25, 7:30 pm, GeorgPe...@gmx.at wrote:
    > I want to check in a nmake makefile if a file is present.
    > In a unix like makefile I would write (correct me if I am
    > wrong):
    >
    > ifeq (depend,$(wildcard depend))
    > include depend
    > endif
    >
    > This should check for the presence of the file "depend"
    > and include it when it is present.


    GNU make has a feature which obviates the test. 'include depend'
    causes 'depend' to be treated like any other prerequisite, so if
    missing, rather than aborting the build, make will try to build that
    file first. This can be used to set up 'automatic' header dependencies
    in a single 'make' invocation. See the fine manual.
    http://www.gnu.org/software/make/man...Makefiles.html

    > This allows to do
    >
    > make depend
    > make
    >
    > The first call would not include the file "depend" (since
    > it does not exist at that time, but it would create the
    > "depend" file. The second call of make includes the file
    > "depend" and therefore has also rules for the header
    > file dependencys. I want to do all that under windows
    > with the nmake utility.


    Good luck with that.

    > How would the "if" and the
    > "include" look like?
    >
    > Thank you in advance for your help
    >
    > Georg Peter




  3. Re: Check in a nmake makefile for depend file

    On 26 Mai, 16:35, toby wrote:
    > On May 25, 7:30 pm, GeorgPe...@gmx.at wrote:
    >
    > > I want to check in a nmake makefile if a file is present.

    > GNU make has a feature which obviates the test. 'include depend'
    > ... (snip)


    Thank you, but this is not the advice I need.
    I need an advice for nmake which IMHO is from M$.
    Nmake uses a somewhat different syntax than other makes.

    How do I check for the presence of a file in an nmake makefile?

    And how do I include a file in an nmake makefile?

    How do I combine the above two (include a file when it is present)?


    Thank you in advance for your help

    Georg Peter


  4. Re: Check in a nmake makefile for depend file

    GeorgPeter@gmx.at wrote:
    > On 26 Mai, 16:35, toby wrote:
    >> On May 25, 7:30 pm, GeorgPe...@gmx.at wrote:
    >>
    >>> I want to check in a nmake makefile if a file is present.

    >>
    >> GNU make has a feature which obviates the test. 'include depend'
    >> ... (snip)

    >
    > Thank you, but this is not the advice I need.
    > I need an advice for nmake which IMHO is from M$.
    > Nmake uses a somewhat different syntax than other makes.
    >
    > How do I check for the presence of a file in an nmake makefile?
    >
    > And how do I include a file in an nmake makefile?
    >
    > How do I combine the above two (include a file when it is present)?


    Mount djgpp (see delorie.com) and use make.

    --




    cbfalconer at maineline dot net



    --
    Posted via a free Usenet account from http://www.teranews.com


  5. Re: Check in a nmake makefile for depend file

    On Jun 1, 4:49 am, CBFalconer wrote:
    > GeorgPe...@gmx.at wrote:
    > > On 26 Mai, 16:35, toby wrote:
    > >> On May 25, 7:30 pm, GeorgPe...@gmx.at wrote:

    >
    > >>> I want to check in a nmake makefile if a file is present.

    >
    > >> GNU make has a feature which obviates the test. 'include depend'
    > >> ... (snip)

    >
    > > Thank you, but this is not the advice I need.
    > > I need an advice for nmake which IMHO is from M$.
    > > Nmake uses a somewhat different syntax than other makes.


    And almost certainly less complete/less useful, since it's developed
    in wilful isolation. Furthermore it's built on a command line
    interpreter that's, to put it politely, almost completely unevolved.

    >
    > > How do I check for the presence of a file in an nmake makefile?

    >
    > > And how do I include a file in an nmake makefile?

    >
    > > How do I combine the above two (include a file when it is present)?


    Sorry George, no habla NMAKE. Life, as they say, is too short. Does
    the fine manual help? http://msdn2.microsoft.com/en-us/lib...ha(VS.71).aspx

    >
    > Mount djgpp (see delorie.com) and use make.


    Yeah, or Cygwin :-)

    >
    > --
    >
    >
    >
    >
    > cbfalconer at maineline dot net
    >
    > --
    > Posted via a free Usenet account fromhttp://www.teranews.com




  6. Re: Check in a nmake makefile for depend file

    In comp.programming GeorgPeter@gmx.at wrote:
    > Nmake uses a somewhat different syntax than other makes.


    > How do I check for the presence of a file in an nmake makefile?


    google gives better results than asking in a newsgroup, e.g.,

    http://www.15seconds.com/issue/021203.htm

    > And how do I include a file in an nmake makefile?


    see above (and note that the filename could also be a variable which
    is substituted at runtime).

    > How do I combine the above two (include a file when it is present)?


    For vile (vi-like-emacs), I build part of the nmake makefiles at runtime
    using a batch script, and then use recursion to include the new pieces
    (ymmv).

    http://invisible-island.net/vile/

    --
    Thomas E. Dickey
    http://invisible-island.net
    ftp://invisible-island.net

  7. Re: Check in a nmake makefile for depend file

    In comp.programming toby wrote:
    > And almost certainly less complete/less useful, since it's developed
    > in wilful isolation. Furthermore it's built on a command line
    > interpreter that's, to put it politely, almost completely unevolved.


    yawn. One of these days, you'll make an informed comment, and no one will
    notice. This isn't your day.

    --
    Thomas E. Dickey
    http://invisible-island.net
    ftp://invisible-island.net

  8. Re: Check in a nmake makefile for depend file

    On Jun 2, 8:22 am, Thomas Dickey wrote:
    > In comp.programming toby wrote:
    >
    > > And almost certainly less complete/less useful, since it's developed
    > > in wilful isolation. Furthermore it's built on a command line
    > > interpreter that's, to put it politely, almost completely unevolved.

    >
    > yawn. One of these days, you'll make an informed comment, and no one will
    > notice. This isn't your day.


    I was comparing to, for instance, 'bash', which is the syntax
    available to GNU make for build commands.

    You're not seriously suggesting they're comparable?

    >
    > --
    > Thomas E. Dickeyhttp://invisible-island.netftp://invisible-island.net




  9. Re: Check in a nmake makefile for depend file

    toby wrote:
    >

    .... snip ...
    >
    > I was comparing to, for instance, 'bash', which is the syntax
    > available to GNU make for build commands.
    >
    > You're not seriously suggesting they're comparable?


    That's why I suggested DJGPP. Its make has added code to
    compensate for the missing bash.

    --




    cbfalconer at maineline dot net



    --
    Posted via a free Usenet account from http://www.teranews.com


  10. Re: Check in a nmake makefile for depend file

    In comp.programming toby wrote:
    > I was comparing to, for instance, 'bash', which is the syntax
    > available to GNU make for build commands.


    > You're not seriously suggesting they're comparable?


    heh - any interesting(*) make-program can set/read/modify environment
    variables and interact with script interpreters of various types.

    nmake is no exception.

    sounds as if you're citing this from second-hand experience
    (go get some first-hand)

    (*) I know of some not-very-interesting counter examples, of course.

    --
    Thomas E. Dickey
    http://invisible-island.net
    ftp://invisible-island.net

+ Reply to Thread