]> rtime.felk.cvut.cz Git - omk.git/commitdiff
VPATH variable completely removed from rules.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 27 Jan 2008 15:42:00 +0000 (15:42 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 27 Jan 2008 15:42:00 +0000 (15:42 +0000)
If the VPATH variable was set to SOURCES_DIR, it caused problems, when
there were .o files in SOURCES_DIR. OMK thoughts the prerequisites
existed and link command failed, because no .o file were found in
_build tree. This behavior was problematic if OMK was used in
projects with multiple make systems.

darcs-hash:20080127154245-f2ef6-69dbb419870250dfc8c8dfabe81e805e80145eb5.gz

snippets/base
tests/no_vpath/Makefile [new file with mode: 0644]
tests/no_vpath/Makefile.omk [new file with mode: 0644]
tests/no_vpath/config.omk-default [new file with mode: 0644]
tests/no_vpath/file.c [new file with mode: 0644]
tests/no_vpath/file.o [new file with mode: 0644]
tests/no_vpath/runtest [new file with mode: 0755]

index 2f0e5cc816474e0ef1565f1da86b2c7349dce309..121112cb3e1aa33654abf23f58c2dcd24e1fc2d5 100644 (file)
@@ -88,9 +88,6 @@ override RELATIVE_PREFIX := $(RELATIVE_PREFIX:/%=%)
 #vpath %.cc $(SOURCES_DIR)
 #vpath %.cxx $(SOURCES_DIR)
 
-VPATH = $(SOURCES_DIR)
-srcdir = $(SOURCES_DIR)
-
 # Defines for quiet compilation
 ifdef V
   ifeq ("$(origin V)", "command line")
diff --git a/tests/no_vpath/Makefile b/tests/no_vpath/Makefile
new file mode 100644 (file)
index 0000000..aa6b442
--- /dev/null
@@ -0,0 +1,16 @@
+# 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
+
+print_vars:
+       echo $(COMPILED_DIR)
\ No newline at end of file
diff --git a/tests/no_vpath/Makefile.omk b/tests/no_vpath/Makefile.omk
new file mode 100644 (file)
index 0000000..4180d66
--- /dev/null
@@ -0,0 +1,4 @@
+bin_PROGRAMS = prg
+
+prg_SOURCES = file.c
+
diff --git a/tests/no_vpath/config.omk-default b/tests/no_vpath/config.omk-default
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/no_vpath/file.c b/tests/no_vpath/file.c
new file mode 100644 (file)
index 0000000..dde2c3a
--- /dev/null
@@ -0,0 +1,5 @@
+#include <stdio.h>
+
+void main()
+{
+}
diff --git a/tests/no_vpath/file.o b/tests/no_vpath/file.o
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/no_vpath/runtest b/tests/no_vpath/runtest
new file mode 100755 (executable)
index 0000000..4778516
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+. ../functions.sh
+
+make || error ".o files should not be searched in SOURCES_DIR"