[GRASS5] conditional compilation for linux, mac, windows

moovida_lists moovida at katamail.com
Tue Feb 17 05:01:46 EST 2004


Can anybody tell me what is wrong in this syntax for the definition of the 
compiler for the different systems?
Has anybody the right method?

Thanks, trying to get libgis compiled for windows and wanted to have the only 
one makefile.

On linux the result for the case below is that the compiler is: baubau


ifeq ($(findstring Windows_, $(OS)), Windows_)
    OS_DEFINED = GNUmakefile
    ARCH = i386
    OSNAME = WIN32
    COMPILER = VC
else

#
# Linux
#
ifeq ($(OS), Linux)
    OS_DEFINED = GNUmakefile
    ARCH = i386
    OSNAME = Linux
    COMPILER= gcc
else

#
# Solaris
#
ifeq ($(OS), Solaris)
    OS_DEFINED = GNUmakefile
    ARCH = sparc
    OSNAME = SUN
    COMPILER = CC
else
#
# Mac OS X
#
ifeq ($(OSTYPE), darwin)
    OS_DEFINED = GNUmakefile
    OS = darwin
    ARCH = mac
    OSNAME = MACOSX
    COMPILER = cc
else

#
# Undefined
#
    OS_DEFINED = OS_Not_Defined
	COMPILER = baubau
endif
endif
endif
endif

-- 
____________________________________________________________________________

University of Trento
Department of Civil and Environmental Engineering
Via Mesiano, 77 - Trento (ITALY)

Andrea Antonello
tel:  +393288497722
fax:  +390461882672
____________________________________________________________________________






More information about the grass-dev mailing list