cleaned up how dir.mk files work
authorPatrik Gornicz <Gornicz.P@gmail.com>
Sun, 24 May 2009 18:11:23 +0000 (14:11 -0400)
committerPatrik Gornicz <Gornicz.P@gmail.com>
Sun, 24 May 2009 18:11:23 +0000 (14:11 -0400)
Makefile
src/dir.mk
src/locks/dir.mk

index 5b362b3..ac3d9dc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -109,12 +109,22 @@ else
 endif
 
 
-# include all of the dir.mk
-DIRS    := # := start
+# cause the fancy $${@D} directory rules to work out
+.SECONDEXPANSION:
+
+.PHONY: all
+all: ${TARGET}
+
+
+# lists populated by dir.mk files in subdirectories
 SRCS    := # := start
+DIRS    := # := start
 OBJS    := # := start
 DEPS    := # := start
+
 DIRMK   := dir.mk
+
+# include all of the dir.mk files in src
 include ${SRCSDIR}${DIRMK}
 
 
@@ -127,9 +137,6 @@ BLDDIRS     += ${DEPSBLDDIRS}
 BLDDIRS     += ${WORKINGDIR}
 
 
-.PHONY: all
-all: ${TARGET}
-
 INSTALL := install
 
 # HACK install
@@ -147,9 +154,6 @@ uninstall:
        rm /usr/lib/${LINKERNAME}
        rm /usr/lib/${SONAME}
 
-# cause the fancy $${@D} directory rules to work out
-.SECONDEXPANSION:
-
 # how to link the main target
 ${TARGETTMP}: ${OBJS} | $${@D}
        ${Q1}${PRNTFMT} "${CXX}" "$@"
index b03257c..6f0b4e0 100644 (file)
@@ -1,13 +1,12 @@
-NEWSRCS := # insure blank
 
+NEWSRCS := # := start; empty
 NEWSRCS += Vector2.cpp
 NEWSRCS += mathw.cpp
 NEWSRCS += debug.cpp
 NEWSRCS += Timer.cpp
 NEWSRCS += Ticks.cpp
 
-NEWDIRS := # insure blank
-
+NEWDIRS := # := start; empty
 NEWDIRS += locks/
 
 # Post dir setup
@@ -22,7 +21,7 @@ NEWDEPS := ${NEWSRCS:.cpp=.d}
 # Append to lists
 
 SRCS    += ${NEWSRCS}
-DIRS    += ${NEWDIRS}
+DIRS    += ${CURDIR}
 OBJS    += $(addprefix ${OBJSDIR},${NEWOBJS})
 DEPS    += $(addprefix ${DEPSDIR},${NEWDEPS})
 
index 7a6068d..0c0b1e6 100644 (file)
@@ -1,19 +1,25 @@
-NEWSRCS := # insure blank
 
+NEWSRCS := # := start; empty
 NEWSRCS += Autolock.cpp
 NEWSRCS += Lock.cpp
 
+NEWDIRS := # := start; empty
 
 # Post dir setup
 
-CURDIR         := locks/
+CURDIR  := locks/
 
 NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS})
+NEWDIRS := $(addprefix ${CURDIR},${NEWDIRS})
 NEWOBJS := ${NEWSRCS:.cpp=.o}
 NEWDEPS := ${NEWSRCS:.cpp=.d}
 
 # Append to lists
 
 SRCS    += ${NEWSRCS}
+DIRS    += ${CURDIR}
 OBJS    += $(addprefix ${OBJSDIR},${NEWOBJS})
 DEPS    += $(addprefix ${DEPSDIR},${NEWDEPS})
+
+
+include $(addprefix ${SRCSDIR},$(addsuffix ${DIRMK},${NEWDIRS}))