From 1177a53e86c62ce8ed9d74860ef4e9eefd97c287 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Sat, 9 Mar 2013 17:37:41 +0100 Subject: [PATCH] (DEV) bettercompilation for macOSx ==> Need to check on linux (rework link control...) --- Makefile.MacOs.mk | 1 + Makefile.mk | 12 +++++++----- core/defs.mk | 6 +++++- core/main.mk | 1 + core/setup-host.mk | 12 ++++++++++-- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Makefile.MacOs.mk b/Makefile.MacOs.mk index 4d199e4..dd54d25 100644 --- a/Makefile.MacOs.mk +++ b/Makefile.MacOs.mk @@ -11,6 +11,7 @@ include $(BUILD_SYSTEM)/core/check-project-variable.mk # for MAcOSX we need to FORCE CLANG CLANG:=1 +$(info =============>CLANG=$(CLANG)) # ewemple of a cross compiler : # http://biolpc22.york.ac.uk/pub/linux-mac-cross/ # http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt diff --git a/Makefile.mk b/Makefile.mk index 5edfacf..03e0156 100644 --- a/Makefile.mk +++ b/Makefile.mk @@ -1,6 +1,7 @@ # get the local dir in a good form : -BUILD_SYSTEM := $(shell readlink -m -n $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))) +#BUILD_SYSTEM := $(shell readlink -m -n $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))) +BUILD_SYSTEM := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) ############################################################################### ### Platform specificity : ### @@ -13,19 +14,20 @@ PLATFORM?=$(DEFAULT_PLATFORM) PROJECT_PATH=$(shell pwd) -PROJECT_MODULE=$(shell readlink -m -n $(PROJECT_PATH)/../) +PROJECT_MODULE=$(shell readlink -n $(PROJECT_PATH)/../) ifeq ($(PLATFORM), Linux) - PROJECT_NDK?=$(shell readlink -m -n $$(PROJECT_MODULE)/ewol/) + PROJECT_NDK?=$(shell readlink -n $$(PROJECT_MODULE)/ewol/) else ifeq ($(PLATFORM), MacOs) TARGET_OS=MacOs + PROJECT_NDK?=$$(PROJECT_MODULE)/ewol/ else ifeq ($(PLATFORM), IOs) else ifeq ($(PLATFORM), Windows) else ifeq ($(PLATFORM), Android) - PROJECT_NDK:=$(shell readlink -m -n $(PROJECT_PATH)/../android/ndk/) - PROJECT_SDK:=$(shell readlink -m -n $(PROJECT_PATH)/../android/sdk/) + PROJECT_NDK:=$(shell readlink -n $(PROJECT_PATH)/../android/ndk/) + PROJECT_SDK:=$(shell readlink -n $(PROJECT_PATH)/../android/sdk/) else $(error you must specify a corect platform : make PLATFORM=[$(SUPPORTED_PLATFORM)]) endif diff --git a/core/defs.mk b/core/defs.mk index 96d0e77..33002ef 100644 --- a/core/defs.mk +++ b/core/defs.mk @@ -38,7 +38,11 @@ false := # Get full path. # $1 : path to extend. -fullpath = $(shell readlink -m -n $1) +ifneq ("HOST_HAS_READLINK","true") +fullpath = $1 +else +fullpath = $(shell readlink -n $1) +endif # Figure out where we are # It returns the full path without trailing '/' diff --git a/core/main.mk b/core/main.mk index c522c22..295848e 100644 --- a/core/main.mk +++ b/core/main.mk @@ -193,4 +193,5 @@ $(info TARGET_OUT_STAGING: $(TARGET_OUT_STAGING)) $(info TARGET_OUT_FINAL: $(TARGET_OUT_FINAL)) $(info TARGET_CC_PATH: $(TARGET_CC_PATH)) $(info TARGET_CC_VERSION: $(TARGET_CC_VERSION)) +$(info CLANG: $(CLANG)) $(info ----------------------------------------------------------------------) diff --git a/core/setup-host.mk b/core/setup-host.mk index c1ead81..1f1d51d 100644 --- a/core/setup-host.mk +++ b/core/setup-host.mk @@ -45,9 +45,17 @@ ifneq ("$(shell echo $$OSTYPE | grep msys)","") HOST_OS := Windows HOST_EXE_SUFFIX := .exe HOST_SHARED_LIB_SUFFIX := .dll + HOST_HAS_READLINK := true else - HOST_OS := Linux + ifneq ("$(shell echo $$OSTYPE | grep darwin)","") + HOST_OS := MacOs + HOST_SHARED_LIB_SUFFIX := .dylib + HOST_HAS_READLINK := false + else + HOST_OS := Linux + HOST_SHARED_LIB_SUFFIX := .so + HOST_HAS_READLINK := true + endif HOST_EXE_SUFFIX := - HOST_SHARED_LIB_SUFFIX := .so endif