]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Fix generation of test files included in the documentation
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 12 Nov 2013 20:58:39 +0000 (21:58 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 12 Nov 2013 20:58:39 +0000 (21:58 +0100)
doc/Makefile
doc/omk-manual.texinfo
tests/default-config
tests/libraries
tests/programs

index 81db85f5bb07bc9949f3e7316fd10b605359df51..c249be45fe07709070f9ddf243faf4fdb8e4d90c 100644 (file)
@@ -20,10 +20,10 @@ tests/default-config/config.omk-correct
 
 tests/%: DIR=$(shell echo $@|sed -e 's,\([^/]*/[^/]*\)/.*,\1,')
 tests/%:
-       rm -rf $(DIR) && \
-       mkdir -p $(DIR) && \
-       cd $(DIR) && \
-       sh ../../../$(DIR).files
+       rm -rf $(DIR)
+       mkdir -p $(DIR)
+       echo 'WVSTART() { if [ "$$WV" ]; then exit; else WV=1; fi; }; WVPASS() { :; }; needs_valid_CC() { :; }; omkize() { :; }' > $(DIR)/wvtest.sh
+       cd $(DIR) && ../../../$(DIR)
 
 %.pdf: %.png
        convert $< -density 150 $@
index 93604efa02b1c5e3cb117162b6a0db61e994b768..16680435fbbce04628615a9b29ca2f14e474641a 100644 (file)
@@ -428,7 +428,7 @@ by other programs.
 @subsection Header Files
 
 C and C++ libraries are not very useful without header files. OMK
-provides several variables that controls operations with header files.
+provides several variables that control operations with header files.
 
 During compilation, header files are copied (or linked by symbolic
 links) from source directories to the @file{_compiled} tree (see
index f5eacf7efd3d41bb5329f32f2d08fdb5abe752c4..21a4074e2d1886486176ba915f40687d942e77e2 100755 (executable)
@@ -2,14 +2,14 @@
 
 . ./wvtest.sh
 
-cat > 'Makefile.omk' <<EOF     # This file is included into OMK manual
+cat > 'Makefile.omk' <<EOF     # OMK manual includes this file - do not modify it
 default_CONFIG = CONFIG_DEBUG=y CONFIG_SLOW=n
 default_CONFIG += CONFIG_NUM=123 CONFIG_ARCH=arm
 default_CONFIG += CONFIG_QUOTES="Text+quotes"
 
 SUBDIRS=subdir
 EOF
-cat > 'config.omk-correct' <<EOF
+cat > 'config.omk-correct' <<EOF # OMK manual includes this file
 # Start of OMK config file
 # This file should not be altered manually
 # Overrides should be stored in file config.omk
@@ -24,8 +24,12 @@ CONFIG_NUM=123
 CONFIG_ARCH=arm
 CONFIG_QUOTES="Text+quotes"
 EOF
-mkdir 'subdir'
-echo 'default_CONFIG = CONFIG_SUBDIR=y CONFIG_DEBUG=x' > 'subdir/Makefile.omk'
+
+mkdir subdir
+cat > 'subdir/Makefile.omk' <<EOF
+default_CONFIG = CONFIG_SUBDIR=y CONFIG_DEBUG=x
+EOF
+
 omkize
 WVPASS make
 WVPASS diff -u config.omk-correct config.omk-default
index 3b7cb348ce52a74bcb632200c9d7402a87f4f006..fb73255013ec303b1ba436c915ffae6de6c162be 100755 (executable)
@@ -15,7 +15,14 @@ cat > 'mylib.h' <<EOF
 int funca(int a);
 int funcb(int b);
 EOF
-cat > 'test.c' <<EOF
+cat > 'Makefile.omk' <<EOF # OMK manual includes this file - do not modify it
+lib_LIBRARIES = mylib
+mylib_SOURCES = funca.c funcb.c
+include_HEADERS = mylib.h
+EOF
+
+mkdir app
+cat > app/main.c <<EOF
 #include <mylib.h>
 int main() {
   funca(10);
@@ -23,17 +30,15 @@ int main() {
   return 0;
 }
 EOF
-cat > 'Makefile.omk' <<EOF
-lib_LIBRARIES = mylib
-mylib_SOURCES = funca.c funcb.c
-include_HEADERS = mylib.h
-
-bin_PROGRAMS = test
-test_SOURCES = test.c
-test_LIBS = mylib
+cat > app/Makefile.omk <<EOF # OMK manual includes this file - do not modify it
+bin_PROGRAMS = libtest
+libtest_SOURCES = main.c
+libtest_LIBS = mylib
 EOF
+
 needs_valid_CC
 WVPASS make
 case $OMK_RULES in
     linux) WVPASS test -f _compiled/lib/libmylib.a ;;
 esac
+WVPASS make -C app
index 76a907629b99b82d93926cf9f47aca53e438bf92..ad5e04257c4a56090ac607a3826157a55bd2adea 100755 (executable)
@@ -7,7 +7,7 @@ WVSTART "Compile a single source C program"
 cat > 'test.c' <<'EOF'
 int main() { return 0; }
 EOF
-cat > 'Makefile.omk' <<'EOF'
+cat > 'Makefile.omk' <<'EOF' # OMK manual includes this file - do not modify it
 bin_PROGRAMS = test
 test_SOURCES = test.c
 EOF