]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Fixed bug, when links to header files were created even if headers did not exist.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 18 Mar 2008 16:02:00 +0000 (16:02 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 18 Mar 2008 16:02:00 +0000 (16:02 +0000)
darcs-hash:20080318160206-f2ef6-c2f527f11facc439c5603ee9dafbc06c86117099.gz

snippets/include
tests/headers/nonexising/Makefile [new file with mode: 0644]
tests/headers/nonexising/Makefile.omk [new file with mode: 0644]
tests/headers/nonexising/config.omk [new file with mode: 0644]
tests/headers/nonexising/runtest [new file with mode: 0755]
tests/headers/nonexising/runtest.rules [new file with mode: 0644]

index 6062579acfcf2f66a2c1f1862f38b6b962382519..c611dc0b53098b219b5c3792a72a804a464e2e98 100644 (file)
@@ -10,7 +10,7 @@ define cp_cmd
 endef
 else
 define cp_cmd
-( echo "  LN      $(1:$(MAKERULES_DIR)/%=%) -> $(2:$(MAKERULES_DIR)/%=%)"; ln -sf $(LNHEADER_FLAGS) $(1) $(2) )
+( echo "  LN      $(1:$(MAKERULES_DIR)/%=%) -> $(2:$(MAKERULES_DIR)/%=%)"; [ -f $(1) ] && ln -sf $(LNHEADER_FLAGS) $(1) $(2) )
 endef
 endif
 
diff --git a/tests/headers/nonexising/Makefile b/tests/headers/nonexising/Makefile
new file mode 100644 (file)
index 0000000..f595272
--- /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/headers/nonexising/Makefile.omk b/tests/headers/nonexising/Makefile.omk
new file mode 100644 (file)
index 0000000..36eedde
--- /dev/null
@@ -0,0 +1 @@
+include_HEADERS = nonexising.h
diff --git a/tests/headers/nonexising/config.omk b/tests/headers/nonexising/config.omk
new file mode 100644 (file)
index 0000000..11dc6d5
--- /dev/null
@@ -0,0 +1 @@
+LN_HEADERS=y
diff --git a/tests/headers/nonexising/runtest b/tests/headers/nonexising/runtest
new file mode 100755 (executable)
index 0000000..3b7b517
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+source ../../functions.sh
+
+touch config.omk-default
+make || exit 0 # It is OK to fail because of missing header file
+
+find _compiled | grep nonexising.h && error "Link to nonexisting header file creaed."
diff --git a/tests/headers/nonexising/runtest.rules b/tests/headers/nonexising/runtest.rules
new file mode 100644 (file)
index 0000000..cfb1354
--- /dev/null
@@ -0,0 +1 @@
+snip:include