# 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
${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" "$@"
${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}" "$@"
NEWDIRS := # := start; empty
NEWDIRS += 1/
-#NEWDIRS += printTrace/
+NEWDIRS += printTrace/
################################################################################
-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}
+
# 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})
--- /dev/null
+
+L_SRCS_$D :=
+L_OBJS_$D :=
+L_DEPS_$D :=
+
--- /dev/null
+
+${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 $< $@
+
--- /dev/null
+
+${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}
--- /dev/null
+
+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}
+
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})
-