Mail Archives: djgpp-workers/2001/09/20/15:46:49
> From: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
> Date: Thu, 20 Sep 2001 18:30:33 +0200
>
> > The original problem was with a Makefile that invoked command.com
> > like shown above. That Makefile does that because the command
> > it wants to run is non-portable to other shells.
>
> So this is a makefile with
>
> SHELL = /bin/sh
>
> but with a certain rule like
>
> foo: bar
> command.com /c some_DOS_only_command
>
> ?
Yes. The SHELL = line is needed only for running the test suite,
IIRC.
> > When I said that we will need to find a way to run cmd on those
> > systems, I meant the following: we need a method to detect such
> > a system from the Makefile, and then run "cmd.exe /c ..." instead
> > of "command.com /c ...".
>
> Since we can fairly easily detect NT/2K/XP (right?)
No, we can't; not from a Makefile. If you know how to do that, please
tell.
> couldn't make
> substitute '\1cmd.exe /c' for '^\([-@]*\)command\(.com\)? /c'
> unconditionally in commands?
If you mean that Make should do that on its own, running cmd.exe where
the Makefile says command.com, then I think this would be wrong: Make
has no business second-guessing the user's intent.
> That only leaves more complicated
> rules (eg some sh-based if-then-else that invokes command.com at
> some point) without handling
This particular Makefile cannot rely on Bash, since it's from the Make
distriobution, and Make is one of the few basic tools which one should
be able to build with onlty minimal environment.
- Raw text -