]> rtime.felk.cvut.cz Git - frescor/demo.git/commitdiff
Update Makefile.rules
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 2 Apr 2010 10:43:04 +0000 (12:43 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 2 Apr 2010 10:43:04 +0000 (12:43 +0200)
build/Makefile.rules
src/fna
src/forb
src/frsh_forb
src/ulut

index 76a9973c2cda448431b7cfdf9befe2eba7861b05..aa519c1a6b6512b599e4f621ae942513982ee634 100644 (file)
@@ -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.
 # 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,<pass name>,<build dir>,<subdir>)
 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 45f5e058d668a5e8db88f743f14ebd77b91f02d8..493e9e8be9c3761691b96e8366d036d6b3c314fb 160000 (submodule)
--- a/src/fna
+++ b/src/fna
@@ -1 +1 @@
-Subproject commit 45f5e058d668a5e8db88f743f14ebd77b91f02d8
+Subproject commit 493e9e8be9c3761691b96e8366d036d6b3c314fb
index 726960e4c28e9982f0f4b9136f9f1d2e6cab7b12..8ca1f9efdd920a3eeb7cdefed9c340fad6a7f169 160000 (submodule)
--- a/src/forb
+++ b/src/forb
@@ -1 +1 @@
-Subproject commit 726960e4c28e9982f0f4b9136f9f1d2e6cab7b12
+Subproject commit 8ca1f9efdd920a3eeb7cdefed9c340fad6a7f169
index 853c1fefc503fdaeb2385c174d48f605bd9b5d6d..3a208af1f82f8c44420f7f37aa203322e40bfee7 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 853c1fefc503fdaeb2385c174d48f605bd9b5d6d
+Subproject commit 3a208af1f82f8c44420f7f37aa203322e40bfee7
index 1bfcfd9393da8d8742d612d4a4eb65d1748655ed..da27c404231e2f29a015566de2b34b01088fc016 160000 (submodule)
--- a/src/ulut
+++ b/src/ulut
@@ -1 +1 @@
-Subproject commit 1bfcfd9393da8d8742d612d4a4eb65d1748655ed
+Subproject commit da27c404231e2f29a015566de2b34b01088fc016