From: Michal Sojka Date: Fri, 2 Apr 2010 10:43:04 +0000 (+0200) Subject: Update Makefile.rules X-Git-Tag: jsa-paper-casestudy-v2~75 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/demo.git/commitdiff_plain/6b770084f4a098d0e330b6ba090bd07917eaf07b?hp=be2624397f69c250ef636a58af3fafa3d03c6c1a Update Makefile.rules --- diff --git a/build/Makefile.rules b/build/Makefile.rules index 76a9973..aa519c1 100644 --- a/build/Makefile.rules +++ b/build/Makefile.rules @@ -1,10 +1,10 @@ # Makefile.rules - OCERA make framework common project rules -*- makefile-gmake -*- #OMK:base.omk # -# (C) Copyright 2003, 2006, 2007, 2008, 2009 by Pavel Pisa - OCERA team member -# (C) Copyright 2006, 2007, 2008, 2009 by Michal Sojka - Czech Technical University, FEE, DCE +# (C) Copyright 2003, 2006, 2007, 2008, 2009 by Pavel Pisa - OCERA team member +# (C) Copyright 2006, 2007, 2008, 2009, 2010 by Michal Sojka - Czech Technical University, FEE, DCE # # Homepage: http://rtime.felk.cvut.cz/omk/ -# Version: 0.1-93-ga94ffea +# Version: 0.2-15-g5530d5e # # The OMK build system is distributed under the GNU General Public # License. See file COPYING for details. @@ -63,12 +63,6 @@ # QTDIR .. where QT resides OMK_RULES_TYPE=linux #OMK:Makefile.rules.linux@ #OMK:base.omk@Makefile.rules.linux -# We need to ensure definition of sources directory first -ifndef SOURCES_DIR -# Only shell built-in pwd understands -L -SOURCES_DIR := $(shell ( pwd -L ) ) -endif - # If we are not called by OMK leaf Makefile... ifndef MAKERULES_DIR MAKERULES_DIR := $(abspath $(dir $(filter %Makefile.rules,$(MAKEFILE_LIST)))) @@ -81,6 +75,15 @@ ifndef OUTPUT_DIR OUTPUT_DIR := $(MAKERULES_DIR) endif +# We need to ensure definition of sources directory first +ifndef SOURCES_DIR +# Only shell built-in pwd understands -L +SOURCES_DIR := $(shell ( pwd -L ) ) +INVOCATION_DIR := $(SOURCES_DIR:$(OUTPUT_DIR)%=%) +INVOCATION_DIR := $(INVOCATION_DIR:/%=%) +INVOCATION_DIR := $(INVOCATION_DIR:\\%=%) +endif + .PHONY: all default check-make-ver omkize ifdef W @@ -142,7 +145,7 @@ endif #$(CONFIG_FILE_OK) CONFIG_FILES ?= $(wildcard $(CONFIG_FILE)-default) $(wildcard $(OUTPUT_DIR)/config.target) $(wildcard $(CONFIG_FILE)) -export SOURCES_DIR MAKERULES_DIR RELATIVE_DIR +export SOURCES_DIR MAKERULES_DIR RELATIVE_DIR INVOCATION_DIR export CONFIG_FILE CONFIG_FILES OMK_SERIALIZE_INCLUDED OMK_VERBOSE OMK_SILENT # OMK_SERIALIZE_INCLUDED has to be exported to submakes because passes # must to be serialized only in the toplevel make. @@ -243,11 +246,14 @@ endif pass = $(strip $(1)) +unexport SUBDIRS + # Call a pass in a subdirectory # Usage: $(call omk_pass_subdir_template,,,) define omk_pass_subdir_template .PHONY: $(pass)-$(3)-subdir $(pass)-submakes: $(pass)-$(3)-subdir +$(pass)-$(3)-subdir: MAKEOVERRIDES:=$(filter-out SUBDIRS=%,$(MAKEOVERRIDES)) $(pass)-$(3)-subdir: @$(call mkdir_def,$(2)/$(3)) +@$(MAKE) SOURCES_DIR=$(SOURCES_DIR)/$(3) $(NO_PRINT_DIRECTORY) \ @@ -463,6 +469,7 @@ LIB_CPPFLAGS += $(CPPFLAGS) LIB_CFLAGS += $(CFLAGS) ifeq ($(TARGET_OS),win32) + EXE_SUFFIX = .exe SOLIB_EXT = dll else SOLIB_EXT = so @@ -1122,6 +1129,12 @@ $(foreach src,$(filter %.S,$(SOLIB_SOURCES)),$(eval $(call COMPILE_S_o_template, $(foreach src,$(filter %.c,$(SOLIB_GEN_SOURCES)),$(eval $(call COMPILE_c_o_template,$(src),$(src:%.c=%.lo),$(SOLIB_PICFLAGS)))) +# Create _build directories for sources in subdirectories i.e. *_SOURCES=dir/file.c +_dirs_to_create=$(filter-out ./,$(sort $(dir $(USER_SOURCES) $(SOLIB_SOURCES)))) +ifneq ($(_dirs_to_create),) +$(shell mkdir -p $(addprefix $(LOCAL_BUILD_DIR)/,$(_dirs_to_create))) +endif + # IDL compilation USER_IDLS := $(sort $(USER_IDLS)) diff --git a/src/fna b/src/fna index 45f5e05..493e9e8 160000 --- a/src/fna +++ b/src/fna @@ -1 +1 @@ -Subproject commit 45f5e058d668a5e8db88f743f14ebd77b91f02d8 +Subproject commit 493e9e8be9c3761691b96e8366d036d6b3c314fb diff --git a/src/forb b/src/forb index 726960e..8ca1f9e 160000 --- a/src/forb +++ b/src/forb @@ -1 +1 @@ -Subproject commit 726960e4c28e9982f0f4b9136f9f1d2e6cab7b12 +Subproject commit 8ca1f9efdd920a3eeb7cdefed9c340fad6a7f169 diff --git a/src/frsh_forb b/src/frsh_forb index 853c1fe..3a208af 160000 --- a/src/frsh_forb +++ b/src/frsh_forb @@ -1 +1 @@ -Subproject commit 853c1fefc503fdaeb2385c174d48f605bd9b5d6d +Subproject commit 3a208af1f82f8c44420f7f37aa203322e40bfee7 diff --git a/src/ulut b/src/ulut index 1bfcfd9..da27c40 160000 --- a/src/ulut +++ b/src/ulut @@ -1 +1 @@ -Subproject commit 1bfcfd9393da8d8742d612d4a4eb65d1748655ed +Subproject commit da27c404231e2f29a015566de2b34b01088fc016