(DEV) bettercompilation for macOSx ==> Need to check on linux (rework link control...)

This commit is contained in:
Edouard DUPIN 2013-03-09 17:37:41 +01:00
parent 57ef468e1c
commit 1177a53e86
5 changed files with 24 additions and 8 deletions

View File

@ -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

View File

@ -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

View File

@ -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 '/'

View File

@ -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 ----------------------------------------------------------------------)

View File

@ -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