[DEV] not copy static lib in the staging folder to prevent unneded .a in final pachages

add the stip of binary when DEBUG=0
This commit is contained in:
Edouard DUPIN 2013-03-11 23:10:02 +01:00
parent 2837a00f76
commit 50b0424408
9 changed files with 65 additions and 47 deletions

View File

@ -20,11 +20,6 @@ TARGET_ARCH := ARMv7
TARGET_CROSS := $(PROJECT_NDK)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
TARGET_CROSS_CLANG := $(PROJECT_NDK)/toolchains/llvm-3.1/prebuilt/linux-x86/bin/
TARGET_OUT_FOLDER_BINARY := ERROR_NOTHING_MUST_BE_SET_HERE
TARGET_OUT_FOLDER_LIBRAIRY := data/lib/armeabi
TARGET_OUT_FOLDER_DATA := data/assets
TARGET_OUT_FOLDER_DOC := doc
TARGET_OUT_PREFIX_LIBRAIRY := lib
#local get the gcc version :
@ -36,7 +31,7 @@ TARGET_GLOBAL_C_INCLUDES+=-I$(PROJECT_NDK)/sources/cxx-stl/system/include/
TARGET_GLOBAL_LDLIBS_SHARED = --sysroot=$(PROJECT_NDK)/platforms/android-$(ANDROID_BOARD_ID)/arch-arm
#generic makefile
include $(BUILD_SYSTEM)/core/main.mk
include $(BUILD_SYSTEM)/main.mk
FINAL_FOLDER_JAVA_PROJECT=$(TARGET_OUT_STAGING)/src/$(PROJECT_COMPAGNY_TYPE)/$(PROJECT_COMPAGNY_NAME2)/$(PROJECT_NAME2)

View File

@ -5,11 +5,7 @@
## @copyright BSDv3
###############################################################################
TARGET_OUT_FOLDER_BINARY := $(PROJECT_NAME2)/usr/bin
TARGET_OUT_FOLDER_LIBRAIRY := $(PROJECT_NAME2)/usr/lib
TARGET_OUT_FOLDER_DATA := $(PROJECT_NAME2)/usr/share/$(PROJECT_NAME2)
TARGET_OUT_FOLDER_DOC := $(PROJECT_NAME2)/usr/share/doc
TARGET_OUT_PREFIX_LIBRAIRY :=
# include generic makefile :

View File

@ -13,13 +13,6 @@ $(info =============>CLANG=$(CLANG))
# http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt
TARGET_OUT_FOLDER_BINARY := MacOS
TARGET_OUT_FOLDER_LIBRAIRY := lib
TARGET_OUT_FOLDER_DATA := Resources
TARGET_OUT_FOLDER_DOC := doc
TARGET_OUT_PREFIX_LIBRAIRY :=
# include generic makefile :
include $(BUILD_SYSTEM)/main.mk

View File

@ -8,12 +8,6 @@
# define the cross compilateur
TARGET_CROSS=i586-mingw32msvc-
TARGET_OUT_FOLDER_BINARY :=
TARGET_OUT_FOLDER_LIBRAIRY := lib
TARGET_OUT_FOLDER_DATA := data
TARGET_OUT_FOLDER_DOC := doc
TARGET_OUT_PREFIX_LIBRAIRY :=
include $(BUILD_SYSTEM)/main.mk

View File

@ -225,5 +225,5 @@ $(shell mkdir -p $(CONFIG_GLOBAL_FOLDER))
-include $(CONFIG_GLOBAL_FILE)
$(CONFIG_GLOBAL_FILE):
@$(error "need to generate config : make PLATFORM=$(PLATFORM) config")
@$(warning "need to generate config : make PLATFORM=$(PLATFORM) config")

View File

@ -644,14 +644,26 @@ $(Q)$(TARGET_CXX) \
endef
###############################################################################
## Commands for running gcc to link an executable.
## Commands for stripping an executable. (dependeing of the debug mode requested)
###############################################################################
# strip the current output file in not debug mode ==> smallest binary
ifneq ("$(DEBUG)","1")
define strip-executable
$(Q)$(TARGET_STRIP) $@
endef
else
define strip-executable
endef
endif
###############################################################################
## Commands for running gcc to link an executable.
###############################################################################
define transform-o-to-executable
@mkdir -p $(dir $@)
@echo "Executable: $(PRIVATE_MODULE) ==> $(call path-from-top,$@)"
$(call check-pwd-is-top-dir)
@# TODO : Set LD ...
$(Q)$(TARGET_CXX) \
-o $@ \
$(TARGET_GLOBAL_LDFLAGS) \
@ -668,6 +680,7 @@ $(Q)$(TARGET_CXX) \
$(PRIVATE_ALL_SHARED_LIBRARIES) \
$(PRIVATE_LDLIBS) \
$(TARGET_GLOBAL_LDLIBS)
$(call strip-executable)
endef
###############################################################################

View File

@ -145,6 +145,7 @@ check:
# Display configuration.
###############################################################################
$(info ----------------------------------------------------------------------)
$(info PLATFORM: $(PLATFORM))
$(info HOST_OS: $(HOST_OS))
$(info TARGET_OS: $(TARGET_OS))
$(info TARGET_ARCH: $(TARGET_ARCH))

View File

@ -15,8 +15,11 @@ copy_to_staging := 0
LOCAL_BUILD_MODULE := $(call module-get-build-filename,$(LOCAL_MODULE))
# Full path to staging module
ifeq ("$(LOCAL_MODULE_CLASS)","STATIC_LIBRARY")
LOCAL_STAGING_MODULE := $(call module-get-build-filename,$(LOCAL_MODULE))
else
LOCAL_STAGING_MODULE := $(call module-get-staging-filename,$(LOCAL_MODULE))
endif
# Assemble the list of targets to create PRIVATE_ variables for.
LOCAL_TARGETS := \
$(LOCAL_BUILD_MODULE) \
@ -68,7 +71,7 @@ include $(BUILD_RULES)
$(LOCAL_BUILD_MODULE): $(all_objects)
$(transform-o-to-static-lib)
copy_to_staging := 1
copy_to_staging := 0
endif
@ -130,7 +133,7 @@ $(foreach __pair,$(LOCAL_COPY_FILES), \
$(eval __dst := $(TARGET_OUT_STAGING)/$(TARGET_OUT_FOLDER_DATA)/$(word 2,$(__pair2))) \
$(if $(__src), \
$(eval all_copy_files += $(__dst)) \
$(eval $(call copy-one-file,$(__src),$(__dst)) )\
$(eval $(call copy-one-file,$(call fullpath,$(__src)),$(__dst)) )\
, \
$(info copy: $(LOCAL_MODULE) <== warning: no file named: $(word 1,$(__pair2)) ) \
) \
@ -146,7 +149,7 @@ $(foreach __pair,$(LOCAL_COPY_FOLDERS), \
$(foreach __file_src,$(__list_file_src), \
$(eval __file_dest := $(__folder_dest)/$(notdir $(__file_src))) \
$(eval all_copy_files += $(__file_dest)) \
$(eval $(call copy-one-file,$(__file_src),$(__file_dest))) \
$(eval $(call copy-one-file,$(call fullpath,$(__file_src)),$(__file_dest))) \
) \
, \
$(info copy: $(LOCAL_MODULE) <== warning: no file named: $(word 1,$(__pair2)) ) \

View File

@ -42,21 +42,6 @@ TARGET_GLOBAL_CFLAGS_THUMB ?=
TARGET_PCH_FLAGS ?=
TARGET_DEFAULT_ARM_MODE ?= THUMB
# Target OS : default to HOST_OS unless set
ifndef TARGET_OS
TARGET_OS := $(HOST_OS)
endif
# Exe/dll suffix under mingw
TARGET_STATIC_LIB_SUFFIX := .a
ifeq ("$(TARGET_OS)","Windows")
TARGET_EXE_SUFFIX := .exe
TARGET_SHARED_LIB_SUFFIX := .dll
else
TARGET_EXE_SUFFIX :=
TARGET_SHARED_LIB_SUFFIX := .so
endif
ifeq ("$(TARGET_OS)","Windows")
# may be overridden in make command line
STATIC := 1
@ -67,7 +52,7 @@ ifeq ("$(TARGET_OS)","Windows")
endif
# remove CLANG if defined
ifeq ("$(CLANG)","1")
$(error CLANG is not supported on $(TARGET_OS) platform ==> disable it)
$(error CLANG is not supported on $(TARGET_OS) platform ==> disable it)
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__
@ -117,6 +102,44 @@ else ifeq ("$(TARGET_OS)","IOs")
endif
TARGET_STATIC_LIB_SUFFIX := .a
ifeq ("$(TARGET_OS)","Windows")
TARGET_EXE_SUFFIX := .exe
TARGET_SHARED_LIB_SUFFIX := .dll
TARGET_OUT_FOLDER_BINARY :=
TARGET_OUT_FOLDER_LIBRAIRY := lib
TARGET_OUT_FOLDER_DATA := data
TARGET_OUT_FOLDER_DOC := doc
TARGET_OUT_PREFIX_LIBRAIRY :=
else ifeq ("$(TARGET_OS)","Android")
TARGET_EXE_SUFFIX :=
TARGET_SHARED_LIB_SUFFIX := .so
TARGET_OUT_FOLDER_BINARY := ERROR_NOTHING_MUST_BE_SET_HERE
TARGET_OUT_FOLDER_LIBRAIRY := data/lib/armeabi
TARGET_OUT_FOLDER_DATA := data/assets
TARGET_OUT_FOLDER_DOC := doc
TARGET_OUT_PREFIX_LIBRAIRY := lib
else ifeq ("$(TARGET_OS)","Linux")
TARGET_EXE_SUFFIX :=
TARGET_SHARED_LIB_SUFFIX := .so
TARGET_OUT_FOLDER_BINARY := $(PROJECT_NAME2)/usr/bin
TARGET_OUT_FOLDER_LIBRAIRY := $(PROJECT_NAME2)/usr/lib
TARGET_OUT_FOLDER_DATA := $(PROJECT_NAME2)/usr/share/$(PROJECT_NAME2)
TARGET_OUT_FOLDER_DOC := $(PROJECT_NAME2)/usr/share/doc
TARGET_OUT_PREFIX_LIBRAIRY :=
else ifeq ("$(TARGET_OS)","MacOs")
TARGET_EXE_SUFFIX :=
TARGET_SHARED_LIB_SUFFIX := .dylib
TARGET_OUT_FOLDER_BINARY := MacOS
TARGET_OUT_FOLDER_LIBRAIRY := lib
TARGET_OUT_FOLDER_DATA := Resources
TARGET_OUT_FOLDER_DOC := doc
TARGET_OUT_PREFIX_LIBRAIRY :=
else ifeq ("$(TARGET_OS)","IOs")
endif
# define the target OS type for the compilation system ...
TARGET_GLOBAL_CFLAGS += -D__TARGET_OS__$(TARGET_OS)
# basic define of the build time :