try to simplify and normalize

This commit is contained in:
Edouard Dupin 2012-08-10 12:17:29 +02:00
parent 3a40dc9fee
commit 3db84addf0
6 changed files with 65 additions and 63 deletions

View File

@ -45,7 +45,7 @@ java : all
# note : this change the lib name ...
cp ./out_$(TARGET_OS)/$(BUILD_DIRECTORY_MODE)/obj/usr/lib/$(PROJECT_PACKAGE).so libs/armeabi/lib$(PROJECT_PACKAGE).so
@echo " (ant) build java code"
PATH=$(PROJECT_SDK)/tools/:$(PROJECT_SDK)/platform-tools/:$(PATH) ant -Dsdk.dir=$(PROJECT_SDK) debug
PATH=$(PROJECT_SDK)/tools/:$(PROJECT_SDK)/platform-tools/:$(PATH) ant -Dsdk.dir=$(PROJECT_SDK) $(BUILD_DIRECTORY_MODE) V=1
@echo " (sh) Clear previous sources "
@rm -rf src jni/ewolAndroidAbstraction.cpp
@ -56,14 +56,8 @@ install: java
@echo "------------------------------------------------------------------------"
@# $(PROJECT_SDK)/platform-tools/adb kill-server
@# install application
sudo $(PROJECT_SDK)/platform-tools/adb install -r ./bin/$(PROJECT_NAME)-debug.apk
sudo $(PROJECT_SDK)/platform-tools/adb install -r ./bin/$(PROJECT_NAME)-$(BUILD_DIRECTORY_MODE).apk
#clean:
# @echo "------------------------------------------------------------------------"
# @echo ' CLEANING : bin libs gen obj'
# @echo "------------------------------------------------------------------------"
# cd $(PROJECT_NDK) ; NDK_PROJECT_PATH=$(PROJECT_PATH) NDK_MODULE_PATH=$(PROJECT_MODULE) ./ndk-build clean
#
#localclean:
# @echo "------------------------------------------------------------------------"
# @echo ' Remove : bin libs gen obj'

View File

@ -2,7 +2,7 @@
###############################################################################
### Platform specificity : ###
###############################################################################
SUPPORTED_PLATFORM=Linux CygWin MacOS IOS Android
SUPPORTED_PLATFORM=Linux Windows MacOs IOs Android
DEFAULT_PLATFORM=Linux
# default platform can be overridden
@ -14,22 +14,19 @@ PROJECT_MODULE=$(PROJECT_PATH)/../
ifeq ($(PLATFORM), Linux)
PROJECT_NDK?=$(realpath $(PROJECT_MODULE)/ewol/)
else ifeq ($(PLATFORM), MacOS)
else ifeq ($(PLATFORM), MacOs)
else ifeq ($(PLATFORM), IOS)
else ifeq ($(PLATFORM), IOs)
else ifeq ($(PLATFORM), CygWin)
else ifeq ($(PLATFORM), Windows)
else ifeq ($(PLATFORM), Android)
PROJECT_NDK:=$(PROJECT_MODULE)/android/ndk/
PROJECT_SDK:=$(PROJECT_MODULE)/android/sdk/
else
$(error you must specify a corect platform : make PLATFORM=$(SUPPORTED_PLATFORM))
$(error you must specify a corect platform : make PLATFORM=[$(SUPPORTED_PLATFORM)])
endif
# get the compilation date and time :
BUILD_TIME=$(shell date)
EWOL_FOLDER?=$(realpath $(PROJECT_MODULE)/ewol)
include $(EWOL_FOLDER)/Build/Makefile.$(PLATFORM).mk

View File

@ -296,12 +296,11 @@ module-get-build-dir = \
$(TARGET_OUT_BUILD)/$1
module-get-build-filename = \
$(info build of $1) \
$(TARGET_OUT_BUILD)/$1/$(__modules.$1.MODULE_FILENAME)
$(if $(__modules.$1.MODULE_FILENAME), $(TARGET_OUT_BUILD)/$1/$(__modules.$1.MODULE_FILENAME) )
module-get-staging-filename = \
$(info staging of $1 ==> $(__modules.$1.MODULE_FILENAME)) \
$(TARGET_OUT_STAGING)/$(__modules.$1.DESTDIR)/$(__modules.$1.MODULE_FILENAME)
$(if $(__modules.$1.MODULE_FILENAME), $(TARGET_OUT_STAGING)/$(__modules.$1.DESTDIR)/$(__modules.$1.MODULE_FILENAME) )
###############################################################################
## Generate autoconf.h file from config file.

View File

@ -110,20 +110,16 @@ LOCAL_SHARED_LIBRARIES += \
# Get path
all_shared_libraries := \
$(foreach lib,$(LOCAL_SHARED_LIBRARIES), \
$(info shlib=$(lib)) \
$(call module-get-staging-filename,$(lib)))
all_static_libraries := \
$(foreach lib,$(LOCAL_STATIC_LIBRARIES), \
$(info statlib=$(lib)) \
$(call module-get-staging-filename,$(lib)))
all_whole_static_libraries := \
$(foreach lib,$(LOCAL_WHOLE_STATIC_LIBRARIES), \
$(info whstaticlib=$(lib)) \
$(call module-get-staging-filename,$(lib)))
all_external_libraries := \
$(foreach lib,$(LOCAL_EXTERNAL_LIBRARIES), \
$(info extlib=$(lib)) \
$(TARGET_OUT_BUILD)/$(lib)/$(lib).done)
# all_libraries is used for the dependencies.

View File

@ -10,7 +10,7 @@
###############################################################################
ifneq ("$(words $(shell pwd))","1")
$(error Top directory contains space characters)
$(error Top directory contains space characters)
endif
###############################################################################
@ -19,49 +19,73 @@ endif
# Host OS
ifneq ("$(shell echo $$OSTYPE | grep msys)","")
HOST_OS := MINGW32
HOST_EXE_SUFFIX := .exe
HOST_SHARED_LIB_SUFFIX := .dll
HOST_OS := Windows
HOST_EXE_SUFFIX := .exe
HOST_SHARED_LIB_SUFFIX := .dll
else
HOST_OS := Linux
HOST_EXE_SUFFIX :=
HOST_SHARED_LIB_SUFFIX := .so
HOST_OS := Linux
HOST_EXE_SUFFIX :=
HOST_SHARED_LIB_SUFFIX := .so
endif
# Target OS : default to HOST_OS unless set
ifndef TARGET_OS
TARGET_OS := $(HOST_OS)
TARGET_OS := $(HOST_OS)
endif
# Exe/dll suffix under mingw
TARGET_STATIC_LIB_SUFFIX := .a
ifeq ("$(TARGET_OS)","MINGW32")
DIR_SUFFIX := _mingw32
TARGET_EXE_SUFFIX := .exe
TARGET_SHARED_LIB_SUFFIX := .dll
ifeq ("$(TARGET_OS)","Windows")
DIR_SUFFIX := _mingw32
TARGET_EXE_SUFFIX := .exe
TARGET_SHARED_LIB_SUFFIX := .dll
else
DIR_SUFFIX :=
TARGET_EXE_SUFFIX :=
TARGET_SHARED_LIB_SUFFIX := .so
DIR_SUFFIX :=
TARGET_EXE_SUFFIX :=
TARGET_SHARED_LIB_SUFFIX := .so
endif
ifeq ("$(TARGET_OS)","MINGW32")
# may be overridden in make command line
STATIC := 1
TARGET_GLOBAL_CFLAGS += -D__MINGW_FEATURES__=0
TARGET_GLOBAL_LDFLAGS += -Wl,--enable-auto-import
ifeq ("$(STATIC)","1")
TARGET_GLOBAL_LDFLAGS += -Wl,-Bstatic
endif
ifeq ("$(TARGET_OS)","Windows")
# may be overridden in make command line
STATIC := 1
TARGET_GLOBAL_CFLAGS += -D__MINGW_FEATURES__=0
TARGET_GLOBAL_LDFLAGS += -Wl,--enable-auto-import
ifeq ("$(STATIC)","1")
TARGET_GLOBAL_LDFLAGS += -Wl,-Bstatic
endif
else ifeq ("$(TARGET_OS)","Android")
TARGET_GLOBAL_CFLAGS += -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ \
-fpic -ffunction-sections -funwind-tables -fstack-protector \
-Wno-psabi -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -mthumb \
-fomit-frame-pointer -fno-strict-aliasing -finline-limit=64
TARGET_GLOBAL_CPPFLAGS += -fno-rtti -Wa,--noexecstack
TARGET_GLOBAL_LDFLAGS +=
endif
# define the target OS type for the compilation system ...
TARGET_GLOBAL_CFLAGS += -D__TARGET_OS__$(TARGET_OS)
# basic define of the build time :
TARGET_GLOBAL_CFLAGS += -DBUILD_TIME="\"$(shell date)\"" \
ifeq ($(DEBUG),1)
TARGET_GLOBAL_CFLAGS += -DDEBUG_LEVEL=3
ifeq ("$(OPTIMISE)","1")
TARGET_GLOBAL_CFLAGS += -O2
endif
else
TARGET_GLOBAL_CFLAGS += -DDEBUG_LEVEL=1
endif
# To be able to use ccache with pre-complied headers, some env variables are required
CCACHE :=
ifeq ("$(CCACHE)","1")
ifneq ("$(shell which ccache)","")
CCACHE := CCACHE_SLOPPINESS=time_macros ccache
TARGET_GLOBAL_CFLAGS += -fpch-preprocess
endif
ifneq ("$(shell which ccache)","")
CCACHE := CCACHE_SLOPPINESS=time_macros ccache
TARGET_GLOBAL_CFLAGS += -fpch-preprocess
endif
else
CCACHE :=
endif
# Pre-compiled header generation flag

View File

@ -5,18 +5,10 @@
##
## Setup warning flags.
###############################################################################
ifeq ("$(TARGET_OS)","Android")
COMMON_FLAGS_WARNINGS := -DANDROID -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ \
-fpic -ffunction-sections -funwind-tables -fstack-protector \
-Wno-psabi -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -mthumb \
-fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -MMD -MP -MF
GCC_FLAGS_WARNINGS :=
GXX_FLAGS_WARNINGS := -fno-rtti -Wa,--noexecstack
else
COMMON_FLAGS_WARNINGS :=
GCC_FLAGS_WARNINGS :=
GXX_FLAGS_WARNINGS :=
endif
COMMON_FLAGS_WARNINGS :=
GCC_FLAGS_WARNINGS :=
GXX_FLAGS_WARNINGS :=
# show option associated with warning (gcc >= 4.0.0)
ifneq (0,$(shell expr $(GCC_VERSION) \>= 4.0.0))