public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* best way to prevent a cygwin build?
@ 2011-12-02  7:46 Paul Allen Newell
  2011-12-02  9:47 ` Csaba Raduly
  2011-12-02 17:39 ` Warren Young
  0 siblings, 2 replies; 5+ messages in thread
From: Paul Allen Newell @ 2011-12-02  7:46 UTC (permalink / raw)
  To: cygwin; +Cc: pnewell

Dear Cygwin:

I have a network of Fedora machines and WinXP running Cygwin. Most of 
the projects I work on can be compiled/linked/run under both, but there 
are exceptions. As in Maya ...

I am not happy with having to run two separate source trees and would 
like a way (as in "best standard") to add something to any Maya makefile 
which will prevent execution if it is being compiled on Cygwin. The best 
I have been able to come up with is a check under each make directive, 
but that's alot of exceptions where I would think only one would be 
necessary.

I searched the GNU make docs and googled for such, but the best I could 
see were bailout rules under a given make rule directive. I can find out 
whether I need to bail by the test "ifeq (Cygwin, $(shell uname -o))" 
but can't figure out a way to have the makefile ask this question once 
for the entire set of make directives in it.

Any suggestions?

Thanks,
Paul

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: best way to prevent a cygwin build?
  2011-12-02  7:46 best way to prevent a cygwin build? Paul Allen Newell
@ 2011-12-02  9:47 ` Csaba Raduly
  2011-12-02 18:50   ` Dave Korn
  2011-12-02 17:39 ` Warren Young
  1 sibling, 1 reply; 5+ messages in thread
From: Csaba Raduly @ 2011-12-02  9:47 UTC (permalink / raw)
  To: cygwin; +Cc: pnewell

On Fri, Dec 2, 2011 at 8:46 AM, Paul Allen Newell  wrote:
> Dear Cygwin:
>
> I have a network of Fedora machines and WinXP running Cygwin. Most of the
> projects I work on can be compiled/linked/run under both, but there are
> exceptions. As in Maya ...
>
> I am not happy with having to run two separate source trees and would like a
> way (as in "best standard") to add something to any Maya makefile which will
> prevent execution if it is being compiled on Cygwin. The best I have been
> able to come up with is a check under each make directive, but that's alot
> of exceptions where I would think only one would be necessary.
>
> I searched the GNU make docs and googled for such, but the best I could see
> were bailout rules under a given make rule directive. I can find out whether
> I need to bail by the test "ifeq (Cygwin, $(shell uname -o))" but can't
> figure out a way to have the makefile ask this question once for the entire
> set of make directives in it.

ifeq (Cygwin, $(shell uname -o))
PLATFORM := CYGWIN
endif

.
.
.

ifeq ($(PLATFORM), CYGWIN)
# Cygwin-specific stuff
endif

-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: best way to prevent a cygwin build?
  2011-12-02  7:46 best way to prevent a cygwin build? Paul Allen Newell
  2011-12-02  9:47 ` Csaba Raduly
@ 2011-12-02 17:39 ` Warren Young
  1 sibling, 0 replies; 5+ messages in thread
From: Warren Young @ 2011-12-02 17:39 UTC (permalink / raw)
  To: Cygwin-L

On 12/2/2011 12:46 AM, Paul Allen Newell wrote:
>
> I am not happy with having to run two separate source trees and would
> like a way (as in "best standard") to add something to any Maya makefile
> which will prevent execution if it is being compiled on Cygwin.

You might get better answers if you give an example of what you mean by 
"prevent execution".  Not because we don't know what that means in 
general, but because it *is* too general.

For example, if what you were after is to have some programs in a system 
compiled conditionally, Automake + Autoconf makes that easy:

https://www.gnu.org/s/hello/manual/automake/Conditional-Programs.html

If you want something else suppressed, the answer might be different.

Generally speaking, any time you want to do some up-front tests for 
platform compatibility issues that affect how a program gets built, 
Autoconf is probably a good answer.  It is not a pretty tool, but it's 
one of those tools that keeps getting reinvented poorly, so it remains 
the most popular out of lack of better alternatives.

On one of my projects, I use another Automake competitor, Bakefile. 
Bakefile builds Autoconf Makefile.in files, generic GNU Makefiles, 
Visual C++ project files, Xcode project files, etc., all from a single 
high-level description of what you want built.  You can include things 
conditionally based on platform or pretty much any criterion you can 
code up in a Python extension to Bakefile.  Bakefile is not in the 
Cygwin package repo, however, partly because it doesn't build cleanly on 
Cygwin.  The native Windows port works just fine with Cygwin, though.

You might also look at cmake, which competes with the Autotools and 
Bakefile, and *is* in the Cygwin package repo.  I can't tell you 
anything more about it.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: best way to prevent a cygwin build?
  2011-12-02  9:47 ` Csaba Raduly
@ 2011-12-02 18:50   ` Dave Korn
  2011-12-03  0:34     ` [SOLVED:] " Paul Allen Newell
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Korn @ 2011-12-02 18:50 UTC (permalink / raw)
  To: cygwin

On 02/12/2011 09:47, Csaba Raduly wrote:
> On Fri, Dec 2, 2011 at 8:46 AM, Paul Allen Newell  wrote:

>> I am not happy with having to run two separate source trees and would like a
>> way (as in "best standard") to add something to any Maya makefile which will
>> prevent execution if it is being compiled on Cygwin. The best I have been
>> able to come up with is a check under each make directive, but that's alot
>> of exceptions where I would think only one would be necessary.
>>
>> I searched the GNU make docs and googled for such, but the best I could see
>> were bailout rules under a given make rule directive. I can find out whether
>> I need to bail by the test "ifeq (Cygwin, $(shell uname -o))" but can't
>> figure out a way to have the makefile ask this question once for the entire
>> set of make directives in it.
> 
> ifeq (Cygwin, $(shell uname -o))
> PLATFORM := CYGWIN
> endif

  Well, in this particular case:

ifeq (Cygwin, $(shell uname -o))
$(error This project does not build in Cygwin)
endif

  Can be placed anywhere in the makefile, no need to modify the build rules.

    cheers,
      DaveK

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [SOLVED:] Re: best way to prevent a cygwin build?
  2011-12-02 18:50   ` Dave Korn
@ 2011-12-03  0:34     ` Paul Allen Newell
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Allen Newell @ 2011-12-03  0:34 UTC (permalink / raw)
  To: cygwin; +Cc: pnewell

On 12/2/2011 10:49 AM, Dave Korn wrote:
>
>    Well, in this particular case:
>
> ifeq (Cygwin, $(shell uname -o))
> $(error This project does not build in Cygwin)
> endif
>
>    Can be placed anywhere in the makefile, no need to modify the build rules.
>
>      cheers,
>        DaveK
>
>
Csaba, Warren, and Dave:

Thanks for all of your replies.

The syntax/line:
+++
$(error This project does not build in Cygwin)
+++

is exactly what I was looking for as I didn't know how to force an exit. 
I just tried it out and it works like a champ.

I also looked it up in GNU make man pages and it is there ... I don't 
know how I missed it last night as I "thought" I checked for error. My 
oversight on missing it, it was probably too late in the evening.

Paul




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-12-03  0:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-02  7:46 best way to prevent a cygwin build? Paul Allen Newell
2011-12-02  9:47 ` Csaba Raduly
2011-12-02 18:50   ` Dave Korn
2011-12-03  0:34     ` [SOLVED:] " Paul Allen Newell
2011-12-02 17:39 ` Warren Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).