From: Michal Sojka Date: Sun, 27 Jan 2008 15:42:00 +0000 (+0000) Subject: VPATH variable completely removed from rules. X-Git-Tag: v0.1~39 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/omk.git/commitdiff_plain/0cc516470ccdcb2cef9f47f7bd5d56b27e5ba724 VPATH variable completely removed from rules. 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 --- diff --git a/snippets/base b/snippets/base index 2f0e5cc..121112c 100644 --- a/snippets/base +++ b/snippets/base @@ -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 index 0000000..aa6b442 --- /dev/null +++ b/tests/no_vpath/Makefile @@ -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 index 0000000..4180d66 --- /dev/null +++ b/tests/no_vpath/Makefile.omk @@ -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 index 0000000..e69de29 diff --git a/tests/no_vpath/file.c b/tests/no_vpath/file.c new file mode 100644 index 0000000..dde2c3a --- /dev/null +++ b/tests/no_vpath/file.c @@ -0,0 +1,5 @@ +#include + +void main() +{ +} diff --git a/tests/no_vpath/file.o b/tests/no_vpath/file.o new file mode 100644 index 0000000..e69de29 diff --git a/tests/no_vpath/runtest b/tests/no_vpath/runtest new file mode 100755 index 0000000..4778516 --- /dev/null +++ b/tests/no_vpath/runtest @@ -0,0 +1,5 @@ +#!/bin/sh + +. ../functions.sh + +make || error ".o files should not be searched in SOURCES_DIR"