From 15e36d2319cfb409ea5f5d600c7bea59c96b8bc3 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Sat, 13 Jun 2009 17:57:33 -0400 Subject: [PATCH] added DIRNAME to each directory, tests now have there own make targets --- Makefile | 2 -- lib/dir.mk | 6 +++--- lib/src/dir.mk | 3 ++- lib/src/locks/dir.mk | 5 +++-- targets.mk | 2 ++ tests/dir.mk | 6 +++--- tests/src/1/dir.mk | 7 ++++--- tests/src/1/rules.mk | 1 + tests/src/dir.mk | 3 ++- tests/src/printTrace/dir.mk | 7 ++++--- tests/src/printTrace/rules.mk | 1 + 11 files changed, 25 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 5cf0a31..911ade4 100644 --- a/Makefile +++ b/Makefile @@ -12,8 +12,6 @@ default: # Include the variables that describe targets include targets.mk -default: ${G_LIB} - G_DIRMK := dir.mk G_VARSMK := vars.mk diff --git a/lib/dir.mk b/lib/dir.mk index 71eb385..b4b70f8 100644 --- a/lib/dir.mk +++ b/lib/dir.mk @@ -1,7 +1,7 @@ -# Package name -P := lib -CURDIR := lib/ +DIRNAME := lib +P := ${DIRNAME} +CURDIR := ${DIRNAME}/ include ${CURDIR}${G_VARSMK} diff --git a/lib/src/dir.mk b/lib/src/dir.mk index 51f68a5..70a37db 100644 --- a/lib/src/dir.mk +++ b/lib/src/dir.mk @@ -1,5 +1,6 @@ -CURDIR := lib/src/ +DIRNAME := src +CURDIR := lib/${DIRNAME}/ SRCPATH := include ${CURDIR}${G_FILESMK} diff --git a/lib/src/locks/dir.mk b/lib/src/locks/dir.mk index ee53887..96f7fe7 100644 --- a/lib/src/locks/dir.mk +++ b/lib/src/locks/dir.mk @@ -1,6 +1,7 @@ -CURDIR := lib/src/locks/ -SRCPATH := locks/ +DIRNAME := locks +CURDIR := lib/src/${DIRNAME}/ +SRCPATH := ${DIRNAME}/ include ${CURDIR}${G_FILESMK} include $(addprefix ${SRCSDIR_$P},$(addsuffix ${G_DIRMK},${NEWDIRS})) diff --git a/targets.mk b/targets.mk index 3b825fc..d367806 100644 --- a/targets.mk +++ b/targets.mk @@ -40,6 +40,8 @@ L_CLEANCMDS += cleanall cleanall: cleanbin cleanobjs cleandeps +default: ${G_LIB} + .PHONY: all all: ${G_LIB} ${G_TESTS} diff --git a/tests/dir.mk b/tests/dir.mk index a324c2b..2559d47 100644 --- a/tests/dir.mk +++ b/tests/dir.mk @@ -1,7 +1,7 @@ -# Package name -P := tests -CURDIR := tests/ +DIRNAME := tests +P := ${DIRNAME} +CURDIR := ${DIRNAME}/ include ${CURDIR}${G_VARSMK} diff --git a/tests/src/1/dir.mk b/tests/src/1/dir.mk index 3d71d3a..e29d2ea 100644 --- a/tests/src/1/dir.mk +++ b/tests/src/1/dir.mk @@ -1,7 +1,8 @@ -D := tests_src_1 -CURDIR := tests/src/1/ -SRCPATH := 1/ +DIRNAME := 1 +D := tests_src_${DIRNAME} +CURDIR := tests/src/${DIRNAME}/ +SRCPATH := ${DIRNAME}/ include ${CURDIR}${G_VARSMK} diff --git a/tests/src/1/rules.mk b/tests/src/1/rules.mk index 41ba298..5d34bd0 100644 --- a/tests/src/1/rules.mk +++ b/tests/src/1/rules.mk @@ -1,5 +1,6 @@ ${G_TESTS}: ${TARGET_$D} +${G_TESTS}_${DIRNAME}: ${TARGET_$D} # HACK ${TARGETTMP_$D}: tests/bind/libbear.so.0 diff --git a/tests/src/dir.mk b/tests/src/dir.mk index 39dd426..8f7f596 100644 --- a/tests/src/dir.mk +++ b/tests/src/dir.mk @@ -1,5 +1,6 @@ -CURDIR := tests/src/ +DIRNAME := src +CURDIR := tests/${DIRNAME}/ SRCPATH := include ${CURDIR}${G_FILESMK} diff --git a/tests/src/printTrace/dir.mk b/tests/src/printTrace/dir.mk index d4abc31..75d8d52 100644 --- a/tests/src/printTrace/dir.mk +++ b/tests/src/printTrace/dir.mk @@ -1,7 +1,8 @@ -D := tests_src_printTrace -CURDIR := tests/src/printTrace/ -SRCPATH := printTrace/ +DIRNAME := printTrace +D := tests_src_${DIRNAME} +CURDIR := tests/src/${DIRNAME}/ +SRCPATH := ${DIRNAME}/ include ${CURDIR}${G_VARSMK} diff --git a/tests/src/printTrace/rules.mk b/tests/src/printTrace/rules.mk index 41ba298..5d34bd0 100644 --- a/tests/src/printTrace/rules.mk +++ b/tests/src/printTrace/rules.mk @@ -1,5 +1,6 @@ ${G_TESTS}: ${TARGET_$D} +${G_TESTS}_${DIRNAME}: ${TARGET_$D} # HACK ${TARGETTMP_$D}: tests/bind/libbear.so.0 -- 2.10.2