Compile time executable calling?

Tofu Ninja emmons0 at purdue.edu
Wed Jan 8 15:55:38 PST 2014


On Wednesday, 8 January 2014 at 23:17:48 UTC, H. S. Teoh wrote:
> On Wed, Jan 08, 2014 at 10:29:03PM +0000, Tofu Ninja wrote:
>> On Wednesday, 8 January 2014 at 22:01:56 UTC, Brian Schott 
>> wrote:
>> >Just make your makefile run the script, pipe its output to a 
>> >file,
>> >and do a string import of the generated file.
>> 
>> The kind of stuff I want to use it for would make that tactic
>> tedious and error prone. I would use it like how ctfe is used 
>> now.
>> 
>> Having multiple points in the source(maybe hundreds) that 
>> would call
>> out to a external program at compile time but pass out 
>> different
>> args. Relying on a makefile to do something like this would 
>> require
>> me to keep the makefile and the source code constantly in sync 
>> and
>> would become a problem before long.
>
> Huh? Your last sentence made no sense to me. Doesn't the 
> makefile have
> to be kept in sync anyway? In my experience, when makefile and 
> source go
> out of sync, that's when you start getting untraceable 
> heisenbugs that
> defy all analysis, and disappear after you do a `make clean; 
> make`. The
> most usual cause of this is the makefile picking up stray, 
> stale object
> files that should no longer exist 'cos they don't reflect the 
> source
> anymore.
>
> <offtopic rant>
> This is one of the many things I really hate about makefiles.  
> I'd
> recommend *anything* over makefiles. Like SCons. Or tup. Even 
> Ant, that
> insists on the human-unreadable and human-unwriteable XML as an 
> input
> format.  A *shell script* could do better than make, by 
> actually making
> sure that everything is recompiled and up-to-date, without 
> magic global
> variables that alter behaviour in strange ways 
> (*cough*VPATH*cough*), or
> unreliable timestamp-dependence that breaks when you cross NFS
> boundaries, or sometimes just breaks for no discernible reason
> whatsoever. The fact that `make clean` exists at all, is a 
> testament to
> just how broken the whole thing is (and the saddest thing is 
> that `make
> clean` has come to be accepted as a part of life, when it 
> shouldn't even
> exist in the first place, had build systems been designed 
> correctly to
> begin with).
> </offtopic rant>
>
>
> T

I didn't just mean keeping it in sync with the source files, but 
in sync with every instance of the external exe call that might 
happen, and since I would want to use it like how ctfe is used 
that basically means any time I happen to want to "call" this 
outside program(which might be a lot of times per source file) I 
have to update the makefile. And beyond that the args being 
passed per call might be different each time... alot to keep 
track of.. beyond the normal stuff that has to be kept track of 
in a makefile....

But yea make sucks... I dont use it but it seems to be a theme in 
this thread so I just used that as an example...


More information about the Digitalmars-d mailing list