Mail Archives: djgpp/1998/04/09/12:04:33
On Thu, 9 Apr 1998, Edward F. Sowell wrote:
> Some modifications were needed to
> make it work on Linux with gcc and GNU make. However, the approach is
> on the rocks with the DJGPP on DOS/Windows.
Usually, the same Makefile which works on Linux should also work with the
DJGPP tools, unless you must use stock DOS commands.
> But I still have hope. I should also say that due to the richness of
> GUN make, our build CAN be done without our C++ programs, if we abandon
> our preference files; we have done that on Unix.
That is one way that probably will work.
> Perhaps we should abandon our approach and simply ask our users to
> download the fileutils, GNU make, etc, and even replace his/her
> command.com with bash.
You probably only need Fileutils (you already have GNU Make, since that's
the only Make which DJGPP supplies). Bash is not needed, unless your
Makefile runs sophisticated commands that only Unix-style shell
understand. (I'd guess that it doesn't do that, since the origin of the
Makefile is MS-DOS/MS-Windows.)
> > Make cannot convert the slashes because it doesn't have the slightest
> > idea which commands understand or don't understand forward slashes.
>
> Somehow, Borland, MS, and Symantec make programs deal with \. Surely
> this is not impossible with GNU make.
The other Make's support *only* backslashes, and they lack features like
built-in file name globbing (the $(widcard) function and others) which
need backslash as escape character.
> Suppose the path string has \\ in it to make GNU make happy. Now suppose
> that I use this same string as the argument in the istream.open()
> function. It will fail, since open() knows nothing about the \\ business.
It seems that your program itself reads Makefile and uses its part to do
something useful. Is this correct?
If so, then you have two possibilities:
1) Have your program convert every "\\" pair into a single "\" when
it reads the Makefile.
2) If that program is itself compiled with DJGPP, you can convert
each "\" into "/". DJGPP programs can transparently handle multiple
slashes (but only if they are forward slashes, since there are UNC names
like "\\SERVER\VOLUME\FOO" where two backslashes cannot be collapsed
without changing the semantics of the name).
> But I somehow hoped that DOS/Wimdows users could be better accomodated
> without compromising the (much greater) needs of Unix "porters."
I don't think you should give up. I believe some of the advice you got
should solve some of the problems, even without installing Unix-like
tools. I would suggest to try using the $(subst) function. This way, you
use forward slashes everywhere and convert them to backslashes only in
commands that are passed to external programs like MOVE which don't
understand forward slashes. (GCC and other DJGPP tools that your
Makefile's run, including programs you compile with DJGPP, don't need such
conversion.)
If some of the problems aren't solved using $(subst), I suggest to
describe those specific problems here. I'm sure you will find out
there's more than one way to solve each one of them, given the power of
GNU Make.
> See my earlier remarks. Perhaps I am wrong, but I don't believe that
> that porting software to another platform means converting that platform
> to Unix.
I just suggested it as an easier solution, which will surely work. If you
have grave reasons not to do that, it is quite possible that you won't
need to, eventually.
- Raw text -