From 77caff070b0b64662b0097a22e42c6a65134e8f0 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 8 Apr 2013 21:20:26 +0200 Subject: [PATCH] [DEV] better management of the Mac binary generation an Other --- Makefile.mk | 3 +++ core/defs.mk | 7 +++---- core/module.mk | 23 +++++++++++++++++++++-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Makefile.mk b/Makefile.mk index a670dc9..431c5a4 100644 --- a/Makefile.mk +++ b/Makefile.mk @@ -9,6 +9,9 @@ ## General setup. ############################################################################### +# show for windows : http://benjamin.smedbergs.us/pymake/ + + # Make sure SHELL is correctly set SHELL := /bin/bash diff --git a/core/defs.mk b/core/defs.mk index ac263a6..1453cd8 100644 --- a/core/defs.mk +++ b/core/defs.mk @@ -702,8 +702,7 @@ endif ############################################################################### ## Commands for running gcc to link an executable. ############################################################################### -ifneq ("$(TARGET_OS)","MacOs") -define transform-o-to-executable +define transform-o-to-executable-mac @mkdir -p $(dir $@) @echo "Executable (mac): $(PRIVATE_MODULE) ==> $(call path-from-top,$@)" $(call check-pwd-is-top-dir) @@ -719,7 +718,7 @@ $(Q)$(TARGET_CXX) \ $(TARGET_GLOBAL_LDLIBS) $(call strip-executable) endef -else + define transform-o-to-executable @mkdir -p $(dir $@) @echo "Executable: $(PRIVATE_MODULE) ==> $(call path-from-top,$@)" @@ -742,7 +741,7 @@ $(Q)$(TARGET_CXX) \ $(TARGET_GLOBAL_LDLIBS) $(call strip-executable) endef -endif + ############################################################################### ## Commands for copying files. ############################################################################### diff --git a/core/module.mk b/core/module.mk index ada6cce..2dce5a1 100644 --- a/core/module.mk +++ b/core/module.mk @@ -97,10 +97,13 @@ endif ifeq ("$(LOCAL_MODULE_CLASS)","EXECUTABLE") include $(BUILD_RULES) - +ifeq ("$(TARGET_OS)","MacOs") +$(LOCAL_BUILD_MODULE): $(all_objects) $(all_libraries) + $(transform-o-to-executable-mac) +else $(LOCAL_BUILD_MODULE): $(all_objects) $(all_libraries) $(transform-o-to-executable) - +endif copy_to_staging := 1 endif @@ -117,6 +120,22 @@ $(LOCAL_BUILD_MODULE): endif + +############################################################################### +## Package Generation. +############################################################################### + +ifeq ("$(LOCAL_MODULE_CLASS)","PACKAGE") + +include $(BUILD_RULES) + +$(LOCAL_BUILD_MODULE)-pkg: $(LOCAL_BUILD_MODULE) + $(transform-staging-to-package) + +copy_to_staging := 1 + + +endif ############################################################################### ## Files to copy. ###############################################################################