]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Fix sources_in_subdirectory test
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 12 Nov 2013 17:49:36 +0000 (18:49 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 12 Nov 2013 17:49:36 +0000 (18:49 +0100)
Note that handling in source files in subdirectories has changed. See
previous commit for details.

Now, all tests pass.

snippets/linux.omk
tests/libraries
tests/sources_in_subdirectory
tests/sources_in_subdirectory.files [deleted file]

index d69497c6583f039b2fcdeeb970468b093e8ed760..77e2856d4c81feec2f1f3680023214283e2bf5e6 100644 (file)
@@ -227,8 +227,8 @@ TARGET_GEN_SOURCES =  $(filter %.c,$($(1)_SERVER_IDL:%.idl=%-skels.c)) \
                       $(filter %.c,$($(1)_IDL:%.idl=%.c))
 TARGET_SOURCES = $($(1)_SOURCES) $(TARGET_GEN_SOURCES)
 TARGET_SOURCES_ABS = $($(1)_SOURCES:%=$(SOURCES_DIR)/%) $(TARGET_GEN_SOURCES)
-TARGET_OBJS  = $(sort $(addsuffix .o,$(basename $(TARGET_SOURCES))))
-TARGET_LOBJS = $(sort $(addsuffix .lo,$(basename $(TARGET_SOURCES))))
+TARGET_OBJS  = $(sort $(addsuffix .o,$(basename $(notdir $(TARGET_SOURCES)))))
+TARGET_LOBJS = $(sort $(addsuffix .lo,$(basename $(notdir $(TARGET_SOURCES)))))
 TARGET_IDLS = $($(1)_SERVER_IDL) $($(1)_CLIENT_IDL) $($(1)_IDL)
 LINK_WITH_CXX = $(filter %.cc,$(TARGET_SOURCES))$(filter %.cxx,$(TARGET_SOURCES))$$(filter %.cpp,$(TARGET_SOURCES))
 
index bbe0220bbae1c61f160df8b7be40f9b2e0ea89e6..3b7cb348ce52a74bcb632200c9d7402a87f4f006 100755 (executable)
@@ -34,4 +34,6 @@ test_LIBS = mylib
 EOF
 needs_valid_CC
 WVPASS make
-WVPASS test -f _compiled/lib/libmylib.a
+case $OMK_RULES in
+    linux) WVPASS test -f _compiled/lib/libmylib.a ;;
+esac
index 439dffb7a5c037350f0cad4289c2527eb5dc39c3..46bd6314680786ae859a2db9b478d5a22c8ec8ed 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-. ./functions.sh
+. ./wvtest.sh
 
 case $OMK_RULES in
     linux|sysless)
@@ -8,16 +8,18 @@ case $OMK_RULES in
     *) exit 0
 esac
 
-touch config.omk-default
+cat > 'Makefile.omk' <<EOF
+bin_PROGRAMS = x
+shared_LIBRARIES = x
+x_SOURCES = a.c dir1/b.c dir2/dir3/c.c
+EOF
+
+
 mkdir dir
 cd dir
-cp ../Makefile ../Makefile.omk . 
+cp ../Makefile ../Makefile.omk .
 mkdir -p dir1 dir2/dir3
 touch dir1/b.c dir2/dir3/c.c
-echo 'void main() {}' > a.c
-
-make CC=cc
-
-find ../_build -type d -name dir3 || error "dir3 not found"
+echo 'int main() { return 0; }' > a.c
 
-exit 0
+WVPASS make
diff --git a/tests/sources_in_subdirectory.files b/tests/sources_in_subdirectory.files
deleted file mode 100644 (file)
index 3962951..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-cat > 'Makefile.omk' <<EOF
-bin_PROGRAMS = x
-shared_LIBRARIES = x
-x_SOURCES = a.c dir1/b.c dir2/dir3/c.c
-EOF