]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Added documentatio and test of SOURCES_DIR variable.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 11 Mar 2008 16:49:00 +0000 (16:49 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 11 Mar 2008 16:49:00 +0000 (16:49 +0000)
darcs-hash:20080311164949-f2ef6-9a6499fad99abe0706a798839867e6b0af1ab431.gz

doc/omk-manual.texinfo
tests/sources_dir/Makefile [new file with mode: 0644]
tests/sources_dir/Makefile.omk [new file with mode: 0644]
tests/sources_dir/runtest [new file with mode: 0755]
tests/sources_dir/runtest.rules [new file with mode: 0644]
tests/sources_dir/test.h [new file with mode: 0644]

index 42a3b16dd67ef1dc44b3b82bcdd3ea674ef608b9..c40751f21a3353e86449772ff32d4207fc38d475 100644 (file)
@@ -792,6 +792,24 @@ locally in some @file{Makefile.omk}. In the latter case, it influences
 only subdirectories of the directory containing @file{Makefile.omk}.
 @end defvar
 
+@defvar{SOURCES_DIR}
+This variable is set internally by OMK and its value is the absolute
+path to the directory with compiled sources. It can be used if you need
+to refer to sources files in some custom constructs in
+@file{Makefile.omk}.
+@example
+@verbatim
+include_HEADERS = $(notdir $(wildcard $(SOURCES_DIR)/*.h))
+@end verbatim
+@end example
+@end defvar
+
+@defvar{MAKERULES_DIR}
+This variable is set internally by OMK and its value is the absolute
+path to the directory containing @file{Makefile.rules} currently used
+during compilation.
+@end defvar
+
 
 @node Properties of Specific Makefile.rules, Running OMK under Windows OS, Advanced OMK Features, OMK User's Manual
 @section Properties of Specific Makefile.rules
diff --git a/tests/sources_dir/Makefile b/tests/sources_dir/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/sources_dir/Makefile.omk b/tests/sources_dir/Makefile.omk
new file mode 100644 (file)
index 0000000..9aa9efe
--- /dev/null
@@ -0,0 +1 @@
+include_HEADERS = $(notdir $(wildcard $(SOURCES_DIR)/*.h))
diff --git a/tests/sources_dir/runtest b/tests/sources_dir/runtest
new file mode 100755 (executable)
index 0000000..ff6f2af
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+. ../functions.sh
+
+touch config.omk-default
+make include-pass
+test -n $(find _compiled -name test.h)
diff --git a/tests/sources_dir/runtest.rules b/tests/sources_dir/runtest.rules
new file mode 100644 (file)
index 0000000..cfb1354
--- /dev/null
@@ -0,0 +1 @@
+snip:include
diff --git a/tests/sources_dir/test.h b/tests/sources_dir/test.h
new file mode 100644 (file)
index 0000000..e69de29