www.digitalmars.com         C & C++   DMDScript  

c++ - makedep redirect to file

reply "Marc Kealy" <marc kealy.fslife.co.uk> writes:
Hi,

I can't get makedep to write to a file.  In the docs, the following
technique is suggested:

    makedep -s sourcefile.cpp > outfile.dep

but when I try this, the '>' is treated as a file to create dependancies
for.  As is 'outfile.dep'.

Without redirection, how (and where) would this utility be used in the
makefile?  I've tried numerous things but usually I get the error:

    missing { Colon Colon2 } in target block

--
Marc.
Oct 19 2002
parent reply "Walter" <walter digitalmars.com> writes:
There should be no space between the > and the outfile.dep. Try running it
from the command prompt.

"Marc Kealy" <marc kealy.fslife.co.uk> wrote in message
news:aorpk0$22rp$1 digitaldaemon.com...
 Hi,

 I can't get makedep to write to a file.  In the docs, the following
 technique is suggested:

     makedep -s sourcefile.cpp > outfile.dep

 but when I try this, the '>' is treated as a file to create dependancies
 for.  As is 'outfile.dep'.

 Without redirection, how (and where) would this utility be used in the
 makefile?  I've tried numerous things but usually I get the error:

     missing { Colon Colon2 } in target block

 --
 Marc.

Oct 19 2002
parent reply "Marc Kealy" <marc kealy.fslife.co.uk> writes:
Sorry, I replied personnally and not to the group by mistake.

No.  Makedep then thinks that '>outfile.dep' is a file to create
dependancies for.

--
Marc.

"Walter" <walter digitalmars.com> wrote in message
news:aos4vv$2dp6$1 digitaldaemon.com...
 There should be no space between the > and the outfile.dep. Try running it
 from the command prompt.

 "Marc Kealy" <marc kealy.fslife.co.uk> wrote in message
 news:aorpk0$22rp$1 digitaldaemon.com...
 Hi,

 I can't get makedep to write to a file.  In the docs, the following
 technique is suggested:

     makedep -s sourcefile.cpp > outfile.dep

 but when I try this, the '>' is treated as a file to create dependancies
 for.  As is 'outfile.dep'.

 Without redirection, how (and where) would this utility be used in the
 makefile?  I've tried numerous things but usually I get the error:

     missing { Colon Colon2 } in target block

 --
 Marc.


Oct 19 2002
parent reply bw <bw_member pathlink.com> writes:
In article <aos7cj$2fve$1 digitaldaemon.com>, Marc Kealy says...
Makedep then thinks that '>outfile.dep' is a file to create
dependancies for.

just thought i'd throw in 2 cents...strange problem, what operating system? try two arrows maybe,
Oct 19 2002
parent reply "Marc Kealy" <marc kealy.fslife.co.uk> writes:
"bw" <bw_member pathlink.com> wrote in message
news:aosen4$2mv3$1 digitaldaemon.com...
 In article <aos7cj$2fve$1 digitaldaemon.com>, Marc Kealy says...
Makedep then thinks that '>outfile.dep' is a file to create
dependancies for.

just thought i'd throw in 2 cents...strange problem, what operating

 two arrows maybe,

I should have mentioned it's WinME. I've tried all the variations I can think of for the cmdline, but no joy. Besides, redirection works ok with other programs. Does anyone else have the same problem? Or to put it another way, does EVERYONE else NOT have this problem? -- Marc.
Oct 19 2002
next sibling parent bw <bw_member pathlink.com> writes:
In article <aosghh$2ol5$1 digitaldaemon.com>, Marc Kealy says...
I should have mentioned it's WinME.

I've tried all the variations I can think of for the cmdline, but no joy.
Besides, redirection works ok with other programs.

ah... well i have heard that WinME has some strange behavior. wish i could help, i'm sure there is a solution. so if you try: dmc > output you create a file named output, but it doesn't work with makedep? if it's just that one app, i'd say it's likely a makedep bug. if it's the whole range of dmc apps i'd say the os is possibly at fault... weird!
Oct 19 2002
prev sibling parent reply bw <bw_member pathlink.com> writes:
In article <aosghh$2ol5$1 digitaldaemon.com>, Marc Kealy says...
I should have mentioned it's WinME.

if it turns out to be an os issue, here's a pretty large forum on winme you might find some help there... http://www.annoyances.org/exec/forum/winme L8r, bw
Oct 19 2002
parent reply "Marc Kealy" <marc kealy.fslife.co.uk> writes:
"bw" <bw_member pathlink.com> wrote in message
news:aosifo$2qpf$1 digitaldaemon.com...
 In article <aosghh$2ol5$1 digitaldaemon.com>, Marc Kealy says...
I should have mentioned it's WinME.

if it turns out to be an os issue, here's a pretty large forum on winme

 might find some help there...
 http://www.annoyances.org/exec/forum/winme

 L8r,
 bw

Just to bring you up to speed, I now have makedep working and it turns out that my problem is nothing to do with makedep, but the way I've been trying to use it in the makefile. After alot of water under the bridge, this is where I stand now:- target.exe : $(ALLOBJ:.obj=.dep) $(ALLOBJ) etc... dmc blah... .cpp.dep: makedep -s $*.cpp >$*.dep This is basically what I'm trying to do in order to automatically update the dependancies. The problem is that the exts are not substituted in the macros so the implicit rule to build the dep files is never used. The docs for smake say that this should work. Any Ideas? -- Marc.
Oct 20 2002
parent reply bw <bw_member pathlink.com> writes:
In article <aotsps$11g1$1 digitaldaemon.com>, Marc Kealy says...
where I stand now:-

    .cpp.dep:
        makedep -s $*.cpp >$*.dep

hmmm, well i'm not real good with smake, but you can make one file with all the dependencies like this: *.dep: makedep -s $*.cpp >all.dep if you want to make separate files for each .cpp maybe you can make a macro that is a wildcard? i don't think $* should expand, cuz it's not a macro? there's always a way, long as ya don't give up! L8r, bw
Oct 20 2002
parent reply "Marc Kealy" <marc kealy.fslife.co.uk> writes:
"bw" <bw_member pathlink.com> wrote in message
news:aoug7q$1jgv$1 digitaldaemon.com...
 In article <aotsps$11g1$1 digitaldaemon.com>, Marc Kealy says...
where I stand now:-

    .cpp.dep:
        makedep -s $*.cpp >$*.dep

hmmm, well i'm not real good with smake, but you can make one file with

 dependencies like this:

 *.dep:
 makedep -s $*.cpp >all.dep

With this method, every time one file needs updating, the dependancies of all files are updated. With very large projects, this could take some time.
 if you want to make separate files for each .cpp maybe you can make a

 is a wildcard?  i don't think $* should expand, cuz it's not a macro?

It actually expands to the current target's name and path, without the extension. (Look in the smake docs).
 there's always a way, long as ya don't give up!

At the moment I can see only 2 options 1. Use a different make (MinGW, Borland, etc...). 2. Create a $(ALLDEP) macro when creating the makefile. The first option is definately out. I want to solve the problem using only tools available in the DM downloads. The second option means I will have to re-write a section of my IDE in order to support this (pain in the neck, but possible). I really would like to know of any other options that have eluded me. -- Marc.
Oct 20 2002
parent bw <bw_member pathlink.com> writes:
In article <aouiho$1lna$1 digitaldaemon.com>, Marc Kealy says...
    .cpp.dep:
        makedep -s $*.cpp >$*.dep



 i don't think $* should expand, cuz it's not a macro?

It actually expands to the current target's name and path, without the extension. (Look in the smake docs).

didn't realize that, good to know! seems like as with c/c++ that make file programming can be frustrating sometimes... good luck. L8r, bw
Oct 20 2002