# set this on the command line to get a WIN32 or a FINAL build
-BUILD := DEBUG
+BUILD := DEBUG
# cause the fancy $${@D} directory rules to work out
.SECONDEXPANSION:
include targets.mk
-G_DIRMK := dir.mk
-G_VARSMK := vars.mk
-G_FILESMK := files.mk
-G_RULESMK := rules.mk
-G_LISTSMK := lists.mk
-G_TVARSMK := tvars.mk
+G_DIRMK := dir.mk
+G_VARSMK := vars.mk
+G_FILESMK := files.mk
+G_RULESMK := rules.mk
+G_LISTSMK := lists.mk
+G_TVARSMK := tvars.mk
include ${G_VARSMK}
# lists populated by dir.mk files in subdirectories
-L_SRCS_$P := # := start
-L_OBJS_$P := # := start
-L_DEPS_$P := # := start
+L_SRCS_$P := # := start
+L_OBJS_$P := # := start
+L_DEPS_$P := # := start
-L_BLDDIRS_$P := # := start
+L_BLDDIRS_$P := # := start
-L_BLDDIRS_$P += ${OBJSDIR_$P}
-L_BLDDIRS_$P += ${DEPSDIR_$P}
-L_BLDDIRS_$P += ${WORKINGDIR_$P}
+L_BLDDIRS_$P += ${OBJSDIR_$P}
+L_BLDDIRS_$P += ${DEPSDIR_$P}
+L_BLDDIRS_$P += ${WORKINGDIR_$P}
# Append to lists
-L_SRCS_$P += ${NEWSRCS}
-L_OBJS_$P += $(addprefix ${OBJSDIR_$P},${NEWOBJS})
-L_DEPS_$P += $(addprefix ${DEPSDIR_$P},${NEWDEPS})
+L_SRCS_$P += ${NEWSRCS}
+L_OBJS_$P += $(addprefix ${OBJSDIR_$P},${NEWOBJS})
+L_DEPS_$P += $(addprefix ${DEPSDIR_$P},${NEWDEPS})
-L_BLDDIRS_$P += ${NEWOBJSDIRS}
-L_BLDDIRS_$P += ${NEWDEPSDIRS}
+L_BLDDIRS_$P += ${NEWOBJSDIRS}
+L_BLDDIRS_$P += ${NEWDEPSDIRS}
# Append to lists
-L_SRCS_$P += ${NEWSRCS}
-L_OBJS_$P += $(addprefix ${OBJSDIR_$P},${NEWOBJS})
-L_DEPS_$P += $(addprefix ${DEPSDIR_$P},${NEWDEPS})
+L_SRCS_$P += ${NEWSRCS}
+L_OBJS_$P += $(addprefix ${OBJSDIR_$P},${NEWOBJS})
+L_DEPS_$P += $(addprefix ${DEPSDIR_$P},${NEWDEPS})
-L_BLDDIRS_$P += ${NEWOBJSDIRS}
-L_BLDDIRS_$P += ${NEWDEPSDIRS}
+L_BLDDIRS_$P += ${NEWOBJSDIRS}
+L_BLDDIRS_$P += ${NEWDEPSDIRS}
DEPSDIR_$P := ${CURDIR}deps/
T_INCDIRS_$P := ${SRCSDIR_$P} ${CURDIR}inc/
-INCFLAGS_$P := $(addprefix -I, ${T_INCDIRS_$P})
+ INCFLAGS_$P := $(addprefix -I, ${T_INCDIRS_$P})
T_INCDIRS_$P :=
.PHONY: ${G_DEPS_TESTS}
-L_CLEANCMDS += cleanbin
-.PHONY: cleanbin
+L_CLEANCMDS += cleanbin
+.PHONY: cleanbin
cleanbin:
-L_CLEANCMDS += cleanobjs
-.PHONY: cleanobjs
+L_CLEANCMDS += cleanobjs
+.PHONY: cleanobjs
cleanobjs:
-L_CLEANCMDS += cleandeps
-.PHONY: cleandeps
+L_CLEANCMDS += cleandeps
+.PHONY: cleandeps
cleandeps:
-L_CLEANCMDS += clean
-.PHONY: clean
+L_CLEANCMDS += clean
+.PHONY: clean
clean: cleanobjs
-L_CLEANCMDS += cleanall
-.PHONY: cleanall
+L_CLEANCMDS += cleanall
+.PHONY: cleanall
cleanall: cleanbin cleanobjs cleandeps
.PHONY: deps
deps: ${G_DEPS_LIB} ${G_DEPS_TESTS}
+
# lists populated by dir.mk files in subdirectories
-L_SRCS_$P := # := start
-L_OBJS_$P := # := start
-L_DEPS_$P := # := start
+L_SRCS_$P := # := start
+L_OBJS_$P := # := start
+L_DEPS_$P := # := start
-L_BLDDIRS_$P := # := start
+L_BLDDIRS_$P := # := start
-L_BLDDIRS_$P += ${OBJSDIR_$P}
-L_BLDDIRS_$P += ${DEPSDIR_$P}
-L_BLDDIRS_$P += ${WORKINGDIR_$P}
+L_BLDDIRS_$P += ${OBJSDIR_$P}
+L_BLDDIRS_$P += ${DEPSDIR_$P}
+L_BLDDIRS_$P += ${WORKINGDIR_$P}
cleanall: cleanall-$P
.PHONY: cleanall-$P
cleanall-$P: cleanbin-$P cleanobjs-$P cleandeps-$P
+
# Append to lists
-L_SRCS_$D += ${NEWSRCS}
-L_OBJS_$D += $(addprefix ${OBJSDIR_$P},${NEWOBJS})
-L_DEPS_$D += $(addprefix ${DEPSDIR_$P},${NEWDEPS})
+L_SRCS_$D += ${NEWSRCS}
+L_OBJS_$D += $(addprefix ${OBJSDIR_$P},${NEWOBJS})
+L_DEPS_$D += $(addprefix ${DEPSDIR_$P},${NEWDEPS})
-L_BLDDIRS_$P += ${NEWOBJSDIRS}
-L_BLDDIRS_$P += ${NEWDEPSDIRS}
+L_BLDDIRS_$P += ${NEWOBJSDIRS}
+L_BLDDIRS_$P += ${NEWDEPSDIRS}
-CXX_$D := ${CXX_$P}
-CXXFLAGS_$D := ${CXXFLAGS_$P}
-LNKFLAGS_$D := ${LNKFLAGS_$P}
-LIBS_$D := ${LIBS_$P}
+CXX_$D := ${CXX_$P}
+CXXFLAGS_$D := ${CXXFLAGS_$P}
+LNKFLAGS_$D := ${LNKFLAGS_$P}
+LIBS_$D := ${LIBS_$P}
-TARGETNAME_$D := test-1
-TARGETTMP_$D := ${OBJSDIR_$P}${TARGETNAME_$D}
-TARGET_$D := ${WORKINGDIR_$P}${TARGETNAME_$D}
+TARGETNAME_$D := test-1
+TARGETTMP_$D := ${OBJSDIR_$P}${TARGETNAME_$D}
+TARGET_$D := ${WORKINGDIR_$P}${TARGETNAME_$D}
# Append to lists
-L_SRCS_$P += ${NEWSRCS}
-L_OBJS_$P += $(addprefix ${OBJSDIR_$P},${NEWOBJS})
-L_DEPS_$P += $(addprefix ${DEPSDIR_$P},${NEWDEPS})
+L_SRCS_$P += ${NEWSRCS}
+L_OBJS_$P += $(addprefix ${OBJSDIR_$P},${NEWOBJS})
+L_DEPS_$P += $(addprefix ${DEPSDIR_$P},${NEWDEPS})
-L_BLDDIRS_$P += ${NEWOBJSDIRS}
-L_BLDDIRS_$P += ${NEWDEPSDIRS}
+L_BLDDIRS_$P += ${NEWOBJSDIRS}
+L_BLDDIRS_$P += ${NEWDEPSDIRS}
# Append to lists
-L_SRCS_$D += ${NEWSRCS}
-L_OBJS_$D += $(addprefix ${OBJSDIR_$P},${NEWOBJS})
-L_DEPS_$D += $(addprefix ${DEPSDIR_$P},${NEWDEPS})
+L_SRCS_$D += ${NEWSRCS}
+L_OBJS_$D += $(addprefix ${OBJSDIR_$P},${NEWOBJS})
+L_DEPS_$D += $(addprefix ${DEPSDIR_$P},${NEWDEPS})
-L_BLDDIRS_$P += ${NEWOBJSDIRS}
-L_BLDDIRS_$P += ${NEWDEPSDIRS}
+L_BLDDIRS_$P += ${NEWOBJSDIRS}
+L_BLDDIRS_$P += ${NEWDEPSDIRS}
-CXX_$D := ${CXX_$P}
-CXXFLAGS_$D := ${CXXFLAGS_$P}
-LNKFLAGS_$D := ${LNKFLAGS_$P}
-LIBS_$D := ${LIBS_$P}
+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}
+TARGETNAME_$D := test-printTrace
+TARGETTMP_$D := ${OBJSDIR_$P}${TARGETNAME_$D}
+TARGET_$D := ${WORKINGDIR_$P}${TARGETNAME_$D}
CXXFLAGS_$P := ${G_CXXFLAGS}
LNKFLAGS_$P := ${G_LNKFLAGS} -Wl,-rpath,./ -rdynamic
+T_INCDIRS_$P := lib/inc/
+ INCFLAGS_$P := $(addprefix -I, ${T_INCDIRS_$P})
+T_INCDIRS_$P := # empty
+
+LIBS_$P :=
ifeq (${BUILD},WIN32)
- T_LIBGL_$P := -lopengl32 -lglu32
- T_LIBSDL_$P := `/usr/mingw32/bin/sdl-config --libs`
+ LIBS_$P += -lopengl32 -lglu32
+ LIBS_$P += `/usr/mingw32/bin/sdl-config --libs`
else
- T_LIBGL_$P := -lGL -lGLU
- T_LIBSDL_$P := `sdl-config --libs`
+ LIBS_$P += -lGL -lGLU
+ LIBS_$P += `sdl-config --libs`
endif
-LIBS_$P := ${T_LIBSDL_$P} ${T_LIBGL_$P}
-
-T_LIBGL_$P :=
-T_LIBSDL_$P :=
-SRCSDIR_$P := ${CURDIR}src/
-DEPSDIR_$P := ${CURDIR}deps/
-
-T_INCDIRS_$P := lib/inc/
-INCFLAGS_$P := $(addprefix -I, ${T_INCDIRS_$P})
-T_INCDIRS_$P :=
+SRCSDIR_$P := ${CURDIR}src/
+DEPSDIR_$P := ${CURDIR}deps/
ifeq (${BUILD},WIN32)
OBJSDIR_$P := ${CURDIR}objs-mingw32/