updated target to use only suffixies
authorPatrik Gornicz <Gornicz.P@gmail.com>
Sat, 13 Jun 2009 21:29:27 +0000 (17:29 -0400)
committerPatrik Gornicz <Gornicz.P@gmail.com>
Sat, 13 Jun 2009 21:29:27 +0000 (17:29 -0400)
Makefile
lib/rules.mk
lib/tvars.mk
targets.mk
tests/rules.mk
tests/tvars.mk

index 7b8d452..5cf0a31 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,6 @@ BUILD    := DEBUG
 .SECONDEXPANSION:
 
 # The first and therefor default rule
-# targets append themselves to this to be built by all
 .PHONY: default
 default:
 
index 5f9919a..4f9bffa 100644 (file)
@@ -16,8 +16,8 @@ uninstall:
 
 
 ${G_LIB}: ${TARGET_$P}
-${G_LIB_OBJS}: ${L_OBJS_$P}
-${G_LIB_DEPS}: ${L_DEPS_$P}
+${G_OBJS_LIB}: ${L_OBJS_$P}
+${G_DEPS_LIB}: ${L_DEPS_$P}
 
 
 # how to link the main target
@@ -48,33 +48,33 @@ ${DEPSDIR_$P}%.d: ${SRCSDIR_$P}%.cpp | $${@D}
        ${Q2}${CXX} -MM ${CXXFLAGS} $< ${INCFLAGS} | sed 's/\(^.*\):/$(subst /,\/,${@:${DEPSDIR}%.d=${OBJSDIR}%.o} $@):/' > $@
 
 
-L_CLEANCMDS +=    $P-cleanbin
-cleanbin:       $P-cleanbin
-.PHONY:         $P-cleanbin
-$P-cleanbin:
+L_CLEANCMDS +=  cleanbin-$P
+cleanbin:       cleanbin-$P
+.PHONY:         cleanbin-$P
+cleanbin-$P:
        ${Q1}${PRNTFMT} "rm" "${WORKINGDIR}"
        ${Q2}rm -rf ${WORKINGDIR}
 
-L_CLEANCMDS +=    $P-cleanobjs
-cleanobjs:      $P-cleanobjs
-.PHONY:         $P-cleanobjs
-$P-cleanobjs:
+L_CLEANCMDS +=  cleanobjs-$P
+cleanobjs:      cleanobjs-$P
+.PHONY:         cleanobjs-$P
+cleanobjs-$P:
        ${Q1}${PRNTFMT} "rm" "${OBJSDIR}"
        ${Q2}rm -rf ${OBJSDIR}
 
-L_CLEANCMDS +=    $P-cleandeps
-cleandeps:      $P-cleandeps
-.PHONY:         $P-cleandeps
-$P-cleandeps:
+L_CLEANCMDS +=  cleandeps-$P
+cleandeps:      cleandeps-$P
+.PHONY:         cleandeps-$P
+cleandeps-$P:
        ${Q1}${PRNTFMT} "rm" "${DEPSDIR}"
        ${Q2}rm -rf ${DEPSDIR}
 
-L_CLEANCMDS +=    $P-clean
-clean:          $P-clean
-.PHONY:         $P-clean
-$P-clean: $P-cleanobjs $P-cleanbin
+L_CLEANCMDS +=  clean-$P
+clean:          clean-$P
+.PHONY:         clean-$P
+clean-$P: cleanobjs-$P cleanbin-$P
 
-L_CLEANCMDS +=    $P-cleanall
-cleanall:       $P-cleanall
-.PHONY:         $P-cleanall
-$P-cleanall: $P-cleanbin $P-cleanobjs $P-cleandeps
+L_CLEANCMDS +=  cleanall-$P
+cleanall:       cleanall-$P
+.PHONY:         cleanall-$P
+cleanall-$P: cleanbin-$P cleanobjs-$P cleandeps-$P
index 7148e05..bd66535 100644 (file)
@@ -11,8 +11,7 @@ ${TARGETTMP_$P}: CXXFLAGS := ${CXXFLAGS_$P}
 ${TARGETTMP_$P}: LNKFLAGS := ${LNKFLAGS_$P}
 ${TARGETTMP_$P}: LIBS     := ${LIBS_$P}
 
-$P-cleanbin:    WORKINGDIR  := ${WORKINGDIR_$P}
-$P-cleanobjs:   OBJSDIR     := ${OBJSDIR_$P}
-$P-cleandeps:   DEPSDIR     := ${DEPSDIR_$P}
-$P-clean:       TARGET      := ${TARGET_$P}
+cleanbin-$P:    WORKINGDIR  := ${WORKINGDIR_$P}
+cleanobjs-$P:   OBJSDIR     := ${OBJSDIR_$P}
+cleandeps-$P:   DEPSDIR     := ${DEPSDIR_$P}
 
index fefa6e3..3b825fc 100644 (file)
@@ -1,40 +1,50 @@
 
-# LIB: the target of the lib directory
 G_LIB := lib
 .PHONY: ${G_LIB}
 
-G_LIB_OBJS := lib-objs
-.PHONY: ${G_LIB_OBJS}
+G_OBJS_LIB := objs-lib
+.PHONY: ${G_OBJS_LIB}
+
+G_DEPS_LIB := deps-lib
+.PHONY: ${G_DEPS_LIB}
 
-G_LIB_DEPS := lib-deps
-.PHONY: ${G_LIB_DEPS}
 
-# TESTS: build all of the tests
 G_TESTS := tests
 .PHONY: ${G_TESTS}
 
-G_TESTS_OBJS := tests-objs
-.PHONY: ${G_TESTS_OBJS}
+G_OBJS_TESTS := objs-tests
+.PHONY: ${G_OBJS_TESTS}
+
+G_DEPS_TESTS := deps-tests
+.PHONY: ${G_DEPS_TESTS}
 
-G_TESTS_DEPS := tests-deps
-.PHONY: ${G_TESTS_DEPS}
 
-L_CLEANCMDS +=   cleanbin
+L_CLEANCMDS += cleanbin
 .PHONY:        cleanbin
 cleanbin:
 
-L_CLEANCMDS +=   cleanobjs
+L_CLEANCMDS += cleanobjs
 .PHONY:        cleanobjs
 cleanobjs:
 
-L_CLEANCMDS +=   cleandeps
+L_CLEANCMDS += cleandeps
 .PHONY:        cleandeps
 cleandeps:
 
-L_CLEANCMDS +=   clean
+L_CLEANCMDS += clean
 .PHONY:        clean
 clean: cleanobjs
 
-L_CLEANCMDS +=   cleanall
+L_CLEANCMDS += cleanall
 .PHONY:        cleanall
 cleanall: cleanbin cleanobjs cleandeps
+
+
+.PHONY: all
+all: ${G_LIB} ${G_TESTS}
+
+.PHONY: objs
+objs: ${G_OBJS_LIB} ${G_OBJS_TESTS}
+
+.PHONY: deps
+deps: ${G_DEPS_LIB} ${G_DEPS_TESTS}
index 1be2644..a8faf94 100644 (file)
@@ -1,6 +1,6 @@
 
-${G_TESTS_OBJS}: ${L_OBJS_$P}
-${G_TESTS_DEPS}: ${L_DEPS_$P}
+${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}
@@ -25,33 +25,33 @@ ${DEPSDIR_$P}%.d: ${SRCSDIR_$P}%.cpp | $${@D}
        ${Q2}${CXX} -MM ${CXXFLAGS} $< ${INCFLAGS} | sed 's/\(^.*\):/$(subst /,\/,${@:${DEPSDIR}%.d=${OBJSDIR}%.o} $@):/' > $@
 
 
-L_CLEANCMDS +=    $P-cleanbin
-cleanbin:       $P-cleanbin
-.PHONY:         $P-cleanbin
-$P-cleanbin:
+L_CLEANCMDS +=  cleanbin-$P
+cleanbin:       cleanbin-$P
+.PHONY:         cleanbin-$P
+cleanbin-$P:
        ${Q1}${PRNTFMT} "rm" "${WORKINGDIR}"
        ${Q2}rm -rf ${WORKINGDIR}
 
-L_CLEANCMDS +=    $P-cleanobjs
-cleanobjs:      $P-cleanobjs
-.PHONY:         $P-cleanobjs
-$P-cleanobjs:
+L_CLEANCMDS +=  cleanobjs-$P
+cleanobjs:      cleanobjs-$P
+.PHONY:         cleanobjs-$P
+cleanobjs-$P:
        ${Q1}${PRNTFMT} "rm" "${OBJSDIR}"
        ${Q2}rm -rf ${OBJSDIR}
 
-L_CLEANCMDS +=    $P-cleandeps
-cleandeps:      $P-cleandeps
-.PHONY:         $P-cleandeps
-$P-cleandeps:
+L_CLEANCMDS +=  cleandeps-$P
+cleandeps:      cleandeps-$P
+.PHONY:         cleandeps-$P
+cleandeps-$P:
        ${Q1}${PRNTFMT} "rm" "${DEPSDIR}"
        ${Q2}rm -rf ${DEPSDIR}
 
-L_CLEANCMDS +=    $P-clean
-clean:          $P-clean
-.PHONY:         $P-clean
-$P-clean: $P-cleanobjs $P-cleanbin
+L_CLEANCMDS +=  clean-$P
+clean:          clean-$P
+.PHONY:         clean-$P
+clean-$P: cleanobjs-$P cleanbin-$P
 
-L_CLEANCMDS +=    $P-cleanall
-cleanall:       $P-cleanall
-.PHONY:         $P-cleanall
-$P-cleanall: $P-cleanbin $P-cleanobjs $P-cleandeps
+L_CLEANCMDS +=  cleanall-$P
+cleanall:       cleanall-$P
+.PHONY:         cleanall-$P
+cleanall-$P: cleanbin-$P cleanobjs-$P cleandeps-$P
index 6afc32d..a062b30 100644 (file)
@@ -5,7 +5,7 @@ ${L_OBJS_$P} ${L_DEPS_$P}: INCFLAGS := ${INCFLAGS_$P}
              ${L_DEPS_$P}: DEPSDIR  := ${DEPSDIR_$P}
              ${L_DEPS_$P}: OBJSDIR  := ${OBJSDIR_$P}
 
-$P-cleanbin:    WORKINGDIR  := ${WORKINGDIR_$P}
-$P-cleanobjs:   OBJSDIR     := ${OBJSDIR_$P}
-$P-cleandeps:   DEPSDIR     := ${DEPSDIR_$P}
+cleanbin-$P:    WORKINGDIR  := ${WORKINGDIR_$P}
+cleanobjs-$P:   OBJSDIR     := ${OBJSDIR_$P}
+cleandeps-$P:   DEPSDIR     := ${DEPSDIR_$P}