OT: Portable build systems for portable programs was: Re: OT: LCC bug fix poilicy



In article <87myokrucw.fsf@xxxxxxxxxxxxxxx>,
Keith Thompson <kst-u@xxxxxxx> wrote:

Unconditionally adding the ".exe" suffix in runtests would fix that
problem, but it would be an ugly solution, since Unix doesn't require
a ".exe" suffix on executables (and adding one is, in my opinion and
apparently in Chuck's, poor style). I understand that in the djgpp
environment, the ".exe" suffix is required but needn't be specified
when executing a command; Cygwin works the same way, as does plain
Windows.

A better solution would use the ".exe" suffix where it's required, and
not use it where it isn't.

<OT>Probably the best way to do that would be to define a variable in
the makefile whose value is either ".exe" or "" depending on the
system. The method for doing this, particularly for determining which
system you're on, is left as an exercise. A simpler brute-force
solution would be to provide two (or more) makefiles.

An intermediate between those is to localize the bits that need to
change between systems into a bunch of definitions in one place, and
have everything else use those definitions.
<pseudo-topicality type="stretched">This is much the same way
mostly-portable C programs that depend on interfacing to non-portable
system features can be written.</>

My makefiles collect rules for converting base names into executable
names, object file names, library file names, and command-line
arguments for referring to all of those (along with a few other things
that globally influence the build, like compiler flags), into
build-config.mk.<system>; then building on a different system just
requires copying or symlinking build-config.mk.<system> to
build-config.mk, and (if I've gotten things abstracted correctly, which
can take a while to get sorted out) the makefile that includes that
Just Works.

</OT>


dave

--
Dave Vandervies dj3vande at eskimo dot com
Either that, or %s is the nearest he can come using ascii to his
native-language term for "hedgehog" ...
--Chris Dollin in comp.lang.c
.



Relevant Pages

  • Re: So I click on this link...
    ... An .exe file is a Windows file. ... It won't run on the Mac OS. ... It is traditionally the extension used by executables ... Giving it the suffix .exe will not prevent it running ...
    (uk.comp.sys.mac)
  • Re: Storing data in the application/exe file
    ... Now when you make exe you dont have to worry from ... secondary form you again let Delphi have its way, ... The global variable that Delphi puts in each form unit is essentially ... but between two different executables is much more involved. ...
    (alt.comp.lang.borland-delphi)
  • Re: Blocking EXE
    ... "Scripts and Executables" was enabled on the particular ... > If a .EXE file is published from a Website, a URL to the .EXE file will ...
    (microsoft.public.inetserver.iis.security)
  • Re: OT: LCC bug fix poilicy
    ... DJGPP .exe files are needed. ... Why not just add the suffix in runtests? ...
    (comp.lang.c)
  • Re: acnormal problem
    ... the conversion and .EXE to actually work? ... >Access databases cannot be compiled into executables. ... >installed will be able to install the runtime version of ... if I get to the point where I can compile my ...
    (microsoft.public.access.formscoding)