The uname
command (http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/uname.1.html) with no parameters should tell you the operating system name. I'd use that, then make conditionals based on the return value.
Example
UNAME := $(shell uname)ifeq ($(UNAME), Linux)# do something Linux-yendififeq ($(UNAME), Solaris)# do something Solaris-yendif