tests now depend on the lib binary, printTrace setup
authorPatrik Gornicz <Gornicz.P@gmail.com>
Sat, 13 Jun 2009 16:44:43 +0000 (12:44 -0400)
committerPatrik Gornicz <Gornicz.P@gmail.com>
Sat, 13 Jun 2009 16:44:43 +0000 (12:44 -0400)
Makefile
tests/rules.mk
tests/src/1/rules.mk
tests/src/files.mk
tests/src/printTrace/dir.mk
tests/src/printTrace/files.mk
tests/src/printTrace/lists.mk [new file with mode: 0644]
tests/src/printTrace/rules.mk [new file with mode: 0644]
tests/src/printTrace/tvars.mk [new file with mode: 0644]
tests/src/printTrace/vars.mk [new file with mode: 0644]
tests/vars.mk

index 4ea0517..7b8d452 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,13 +7,13 @@ BUILD    := DEBUG
 
 # The first and therefor default rule
 # targets append themselves to this to be built by all
-.PHONY: all
-all:
+.PHONY: default
+default:
 
 # Include the variables that describe targets
 include targets.mk
 
-all: ${G_LIB}
+default: ${G_LIB}
 
 
 G_DIRMK   := dir.mk
index 9a41581..b85e0d8 100644 (file)
@@ -2,6 +2,11 @@
 ${G_TESTS_OBJS}: ${L_OBJS_$P}
 ${G_TESTS_DEPS}: ${L_DEPS_$P}
 
+# HACK
+tests/bind/libbear.so.0: lib/bind/libbear.so.0.0 | $${@D}
+       ${Q1}${PRNTFMT} "cp" "$@"
+       ${Q2}cp $< $@
+
 # how to make a directory
 ${L_BLDDIRS_$P}:
        ${Q1}${PRNTFMT} "mkdir" "$@"
index 09d497f..41ba298 100644 (file)
@@ -1,6 +1,9 @@
 
 ${G_TESTS}: ${TARGET_$D}
 
+# HACK
+${TARGETTMP_$D}: tests/bind/libbear.so.0
+
 # how to link the main target
 ${TARGETTMP_$D}: ${L_OBJS_$D} | $${@D}
        ${Q1}${PRNTFMT} "${CXX}" "$@"
index 92433f2..527718d 100644 (file)
@@ -3,7 +3,7 @@ NEWSRCS := # := start; empty
 
 NEWDIRS := # := start; empty
 NEWDIRS += 1/
-#NEWDIRS += printTrace/
+NEWDIRS += printTrace/
 
 
 ################################################################################
index 8b877df..d4abc31 100644 (file)
@@ -1,6 +1,25 @@
 
-CURDIR  := test/src/printTrace/
+D       := tests_src_printTrace
+CURDIR  := tests/src/printTrace/
 SRCPATH := printTrace/
 
-include ${CURDIR}${FILESMK}
-include $(addprefix ${SRCSDIR},$(addsuffix ${DIRMK},${NEWDIRS}))
+include ${CURDIR}${G_VARSMK}
+
+include ${CURDIR}${G_LISTSMK}
+
+include ${CURDIR}${G_FILESMK}
+
+include $(addprefix ${SRCSDIR_$P},$(addsuffix ${G_DIRMK},${NEWDIRS}))
+
+# restore
+CURDIR  := tests/src/printTrace/
+SRCPATH := printTrace/
+
+L_SRCS_$P += ${L_SRCS_$D}
+L_OBJS_$P += ${L_OBJS_$D}
+L_DEPS_$P += ${L_DEPS_$D}
+
+include ${CURDIR}${G_TVARSMK}
+
+include ${CURDIR}${G_RULESMK}
+
index 9a3c438..40c479a 100644 (file)
@@ -13,10 +13,10 @@ NEWDEPS := ${NEWSRCS:.cpp=.d}
 
 # Append to lists
 
-SRCS    += ${NEWSRCS}
-OBJS    += $(addprefix ${OBJSDIR},${NEWOBJS})
-DEPS    += $(addprefix ${DEPSDIR},${NEWDEPS})
+L_SRCS_$D    += ${NEWSRCS}
+L_OBJS_$D    += $(addprefix ${OBJSDIR_$P},${NEWOBJS})
+L_DEPS_$D    += $(addprefix ${DEPSDIR_$P},${NEWDEPS})
 
-BLDDIRS += $(addprefix ${OBJSDIR},${NEWDIRS})
-BLDDIRS += $(addprefix ${DEPSDIR},${NEWDIRS})
+L_BLDDIRS_$P += $(addprefix ${OBJSDIR_$P},${NEWDIRS})
+L_BLDDIRS_$P += $(addprefix ${DEPSDIR_$P},${NEWDIRS})
 
diff --git a/tests/src/printTrace/lists.mk b/tests/src/printTrace/lists.mk
new file mode 100644 (file)
index 0000000..c6f716a
--- /dev/null
@@ -0,0 +1,5 @@
+
+L_SRCS_$D :=
+L_OBJS_$D :=
+L_DEPS_$D :=
+
diff --git a/tests/src/printTrace/rules.mk b/tests/src/printTrace/rules.mk
new file mode 100644 (file)
index 0000000..41ba298
--- /dev/null
@@ -0,0 +1,16 @@
+
+${G_TESTS}: ${TARGET_$D}
+
+# HACK
+${TARGETTMP_$D}: tests/bind/libbear.so.0
+
+# how to link the main target
+${TARGETTMP_$D}: ${L_OBJS_$D} | $${@D}
+       ${Q1}${PRNTFMT} "${CXX}" "$@"
+       ${Q2}${CXX} ${CXXFLAGS} ${LNKFLAGS} -o $@ $^ ${LIBS}
+
+# rule to copy tmp target to working directory
+${TARGET_$D}: ${TARGETTMP_$D} | $${@D}
+       ${Q1}${PRNTFMT} "cp" "$@"
+       ${Q2}cp $< $@
+
diff --git a/tests/src/printTrace/tvars.mk b/tests/src/printTrace/tvars.mk
new file mode 100644 (file)
index 0000000..cda0e6f
--- /dev/null
@@ -0,0 +1,7 @@
+
+${TARGETTMP_$D}: CXX      := ${CXX_$D}
+${TARGETTMP_$D}: CXXFLAGS := ${CXXFLAGS_$D}
+${TARGETTMP_$D}: LNKFLAGS := ${LNKFLAGS_$D}
+${TARGETTMP_$D}: LIBS     := ${LIBS_$D}
+
+$P-clean:       TARGET      := ${TARGET_$D}
diff --git a/tests/src/printTrace/vars.mk b/tests/src/printTrace/vars.mk
new file mode 100644 (file)
index 0000000..0976191
--- /dev/null
@@ -0,0 +1,10 @@
+
+CXX_$D      := ${CXX_$P}
+CXXFLAGS_$D := ${CXXFLAGS_$P}
+LNKFLAGS_$D := ${LNKFLAGS_$P}
+LIBS_$D     := ${LIBS_$P}
+
+TARGETNAME_$D  := test-printTrace
+TARGETTMP_$D   := ${OBJSDIR_$P}${TARGETNAME_$D}
+TARGET_$D      := ${WORKINGDIR_$P}${TARGETNAME_$D}
+
index 4d9e0cf..bbf1a07 100644 (file)
@@ -43,10 +43,3 @@ else
 endif
 endif
 
-SRCLIBSDIR_$P  := ${CURDIR}libs/
-DSTLIBSDIR_$P  := ${WORKINGDIR_$P}
-
-LIBSCPY_$P := # := start
-LIBSCPY_$P += libbear.so.0
-LIBSCPY_$P := $(addprefix ${DSTLIBSDIR_$P},${LIBSCPY_$P})
-