>From 272a7a8169d01c39fef999dd19e8509967a2938e Mon Sep 17 00:00:00 2001 From: Michele La Monaca Date: Thu, 31 Jan 2013 20:43:35 +0100 Subject: [PATCH] tentative platform auto-detection mechanism Signed-off-by: Peter Bex --- GNUmakefile | 28 +++++++++++++++++++++++++++- NEWS | 2 ++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 270b72f..52b2e3f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -33,8 +33,34 @@ ifneq ($(CONFIG),) include $(CONFIG) endif +ifneq ($(OS),Windows_NT) + SYSTEM := $(shell uname -s) +else ifdef MSYSTEM + SYSTEM = windows + PLATFORM ?= mingw-msys +else ifdef PWD + SYSTEM = windows + PLATFORM ?= cygwin +else + SYSTEM = windows + PLATFORM ?= mingw +endif + +ifeq ($(SYSTEM),Linux) + PLATFORM ?= linux +else ifeq ($(SYSTEM),Darwin) + PLATFORM ?= macosx +else ifeq ($(filter $(SYSTEM),FreeBSD NetBSD OpenBSD DragonFly),$(SYSTEM)) + PLATFORM ?= bsd +else ifeq ($(SYSTEM),SunOS) + PLATFORM ?= solaris +else ifeq ($(SYSTEM),Haiku) + PLATFORM ?= haiku +endif + ifndef PLATFORM -$(info Please select your target platform by running one of the following commands:) +$(info Unable to auto-detected the platform. Please select your target) +$(info platform by running one of the following commands:) $(info ) $(foreach mf, $(wildcard Makefile.*), $(info $(MAKE) PLATFORM=$(mf:Makefile.%=%))) $(info ) diff --git a/NEWS b/NEWS index ad77c58..ca2d578 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ - csc: added "-oi"/"-ot" options as alternatives to "-emit-inline-file" and "-emit-type-file", respectively; "-n" has been deprecated. +- Build system + - Added PLATFORM detection for common platforms. Thanks to Michele La Monaca. 4.8.1 -- 1.8.0.1