[Ipe-discuss] Compilation on Mac OS X 10.6

Sherif Ghali sherif.ghali at yahoo.com
Sat Oct 31 03:50:19 CET 2009


> How can I recognize Mac OS from the Makefile?
 


In a subset of make implementations, OSTYPE can be used to detect the OS.
To run on all implementations, call 'uname' instead.

#================================================================
MYOSTYPE := $(shell uname)

run:
<tab>@echo "We are on" $(MYOSTYPE)
#================================================================

To set CXXFLAGS, LDFLAGS, etc.. to different values, test against
MYOSTYPE.

#================================================================
MYOSTYPE := $(shell uname)

ifeq ($(MYOSTYPE),Linux)
    WHERE_WE_ARE = "We are on Linux"
else
    ifeq ($(MYOSTYPE),CYGWIN_NT-5.1)
        WHERE_WE_ARE = "We are on Cygwin"
    else
        ifeq ($(MYOSTYPE),Darwin)
            WHERE_WE_ARE = "We are on Darwin"
        endif
    endif
endif

run:
<tab>@echo $(WHERE_WE_ARE)
#================================================================

Sherif



      



More information about the Ipe-discuss mailing list