Jan 7, 2008

Os type detection with uname

[vuhung@test_make]$make vh
SunOs
[vuhung@test_make]$cat Makefile 
uname=$(shell uname)

ifeq ($(uname), Linux)
APP_OSTYPE = Linux
endif

ifeq ($(uname), SunOS)
APP_OSTYPE = SunOs
endif

vh:
        @echo $(APP_OSTYPE)

No comments: