]> rtime.felk.cvut.cz Git - frescor/frsh-forb.git/commitdiff
Makefiles: update for RTEMS to link all parts together into libfrsh-forb.a
authorPetr Benes <benesp16@fel.cvut.cz>
Sat, 3 Sep 2011 14:01:30 +0000 (16:01 +0200)
committerPetr Benes <benesp16@fel.cvut.cz>
Sat, 3 Sep 2011 14:01:30 +0000 (16:01 +0200)
build/rtems/Makefile.omk
build/rtems/Makefile.rules
src/fna/Makefile.omk
src/forb/src/Makefile.omk
src/forb/src/forbrun/Makefile.omk
src/frsh/fres/cbroker/Makefile.omk
src/frsh/fres/resalloc/Makefile.omk
src/frsh/fres/resmng/Makefile.omk

index 198eb879ec58203707e710ab5d2de7e5237e8f21..55af84ef793ef61b367579eeadf14fe2dbd7112e 100644 (file)
@@ -2,3 +2,14 @@ SUBDIRS=$(ALL_OMK_SUBDIRS)
 #wvtest/c
 EXTRA_RULES_SUBDIRS = forb/forb-idl
 
+#library-pass_HOOKS = $(USER_LIB_DIR)/frsh-forb.a
+library-pass_HOOKS = my_meta_lib
+
+.PHONY : my_meta_lib
+
+my_meta_lib :
+       $(Q) echo "GROUP(-lfrm_rtemscpu -lfrshrtemscpu -lfrm -lfcb -lsharedobj -lsynchobj -lfrsh -lfra -lfra_dummy -lcontract -lfna -lforb -lforbrun -lulut -lfosa)" \
+         > $(USER_LIB_DIR)/libfrsh-forb.a-tmp
+       $(Q) if ! cmp --quiet $(USER_LIB_DIR)/libfrsh-forb.a-tmp $(USER_LIB_DIR)/libfrsh-forb.a ; then \
+               cp $(USER_LIB_DIR)/libfrsh-forb.a-tmp $(USER_LIB_DIR)/libfrsh-forb.a ; echo "  GEN $(USER_LIB_DIR)/libfrsh-forb.a" ; \
+            fi
\ No newline at end of file
index 8e1689a2427a388dd5f3128ef1a46cd37c657521..2e9fc9d50f62bf770634353bf7f1121e7e8e0b7f 100644 (file)
@@ -4,7 +4,7 @@
 #  (C) Copyright 2006, 2007, 2008, 2009, 2010, 2011 by Michal Sojka - Czech Technical University, FEE, DCE
 #
 #  Homepage: http://rtime.felk.cvut.cz/omk/
-#  Version:  0.2-89-g95151fe
+#  Version:  0.2-96-gd5bf305
 #
 # The OMK build system is distributed under the GNU General Public
 # License.  See file COPYING for details.
@@ -47,6 +47,23 @@ ifndef MAKERULES_DIR
 MAKERULES_DIR := $(abspath $(dir $(filter %Makefile.rules,$(MAKEFILE_LIST))))
 endif
 
+# The $(SED4OMK) command for BSD based systems requires -E option to allow
+# extended regular expressions
+
+SED4OMK ?= sed
+ifneq ($(shell ( echo A | $(SED4OMK) -n -e 's/A\|B/y/p' )),y)
+  SED4OMK := $(SED4OMK) -E
+  ifneq ($(shell ( echo A | $(SED4OMK) -n -e 's/A\|B/y/p' )),y)
+    SED4OMK := gsed
+  endif
+  ifneq ($(shell ( echo A | $(SED4OMK) -n -e 's/A\|B/y/p' )),y)
+    SED4OMK := gsed -E
+  endif
+  ifneq ($(shell ( echo A | $(SED4OMK) -n -e 's/A\|B/y/p' )),y)
+    $(error No SED program suitable for OMK found)
+  endif
+endif
+
 # OUTPUT_DIR is the place where _compiled, _build and possible other
 # files/directories are created. By default is the same as
 # $(MAKERULES_DIR).
@@ -117,7 +134,7 @@ endif
 CONFIG_FILES ?= $(wildcard $(CONFIG_FILE)-default) $(wildcard $(OUTPUT_DIR)/config.target) $(wildcard $(CONFIG_FILE))
 
 
-export SOURCES_DIR MAKERULES_DIR RELATIVE_DIR INVOCATION_DIR
+export SED4OMK 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.
@@ -129,7 +146,7 @@ endif
 override RELATIVE_DIR := $(RELATIVE_DIR:/%=%)
 override RELATIVE_DIR := $(RELATIVE_DIR:\\%=%)
 #$(warning  RELATIVE_DIR = "$(RELATIVE_DIR)")
-#override BACK2TOP_DIR := $(shell echo $(RELATIVE_DIR)/ | sed -e 's_//_/_g' -e 's_/\./_/_g' -e 's_^\./__g'  -e 's_\([^/][^/]*\)_.._g' -e 's_/$$__')
+#override BACK2TOP_DIR := $(shell echo $(RELATIVE_DIR)/ | $(SED4OMK) -e 's_//_/_g' -e 's_/\./_/_g' -e 's_^\./__g'  -e 's_\([^/][^/]*\)_.._g' -e 's_/$$__')
 #$(warning  BACK2TOP_DIR = "$(BACK2TOP_DIR)")
 
 #$(warning SOURCES_DIR = "$(SOURCES_DIR)")
@@ -188,9 +205,9 @@ print-hints:
        @echo 'Use "make V=1" to see the verbose compile lines.'
 
 check-make-ver:
-       @GOOD_MAKE_VERSION=`echo $(MAKE_VERSION) | sed -n -e 's/^[4-9]\..*\|^3\.9[0-9].*\|^3\.8[1-9].*/y/p'` ; \
+       @GOOD_MAKE_VERSION=`echo $(MAKE_VERSION) | $(SED4OMK) -n -e 's/^[4-9]\..*\|^3\.9[0-9].*\|^3\.8[1-9].*/y/p'` ; \
        if [ x$$GOOD_MAKE_VERSION != xy ] ; then \
-               echo "Your make program version is too old and does not support OMK system." ; \
+               echo "Your make program version ($(MAKE_VERSION)) is too old and does not support OMK system." ; \
                echo "Please update to make program 3.81beta1 or newer." ; exit 1 ; \
        fi
 
@@ -298,7 +315,7 @@ default-config-pass-local:
 #      @echo Default config for $(RELATIVE_DIR)
        @echo "# Config for $(RELATIVE_DIR)" >> "$(CONFIG_FILE)-default"
        @$(foreach x, $(default_CONFIG), echo '$(x)' | \
-               sed -e 's/^[^=]*=x$$/#\0/' >> "$(CONFIG_FILE)-default" ; )
+               $(SED4OMK) -e 's/^[^=]*=x$$/#\0/' >> "$(CONFIG_FILE)-default" ; )
 
 
 omkize:
@@ -459,7 +476,7 @@ S_o_COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 
 # Check GCC version for user build
 ifndef CC_MAJOR_VERSION
-CC_MAJOR_VERSION := $(shell $(CC) -dumpversion | sed -e 's/\([^.]\)\..*/\1/')
+CC_MAJOR_VERSION := $(shell $(CC) -dumpversion | $(SED4OMK) -e 's/\([^.]\)\..*/\1/')
 endif
 # Prepare suitable define for dependency building
 ifeq ($(CC_MAJOR_VERSION),2)
@@ -513,15 +530,15 @@ $(2): $(1)
 # Bellow, the tricks with redirection are for shells without set -o pipefail
 # (see http://www.mail-archive.com/dash@vger.kernel.org/msg00149.html)
        $(Q)exec 3>&1; status=`exec 4>&1 >&3; { $(NM) $$<; echo $$$$? >&4; }\
-               | sed -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2cond_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \
+               | $(SED4OMK) -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2cond_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \
                | sort >>$$@.tmp` && exit $$$$status
        $(Q)echo >>$$@.tmp '/* Defines from the values defined to symbols in hexadecimal format */'
        $(Q)exec 3>&1; status=`exec 4>&1 >&3; { $(NM) $$<; echo $$$$? >&4; }\
-               | sed -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2def_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \
+               | $(SED4OMK) -n 's/^ *0*\(0[0-9A-Fa-f]*\) *A *_cmetric2def_\([A-Za-z_0-9]*\) */#define \2 0x\1/p' \
                | sort >>$$@.tmp` && exit $$$$status
        $(Q)echo >>$$@.tmp '/* Defines from the values defined to symbols in decimal format */'
        $(Q)exec 3>&1; status=`exec 4>&1 >&3; { $(NM) -td $$<; echo $$$$? >&4; }\
-               | sed -n 's/^ *0*\(0\|[1-9][0-9]*\) *A *_cmetric2defdec_\([A-Za-z_0-9]*\) */#define \2 \1/p' \
+               | $(SED4OMK) -n 's/^ *0*\(0\|[1-9][0-9]*\) *A *_cmetric2defdec_\([A-Za-z_0-9]*\) */#define \2 \1/p' \
                | sort >>$$@.tmp` && exit $$$$status
        $(Q)mv $$@.tmp $$@
 endef
@@ -544,10 +561,10 @@ $(1)_GEN_SOURCES += $$(filter %.c,$$($(1)_CLIENT_IDL:%.idl=%-common.c))
 $(1)_GEN_SOURCES += $$(filter %.c,$$($(1)_IDL:%.idl=%.c))
 USER_GEN_SOURCES += $$($(1)_GEN_SOURCES)
 
-$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.c=%.o))
-$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.cc=%.o))
-$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.cxx=%.o))
-$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.S=%.o))
+$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.c=%.o) $$($(1)_GEN_SOURCES:%.c=%.o))
+$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.cc=%.o) $$($(1)_GEN_SOURCES:%.c=%.o))
+$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.cxx=%.o) $$($(1)_GEN_SOURCES:%.c=%.o))
+$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.S=%.o) $$($(1)_GEN_SOURCES:%.c=%.o))
 $(1)_OBJS += $$($(1)_EMBEDTARFILES:%=%_tarfile.o)
 $(1)_OBJS := $$(sort $$($(1)_OBJS))
 
@@ -564,7 +581,7 @@ $(2)/$(1): $$($(1)_OBJS)
          $$(AM_LDFLAGS) $$(LDFLAGS) $$($(1)_OBJS) $$(LOADLIBES) $$($(1)_LIBS:%=-l%) \
          -o $(2)/$(1)
 #@echo "$(2)/$(1): \\" >$(USER_OBJS_DIR)/$(1).exe.d
-#@sed -n -e 's/^LOAD \(.*\)$$$$/  \1  \\/p' $(USER_OBJS_DIR)/$(1).exe.map  >>$(USER_OBJS_DIR)/$(1).exe.d
+#@$(SED4OMK) -n -e 's/^LOAD \(.*\)$$$$/  \1  \\/p' $(USER_OBJS_DIR)/$(1).exe.map  >>$(USER_OBJS_DIR)/$(1).exe.d
 #@echo >>$(USER_OBJS_DIR)/$(1).exe.d
 #-Wl,-Map,$(USER_OBJS_DIR)/$(1).exe.map
 # FIXME: Why the map file was commented out?
@@ -582,10 +599,10 @@ $(1)_GEN_SOURCES += $$(filter %.c,$$($(1)_CLIENT_IDL:%.idl=%-common.c))
 $(1)_GEN_SOURCES += $$(filter %.c,$$($(1)_IDL:%.idl=%.c))
 USER_GEN_SOURCES += $$($(1)_GEN_SOURCES)
 
-$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.c=%.o))
-$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.cc=%.o))
-$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.cxx=%.o))
-$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.S=%.o))
+$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.c=%.o) $$($(1)_GEN_SOURCES:%.c=%.o))
+$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.cc=%.o) $$($(1)_GEN_SOURCES:%.c=%.o))
+$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.cxx=%.o) $$($(1)_GEN_SOURCES:%.c=%.o))
+$(1)_OBJS += $$(filter %.o,$$($(1)_SOURCES:%.S=%.o) $$($(1)_GEN_SOURCES:%.c=%.o))
 $(1)_OBJS += $$($(1)_EMBEDTARFILES:%=%_tarfile.o)
 $(1)_OBJS := $$(sort $$($(1)_OBJS))
 
@@ -612,10 +629,10 @@ $(1)_GEN_SOURCES += $$(filter %.c,$$($(1)_CLIENT_IDL:%.idl=%-common.c))
 $(1)_GEN_SOURCES += $$(filter %.c,$$($(1)_IDL:%.idl=%.c))
 SOLIB_GEN_SOURCES += $$($(1)_GEN_SOURCES)
 
-$(1)_OBJSLO += $$(filter %.lo,$$($(1)_SOURCES:%.c=%.lo))
-$(1)_OBJSLO += $$(filter %.lo,$$($(1)_SOURCES:%.cc=%.lo))
-$(1)_OBJSLO += $$(filter %.lo,$$($(1)_SOURCES:%.cxx=%.lo))
-$(1)_OBJSLO += $$(filter %.lo,$$($(1)_SOURCES:%.S=%.lo))
+$(1)_OBJSLO += $$(filter %.lo,$$($(1)_SOURCES:%.c=%.lo) $$($(1)_GEN_SOURCES:%.c=%.lo))
+$(1)_OBJSLO += $$(filter %.lo,$$($(1)_SOURCES:%.cc=%.lo) $$($(1)_GEN_SOURCES:%.c=%.lo))
+$(1)_OBJSLO += $$(filter %.lo,$$($(1)_SOURCES:%.cxx=%.lo) $$($(1)_GEN_SOURCES:%.c=%.lo))
+$(1)_OBJSLO += $$(filter %.lo,$$($(1)_SOURCES:%.S=%.lo) $$($(1)_GEN_SOURCES:%.c=%.lo))
 $(1)_OBJS += $$($(1)_EMBEDTARFILES:%=%_tarfile.o)
 $(1)_OBJSLO := $$(sort $$($(1)_OBJSLO))
 
@@ -754,10 +771,10 @@ $(addprefix $(1)/,$(notdir $(addsuffix .stamp,$(2)))) : $(CONFIG_FILES)
        $(if $(DOXYGEN),@echo "/** @file */" >> "$(2).tmp")
        @echo "#ifndef $(4)" >> "$(2).tmp"
        @echo "#define $(4)" >> "$(2).tmp"
-       @( $(foreach x, $(shell echo '$($(3))' | tr 'x\t ' 'x\n\n' | sed -e 's/^\([^ =]*\)\(=[^ ]\+\|\)$$/\1/' ), \
+       @( $(foreach x, $(shell echo '$($(3))' | tr 'x\t ' 'x\n\n' | $(SED4OMK) -e 's/^\([^ =]*\)\(=[^ ]\+\|\)$$/\1/' ), \
                echo '$(x).$($(x))' ; ) echo ; ) | \
-               sed -e '/^[^.]*\.n$$$$/d' -e '/^[^.]*\.$$$$/d' -e 's/^\([^.]*\)\.[ym]$$$$/\1.1/' | \
-               sed -n -e 's/^\([^.]*\)\.\(.*\)$$$$/#define \1 \2/p' \
+               $(SED4OMK) -e '/^[^.]*\.n$$$$/d' -e '/^[^.]*\.$$$$/d' -e 's/^\([^.]*\)\.[ym]$$$$/\1.1/' | \
+               $(SED4OMK) -n -e 's/^\([^.]*\)\.\(.*\)$$$$/#define \1 \2/p' \
                  >> "$(2).tmp"
        @echo "#endif /*$(4)*/" >> "$(2).tmp"
        @touch "$$@"
@@ -844,7 +861,7 @@ $(SOURCES_LIST): $(CONFIG_FILES) $(shell find -name $(MAKEFILE_OMK))
        @mv "$(SOURCES_LIST).tmp2" "$(SOURCES_LIST)"
        @echo "$(SOURCES_LIST): \\" > "$(SOURCES_LIST_D).tmp2"
        @cat "$(SOURCES_LIST_D).tmp"|grep -v "$(SOURCES_LIST_D).tmp"|sort|uniq|\
-               sed -e 's/$$/\\/' >> "$(SOURCES_LIST_D).tmp2"
+               $(SED4OMK) -e 's/$$/\\/' >> "$(SOURCES_LIST_D).tmp2"
        @rm "$(SOURCES_LIST_D).tmp"
        @mv "$(SOURCES_LIST_D).tmp2" "$(SOURCES_LIST_D)"
 endif
@@ -857,7 +874,7 @@ sources-list-pass-local:
          echo "$(addsuffix /,$(RELATIVE_DIR:$(SOURCES_LIST_DIR)/%=%))$(h)" >> "$(SOURCES_LIST).tmp";)
        @$(foreach ch,$(config_include_HEADERS), \
          echo "$(USER_INCLUDE_DIR:$(OUTPUT_DIR)/$(addsuffix /,$(SOURCES_LIST_DIR))%=%)/$(ch)" >> "$(SOURCES_LIST).tmp";)
-       @$(foreach h,$(renamed_include_HEADERS),echo '$(h)'|sed -e 's|\(.*\)->.*|$(addsuffix /,$(RELATIVE_DIR:$(SOURCES_LIST_DIR)/%=%))\1|' >> "$(SOURCES_LIST).tmp";)
+       @$(foreach h,$(renamed_include_HEADERS),echo '$(h)'|$(SED4OMK) -e 's|\(.*\)->.*|$(addsuffix /,$(RELATIVE_DIR:$(SOURCES_LIST_DIR)/%=%))\1|' >> "$(SOURCES_LIST).tmp";)
        @$(foreach bin,$(lib_LIBRARIES) $(shared_LIBRARIES) $(bin_PROGRAMS) $(test_PROGRAMS) $(utils_PROGRAMS) \
          $(kernel_LIBRARIES) $(rtlinux_LIBRARIES) $(kernel_MODULES),\
          $(foreach src,$(filter-out %.o,$($(bin)_SOURCES)),echo "$(addsuffix /,$(RELATIVE_DIR:$(SOURCES_LIST_DIR)/%=%))$(src)" >> "$(SOURCES_LIST).tmp";))
@@ -880,7 +897,7 @@ export TAGS_CMD
 
 ifeq ($(MAKECMDGOALS),do-tags)
 .PHONY: do-tags
-do-tags: $(shell sed -e '/^\#/d' $(SOURCES_LIST))
+do-tags: $(shell $(SED4OMK) -e '/^\#/d' $(SOURCES_LIST))
        @$(QUIET_CMD_ECHO) "  TAGS    $(SOURCES_LIST_FN)"
        $(Q)$(TAGS_CMD) $^
 endif
@@ -889,6 +906,6 @@ endif
 
 cscope: $(SOURCES_LIST)
        @$(QUIET_CMD_ECHO) "  CSCOPE  < $(SOURCES_LIST_FN)"
-       $(Q)sed -e '/^#/d' $(SOURCES_LIST) > cscope.files
+       $(Q)$(SED4OMK) -e '/^#/d' $(SOURCES_LIST) > cscope.files
        $(Q)cscope -b -icscope.files
 #FIXME: see doc to -i in cscope(1)
index c8b9d45ff2428e5269697aabfc4bff2113ae4594..4cb9106fb44ea0f8b991dc3020d75c999bdc29f0 100644 (file)
@@ -27,3 +27,10 @@ endif
 ifeq ($(CONFIG_FWP),y)
 CFLAGS+=-DFWP_FNA_ENABLED
 endif
+
+include-pass_HOOKS = my_src_mkdir
+
+.PHONY : my_src_mkdir
+
+my_src_mkdir :
+       $(Q) mkdir -p src
\ No newline at end of file
index bfe0c1e16306d855327b21d7efd325828594dd6b..1d0f0c16e25931acbaeb562f58f813092610d8c5 100644 (file)
@@ -10,6 +10,7 @@ CFLAGS+= -Wall -Wextra -D_REENTRANT
 endif
 
 CFLAGS += -I.
+INCLUDES += -I.
 
 # IDL_COMPILER += --pidl
 
index 99d1f9f3774520c6a70b3c29ad92d9a25afb5cf5..87f62e29f22b6ec265ff3af017e999755fdc08d3 100644 (file)
@@ -1,4 +1,4 @@
-ifeq ($(CONFIG_RTEMS),y)
+ifeq ($(CONFIG_RESOURCE_RTEMS_CPU),y)
 $(forb_shared_LIBRARIES) += forbrun
 forbrun_SOURCES = forbrun_rtems.c
 lib_LOADLIBES = forb ulut fosa
index 77d3ad44c609cb0b87fb5a4812f77eed553d111f..6450714af2637d85bda01b75b428d787a94cdd3e 100644 (file)
@@ -12,7 +12,7 @@ fcb_LIBS += frsh              # For frsh_strerror
 fcb_SERVER_IDL = fcb.idl
 
 lib_LIBRARIES += fcb_client 
-fcb_client_CLIENT_IDL = fcb.idl
+fcb_CLIENT_IDL = fcb.idl
 
 include_GEN_HEADERS += fcb.h
 include_HEADERS += fcb_contact_info.h
index 114b0c0d60f3f6b1eb53430a0848a7b1dac6ef0e..00dee9bbbd3d0268f795ee08c7b8af5d52c3ff4a 100644 (file)
@@ -1,6 +1,7 @@
 $(forb_shared_LIBRARIES) += fra
 fra_SOURCES = fra_generic.c fra_registry.c fres_vres.c
 fra_SERVER_IDL = fra.idl
+fra_CLIENT_IDL = fra.idl
 include_GEN_HEADERS += fra.h
 include_HEADERS = fra_generic.h fres_vres.h
 
index 5f6190677bdc70bb293491053cb43d037c13a5a4..948206e750ac47ba9bb86210df2677ce54310db1 100644 (file)
@@ -1,6 +1,7 @@
 $(forb_shared_LIBRARIES) = frm
 frm_SOURCES = fres_sa_scenario.c frm_generic.c
 frm_SERVER_IDL = frm.idl
+frm_CLIENT_IDL = frm.idl
 
 include_HEADERS += frm_generic.h fres_sa_scenario.h
 include_GEN_HEADERS += frm.h