T :=
CURDIR_$D := ${CURDIR}
-CURDIR := ${CURDIR_$D}${DIRNAME}/
+CURDIR := ${CURDIR_$D}/${DIRNAME}
DIRNAME := ${T_DIRNAME}
D := ${DIRNAME}
P := ${P_LIB}
-CURDIR := ${DIRNAME}/
+CURDIR := ${DIRNAME}
T_DIRNAME :=
-include ${CURDIR}${G_LISTSMK}
+include ${CURDIR}/${G_LISTSMK}
-include ${SRCSDIR_$P}${G_DIRMK}
+include ${SRCSDIR_$P}/${G_DIRMK}
-include ${CURDIR}${G_TVARSMK}
+include ${CURDIR}/${G_TVARSMK}
-include ${CURDIR}${G_RULESMK}
+include ${CURDIR}/${G_RULESMK}
${L_BLDDIRS_$P}: | $${@D}
T_DIRNAME :=
-include ${CURDIR}${G_FILESMK}
+include ${CURDIR}/${G_FILESMK}
include $(addsuffix /${G_DIRMK},${NEWDIRS})
################################################################################
-NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS})
-NEWDIRS := $(addprefix ${CURDIR},${NEWDIRS})
+NEWSRCS := $(addprefix ${CURDIR}/,${NEWSRCS})
+NEWDIRS := $(addprefix ${CURDIR}/,${NEWDIRS})
# Append to lists
T_DIRNAME :=
-include ${CURDIR}${G_FILESMK}
+include ${CURDIR}/${G_FILESMK}
include $(addsuffix /${G_DIRMK},${NEWDIRS})
################################################################################
-NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS})
-NEWDIRS := $(addprefix ${CURDIR},${NEWDIRS})
+NEWSRCS := $(addprefix ${CURDIR}/,${NEWSRCS})
+NEWDIRS := $(addprefix ${CURDIR}/,${NEWDIRS})
# Append to lists
DIRNAME := ${T_DIRNAME}
D := ${DIRNAME}
P := ${P_LIB}
-CURDIR := ${DIRNAME}/
+CURDIR := ${DIRNAME}
T_DIRNAME :=
CXXFLAGS_$P := ${G_CXXFLAGS} -fPIC
LIBS_$P := ${G_LIBSDL} ${G_LIBGL}
-SRCSDIR_$P := ${CURDIR}${G_SRCSDIR}
-DEPSDIR_$P := ${CURDIR}${G_DEPSDIR}
-OBJSDIR_$P := ${CURDIR}${G_OBJSDIR}
-BINDIR_$P := ${CURDIR}${G_BINDIR}
+SRCSDIR_$P := ${CURDIR}/${G_SRCSDIR}
+DEPSDIR_$P := ${CURDIR}/${G_DEPSDIR}
+OBJSDIR_$P := ${CURDIR}/${G_OBJSDIR}
+BINDIR_$P := ${CURDIR}/${G_BINDIR}
-T_INCDIRS_$P := ${SRCSDIR_$P} ${CURDIR}include/bear/
+T_INCDIRS_$P := ${SRCSDIR_$P} ${CURDIR}/include/bear
INCFLAGS_$P := $(addprefix -I, ${T_INCDIRS_$P})
T_INCDIRS_$P :=
LNKFLAGS_$P := ${G_LNKFLAGS} -shared -Wl,-soname,${SONAME_$P}
-TARGETTMP_$P := ${OBJSDIR_$P}${REALNAME_$P}
+TARGETTMP_$P := ${OBJSDIR_$P}/${REALNAME_$P}
G_DEPS_LIB := deps-${G_LIB}
.PHONY: ${G_DEPS_LIB}
-TARGET_${G_LIB} := ${BINDIR_${G_LIB}}${REALNAME_${G_LIB}}
+TARGET_${G_LIB} := ${BINDIR_${G_LIB}}/${REALNAME_${G_LIB}}
G_TESTS := ${P_TESTS}
DIRNAME := ${T_DIRNAME}
D := ${DIRNAME}
P := ${P_TESTS}
-CURDIR := ${DIRNAME}/
+CURDIR := ${DIRNAME}
T_DIRNAME :=
-include ${CURDIR}${G_VARSMK}
+include ${CURDIR}/${G_VARSMK}
-include ${CURDIR}${G_LISTSMK}
+include ${CURDIR}/${G_LISTSMK}
-include ${SRCSDIR_$P}${G_DIRMK}
+include ${SRCSDIR_$P}/${G_DIRMK}
-include ${CURDIR}${G_TVARSMK}
+include ${CURDIR}/${G_TVARSMK}
-include ${CURDIR}${G_RULESMK}
+include ${CURDIR}/${G_RULESMK}
${L_BLDDIRS_$P}: | $${@D}
${G_DEPS_TESTS}: ${L_DEPS_$P}
# how to copy a library to the tests bin directory
-${BINDIR_$P}${SONAME_${G_LIB}}: ${TARGET_${G_LIB}} | $${@D}
+${BINDIR_$P}/${SONAME_${G_LIB}}: ${TARGET_${G_LIB}} | $${@D}
${cmd-cp}
# rule to make an object file from a .cpp
T_DIRNAME :=
-include ${CURDIR}${G_VARSMK}
+include ${CURDIR}/${G_VARSMK}
-include ${CURDIR}${G_LISTSMK}
+include ${CURDIR}/${G_LISTSMK}
-include ${CURDIR}${G_FILESMK}
+include ${CURDIR}/${G_FILESMK}
include $(addsuffix /${G_DIRMK},${NEWDIRS})
L_OBJS_$P += ${L_OBJS_$D}
L_DEPS_$P += ${L_DEPS_$D}
-include ${CURDIR}${G_TVARSMK}
+include ${CURDIR}/${G_TVARSMK}
-include ${CURDIR}${G_RULESMK}
+include ${CURDIR}/${G_RULESMK}
include ${F_STACKPOP}
################################################################################
-NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS})
-NEWDIRS := $(addprefix ${CURDIR},${NEWDIRS})
+NEWSRCS := $(addprefix ${CURDIR}/,${NEWSRCS})
+NEWDIRS := $(addprefix ${CURDIR}/,${NEWDIRS})
# Append to lists
${G_TESTS}-${DIRNAME}: ${TARGET_$D}
# this test depends on the G_LIB library
-${TARGETTMP_$D}: ${BINDIR_$P}${SONAME_${G_LIB}}
+${TARGETTMP_$D}: ${BINDIR_$P}/${SONAME_${G_LIB}}
# how to link the main target
${TARGETTMP_$D}: ${L_OBJS_$D} | $${@D}
LIBS_$D := ${LIBS_$P}
TARGETNAME_$D := ${TARGETPRE_$P}${DIRNAME}
-TARGETTMP_$D := ${OBJSDIR_$P}${TARGETNAME_$D}
-TARGET_$D := ${BINDIR_$P}${TARGETNAME_$D}
+TARGETTMP_$D := ${OBJSDIR_$P}/${TARGETNAME_$D}
+TARGET_$D := ${BINDIR_$P}/${TARGETNAME_$D}
T_DIRNAME :=
-include ${CURDIR}${G_FILESMK}
+include ${CURDIR}/${G_FILESMK}
include $(addsuffix /${G_DIRMK},${NEWDIRS})
################################################################################
-NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS})
-NEWDIRS := $(addprefix ${CURDIR},${NEWDIRS})
+NEWSRCS := $(addprefix ${CURDIR}/,${NEWSRCS})
+NEWDIRS := $(addprefix ${CURDIR}/,${NEWDIRS})
# Append to lists
T_DIRNAME :=
-include ${CURDIR}${G_VARSMK}
+include ${CURDIR}/${G_VARSMK}
-include ${CURDIR}${G_LISTSMK}
+include ${CURDIR}/${G_LISTSMK}
-include ${CURDIR}${G_FILESMK}
+include ${CURDIR}/${G_FILESMK}
-include $(addsuffix ${G_DIRMK},${NEWDIRS})
+include $(addsuffix /${G_DIRMK},${NEWDIRS})
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_TVARSMK}
-include ${CURDIR}${G_RULESMK}
+include ${CURDIR}/${G_RULESMK}
include ${F_STACKPOP}
################################################################################
-NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS})
-NEWDIRS := $(addprefix ${CURDIR},${NEWDIRS})
+NEWSRCS := $(addprefix ${CURDIR}/,${NEWSRCS})
+NEWDIRS := $(addprefix ${CURDIR}/,${NEWDIRS})
# Append to lists
${G_TESTS}-${DIRNAME}: ${TARGET_$D}
# this test depends on the G_LIB library
-${TARGETTMP_$D}: ${BINDIR_$P}${SONAME_${G_LIB}}
+${TARGETTMP_$D}: ${BINDIR_$P}/${SONAME_${G_LIB}}
# how to link the main target
${TARGETTMP_$D}: ${L_OBJS_$D} | $${@D}
LIBS_$D := ${LIBS_$P}
TARGETNAME_$D := ${TARGETPRE_$P}${DIRNAME}
-TARGETTMP_$D := ${OBJSDIR_$P}${TARGETNAME_$D}
-TARGET_$D := ${BINDIR_$P}${TARGETNAME_$D}
+TARGETTMP_$D := ${OBJSDIR_$P}/${TARGETNAME_$D}
+TARGET_$D := ${BINDIR_$P}/${TARGETNAME_$D}
LNKFLAGS_$P := ${G_LNKFLAGS} -Wl,-rpath,./ -rdynamic
LIBS_$P := ${G_LIBSDL} ${G_LIBGL}
-SRCSDIR_$P := ${CURDIR}${G_SRCSDIR}
-DEPSDIR_$P := ${CURDIR}${G_DEPSDIR}
-OBJSDIR_$P := ${CURDIR}${G_OBJSDIR}
-BINDIR_$P := ${CURDIR}${G_BINDIR}
+SRCSDIR_$P := ${CURDIR}/${G_SRCSDIR}
+DEPSDIR_$P := ${CURDIR}/${G_DEPSDIR}
+OBJSDIR_$P := ${CURDIR}/${G_OBJSDIR}
+BINDIR_$P := ${CURDIR}/${G_BINDIR}
# HACK
-T_INCDIRS_$P := lib/include/
+T_INCDIRS_$P := lib/include
INCFLAGS_$P := $(addprefix -I, ${T_INCDIRS_$P})
T_INCDIRS_$P := # empty
G_LIBSDL := `sdl-config --libs`
endif
-G_SRCSDIR := src/
-G_DEPSDIR := deps/
+G_SRCSDIR := src
+G_DEPSDIR := deps
ifeq (${G_BUILD},${B_DEBUG})
- G_OBJSDIR := objsd/
- G_BINDIR := bind/
+ G_OBJSDIR := objsd
+ G_BINDIR := bind
else
ifeq (${G_BUILD},${B_FINAL})
- G_OBJSDIR := objs/
- G_BINDIR := bin/
+ G_OBJSDIR := objs
+ G_BINDIR := bin
else
ifeq (${G_BUILD},${B_WIN32})
- G_OBJSDIR := objs-mingw32/
- G_BINDIR := bin-mingw32/
+ G_OBJSDIR := objs-mingw32
+ G_BINDIR := bin-mingw32
else
$(error 'G_BUILD = ${G_BUILD}' is invalid.)
endif