summaryrefslogtreecommitdiff
path: root/examples/hello_cxxlib
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hello_cxxlib')
-rw-r--r--examples/hello_cxxlib/cxxlib/Makefile3
-rw-r--r--examples/hello_cxxlib/cxxlib/dummy.c6
-rw-r--r--examples/hello_cxxlib/cxxlib/linkme.mk6
-rw-r--r--examples/hello_cxxlib/expect.out15
-rw-r--r--examples/hello_cxxlib/test.mk3
5 files changed, 29 insertions, 4 deletions
diff --git a/examples/hello_cxxlib/cxxlib/Makefile b/examples/hello_cxxlib/cxxlib/Makefile
index a9f974a..540eb02 100644
--- a/examples/hello_cxxlib/cxxlib/Makefile
+++ b/examples/hello_cxxlib/cxxlib/Makefile
@@ -12,4 +12,7 @@ INCSSRCDIR = include
SRCS = hello_msg1.cpp hello_msg2.cpp
+MKC_SOURCE_FUNCLIBS = dummy # a part of regression test
+MKC_SOURCE_DIR.dummy.c := ${.PARSEDIR}
+
.include <mkc.lib.mk>
diff --git a/examples/hello_cxxlib/cxxlib/dummy.c b/examples/hello_cxxlib/cxxlib/dummy.c
new file mode 100644
index 0000000..a30fafb
--- /dev/null
+++ b/examples/hello_cxxlib/cxxlib/dummy.c
@@ -0,0 +1,6 @@
+/* we do use this function, this is just a part of regression test */
+void dummy_func (void);
+void dummy_func (void)
+{
+ /* we do nothing here */
+}
diff --git a/examples/hello_cxxlib/cxxlib/linkme.mk b/examples/hello_cxxlib/cxxlib/linkme.mk
index 85b9277..20864c9 100644
--- a/examples/hello_cxxlib/cxxlib/linkme.mk
+++ b/examples/hello_cxxlib/cxxlib/linkme.mk
@@ -1,5 +1,5 @@
-PATH.cxxlib := ${.PARSEDIR}
+PATH.cxxlib := ${.PARSEDIR:tA}
-CPPFLAGS += -I${PATH.cxxlib}/include
+DPINCDIRS += ${PATH.cxxlib}/include
DPLIBDIRS += ${PATH.cxxlib}
-LDADD0 += -lcxxlib
+DPLDADD += cxxlib
diff --git a/examples/hello_cxxlib/expect.out b/examples/hello_cxxlib/expect.out
index e961c75..09dc8a7 100644
--- a/examples/hello_cxxlib/expect.out
+++ b/examples/hello_cxxlib/expect.out
@@ -2,8 +2,13 @@ Hello world 1!
hello world 2!
=========== all ============
/objdir/Makefile
+/objdir/_mkc_compiler_type.err
+/objdir/_mkc_compiler_type.res
/objdir/_mkc_cxx_type.err
/objdir/_mkc_cxx_type.res
+/objdir/_mkc_funclib_dummy.c
+/objdir/_mkc_funclib_dummy.err
+/objdir/_mkc_funclib_dummy.res
/objdir/_mkc_prog_cxx.err
/objdir/_mkc_prog_cxx.res
/objdir/cxxapp/Makefile
@@ -11,6 +16,9 @@ hello world 2!
/objdir/cxxapp/cxxapp.cc
/objdir/cxxapp/cxxapp.o
/objdir/cxxlib/Makefile
+/objdir/cxxlib/dummy.c
+/objdir/cxxlib/dummy.o
+/objdir/cxxlib/dummy.os
/objdir/cxxlib/hello_msg1.cpp
/objdir/cxxlib/hello_msg1.o
/objdir/cxxlib/hello_msg1.os
@@ -43,13 +51,19 @@ hello world 2!
======== uninstall =========
========== clean ===========
/objdir/Makefile
+/objdir/_mkc_compiler_type.err
+/objdir/_mkc_compiler_type.res
/objdir/_mkc_cxx_type.err
/objdir/_mkc_cxx_type.res
+/objdir/_mkc_funclib_dummy.c
+/objdir/_mkc_funclib_dummy.err
+/objdir/_mkc_funclib_dummy.res
/objdir/_mkc_prog_cxx.err
/objdir/_mkc_prog_cxx.res
/objdir/cxxapp/Makefile
/objdir/cxxapp/cxxapp.cc
/objdir/cxxlib/Makefile
+/objdir/cxxlib/dummy.c
/objdir/cxxlib/hello_msg1.cpp
/objdir/cxxlib/hello_msg2.cpp
/objdir/cxxlib/include/hello_msg.h
@@ -64,6 +78,7 @@ hello world 2!
/objdir/cxxapp/Makefile
/objdir/cxxapp/cxxapp.cc
/objdir/cxxlib/Makefile
+/objdir/cxxlib/dummy.c
/objdir/cxxlib/hello_msg1.cpp
/objdir/cxxlib/hello_msg2.cpp
/objdir/cxxlib/include/hello_msg.h
diff --git a/examples/hello_cxxlib/test.mk b/examples/hello_cxxlib/test.mk
index ce5dd80..96b2a2b 100644
--- a/examples/hello_cxxlib/test.mk
+++ b/examples/hello_cxxlib/test.mk
@@ -5,7 +5,8 @@ test_output:
rm -rf ${.OBJDIR}${PREFIX}; \
LD_LIBRARY_PATH=${.CURDIR}/cxxlib:$$LD_LIBRARY_PATH; \
DYLD_LIBRARY_PATH=${.CURDIR}/cxxlib:$$LD_LIBRARY_PATH; \
- export LD_LIBRARY_PATH DYLD_LIBRARY_PATH; \
+ LIBRARY_PATH=$$LIBRARY_PATH:$$LD_LIBRARY_PATH; \
+ export LD_LIBRARY_PATH DYLD_LIBRARY_PATH LIBRARY_PATH; \
${.CURDIR}/cxxapp/cxxapp; \
\
echo =========== all ============; \