G_TVARSMK := tvars.mk
include ${G_LISTSMK}
+include ${G_VARSMK}
include packages.mk
-include targets.mk
-include ${G_VARSMK}
+include lib/${G_VARSMK}
+
+include targets.mk
# include all of the dir.mk
include lib/${G_DIRMK}
T_DIRNAME :=
-include ${CURDIR}${G_VARSMK}
-
include ${CURDIR}${G_LISTSMK}
include ${SRCSDIR_$P}${G_DIRMK}
+T_DIRNAME := lib
+
+################################################################################
+
+# top define
+DIRNAME := ${T_DIRNAME}
+D := ${DIRNAME}
+P := ${P_LIB}
+CURDIR := ${DIRNAME}/
+
+T_DIRNAME :=
+
+
CXX_$P := ${G_CXX}
CXXFLAGS_$P := ${G_CXXFLAGS} -fPIC
LIBS_$P := ${G_LIBSDL} ${G_LIBGL}
LNKFLAGS_$P := ${G_LNKFLAGS} -shared -Wl,-soname,${SONAME_$P}
TARGETTMP_$P := ${OBJSDIR_$P}${REALNAME_$P}
-TARGET_$P := ${WORKINGDIR_$P}${REALNAME_$P}
G_DEPS_LIB := deps-${G_LIB}
.PHONY: ${G_DEPS_LIB}
+TARGET_${G_LIB} := ${WORKINGDIR_${G_LIB}}${REALNAME_${G_LIB}}
+
+
G_TESTS := ${P_TESTS}
.PHONY: ${G_TESTS}
${G_OBJS_TESTS}: ${L_OBJS_$P}
${G_DEPS_TESTS}: ${L_DEPS_$P}
-# HACK
-tests/bind/libbear.so.0: lib/bind/libbear.so.0.0 | $${@D}
+# how to copy a library to the tests bin directory
+${WORKINGDIR_$P}${SONAME_${G_LIB}}: ${TARGET_${G_LIB}} | $${@D}
${cmd-cp}
# rule to make an object file from a .cpp
${G_TESTS}: ${TARGET_$D}
${G_TESTS}-${DIRNAME}: ${TARGET_$D}
-# HACK
-${TARGETTMP_$D}: tests/bind/libbear.so.0
+# this test depends on the G_LIB library
+${TARGETTMP_$D}: ${WORKINGDIR_$P}${SONAME_${G_LIB}}
# how to link the main target
${TARGETTMP_$D}: ${L_OBJS_$D} | $${@D}
${G_TESTS}: ${TARGET_$D}
${G_TESTS}-${DIRNAME}: ${TARGET_$D}
-# HACK
-${TARGETTMP_$D}: tests/bind/libbear.so.0
+# this test depends on the G_LIB library
+${TARGETTMP_$D}: ${WORKINGDIR_$P}${SONAME_${G_LIB}}
# how to link the main target
${TARGETTMP_$D}: ${L_OBJS_$D} | $${@D}