From: Michal Sojka Date: Thu, 18 Sep 2008 18:05:00 +0000 (+0000) Subject: Final fix and test-case for sources-list target X-Git-Tag: v0.1-sssa~36 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/omk.git/commitdiff_plain/5894a5c5762176ad179cd48d51bc7839f0821152 Final fix and test-case for sources-list target darcs-hash:20080918180538-f2ef6-6e4a21149d3fe194482c1e8a20e178ded234183d.gz --- diff --git a/snippets/sources-list b/snippets/sources-list index 15f8513..4065aef 100644 --- a/snippets/sources-list +++ b/snippets/sources-list @@ -45,10 +45,10 @@ $(eval $(call omk_pass_template,sources-list-pass,$$(LOCAL_BUILD_DIR),,always)) sources-list-pass-local: @$(foreach m,$(MAKEFILE_LIST),echo ' $(m)' >> "$(SOURCES_LIST_D).tmp";) @$(foreach h,$(include_HEADERS) $(nobase_include_HEADERS) $(kernel_HEADERS),\ - echo "$(RELATIVE_DIR:$(SOURCES_LIST_DIR)/%=%)/$(h)" >> "$(SOURCES_LIST).tmp";) + 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|\(.*\)->.*|$(RELATIVE_DIR:$(SOURCES_LIST_DIR)/%=%)/\1|' >> "$(SOURCES_LIST).tmp";) + @$(foreach h,$(renamed_include_HEADERS),echo '$(h)'|sed -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";)) diff --git a/tests/sources_list/Makefile b/tests/sources_list/Makefile new file mode 100644 index 0000000..b22a357 --- /dev/null +++ b/tests/sources_list/Makefile @@ -0,0 +1,14 @@ +# Generic directory or leaf node makefile for OCERA make framework + +ifndef MAKERULES_DIR +MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) ) +endif + +ifeq ($(MAKERULES_DIR),) +all : default +.DEFAULT:: + @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n" +else +include $(MAKERULES_DIR)/Makefile.rules +endif + diff --git a/tests/sources_list/Makefile.omk b/tests/sources_list/Makefile.omk new file mode 100644 index 0000000..423fdc4 --- /dev/null +++ b/tests/sources_list/Makefile.omk @@ -0,0 +1,7 @@ +SUBDIRS = dir + +include_HEADERS = a.h +renamed_include_HEADERS = b.h->bb.h + +lib_LIBRARIES = l +l_SOURCES = c.c diff --git a/tests/sources_list/dir/Makefile b/tests/sources_list/dir/Makefile new file mode 100644 index 0000000..b22a357 --- /dev/null +++ b/tests/sources_list/dir/Makefile @@ -0,0 +1,14 @@ +# Generic directory or leaf node makefile for OCERA make framework + +ifndef MAKERULES_DIR +MAKERULES_DIR := $(shell ( old_pwd="" ; while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd` ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) ) +endif + +ifeq ($(MAKERULES_DIR),) +all : default +.DEFAULT:: + @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n" +else +include $(MAKERULES_DIR)/Makefile.rules +endif + diff --git a/tests/sources_list/dir/Makefile.omk b/tests/sources_list/dir/Makefile.omk new file mode 100644 index 0000000..06423b7 --- /dev/null +++ b/tests/sources_list/dir/Makefile.omk @@ -0,0 +1,5 @@ +include_HEADERS = d.h +renamed_include_HEADERS = e.h->ee.h + +lib_LIBRARIES = l +l_SOURCES = f.c diff --git a/tests/sources_list/runtest b/tests/sources_list/runtest new file mode 100755 index 0000000..a0b17b5 --- /dev/null +++ b/tests/sources_list/runtest @@ -0,0 +1,6 @@ +#!/bin/sh +. ../functions.sh + +touch config.omk-default +make sources-list +