]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Final fix and test-case for sources-list target
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 18 Sep 2008 18:05:00 +0000 (18:05 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 18 Sep 2008 18:05:00 +0000 (18:05 +0000)
darcs-hash:20080918180538-f2ef6-6e4a21149d3fe194482c1e8a20e178ded234183d.gz

snippets/sources-list
tests/sources_list/Makefile [new file with mode: 0644]
tests/sources_list/Makefile.omk [new file with mode: 0644]
tests/sources_list/dir/Makefile [new file with mode: 0644]
tests/sources_list/dir/Makefile.omk [new file with mode: 0644]
tests/sources_list/runtest [new file with mode: 0755]

index 15f85137a9a5698411d8871c95b4a85e2459423b..4065aefbb24475b413d02f48ff0e2c9f33ff1beb 100644 (file)
@@ -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 (file)
index 0000000..b22a357
--- /dev/null
@@ -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 (file)
index 0000000..423fdc4
--- /dev/null
@@ -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 (file)
index 0000000..b22a357
--- /dev/null
@@ -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 (file)
index 0000000..06423b7
--- /dev/null
@@ -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 (executable)
index 0000000..a0b17b5
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+. ../functions.sh
+
+touch config.omk-default
+make sources-list
+