From 4d9321c2e13a83db93bb999f03ab5155a05a69bf Mon Sep 17 00:00:00 2001 From: evanc Date: Wed, 15 Apr 2015 01:04:30 -0700 Subject: [PATCH] Make file dependency --- nodemanager/NodeManager.layout | 233 +++++++++++++++++++++------------ nodemanager/Version.cpp | 1 + nodemanager/Version.h | 5 + nodemanager/makefile | 16 ++- 4 files changed, 168 insertions(+), 87 deletions(-) diff --git a/nodemanager/NodeManager.layout b/nodemanager/NodeManager.layout index ff68db4..8e5269b 100644 --- a/nodemanager/NodeManager.layout +++ b/nodemanager/NodeManager.layout @@ -1,104 +1,49 @@ - + - + - + - + - + - - - - - - - - - - - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -106,44 +51,164 @@ - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nodemanager/Version.cpp b/nodemanager/Version.cpp index 50b5049..86e6110 100644 --- a/nodemanager/Version.cpp +++ b/nodemanager/Version.cpp @@ -1 +1,2 @@ #include "Version.h" + diff --git a/nodemanager/Version.h b/nodemanager/Version.h index 36b8d40..abf2dfd 100644 --- a/nodemanager/Version.h +++ b/nodemanager/Version.h @@ -58,6 +58,11 @@ namespace hpc "Fixed a bug that json not-existing value is handled incorrectly", } }, + { "1.1.1.7", + { + "Make file dependency auto detect", + } + }, }; return versionHistory; diff --git a/nodemanager/makefile b/nodemanager/makefile index f5ddd49..279e886 100644 --- a/nodemanager/makefile +++ b/nodemanager/makefile @@ -30,7 +30,8 @@ DEBUG = debug RELEASE = release OBJDIR = obj OUTDIR = bin -CPPS = $(notdir $(wildcard */*.cpp *.cpp)) +CPPSWITHDIR = $(wildcard */*.cpp *.cpp) +CPPS = $(notdir $(CPPSWITHDIR)) OBJS = $(CPPS:.cpp=.o) # debug @@ -41,6 +42,7 @@ LIBDIR_DEBUG = -L$(CASA_LIB_DEBUG) LIB_DEBUG = $(LIB) LDFLAGS_DEBUG = $(LDFLAGS) OBJDIR_DEBUG = $(OBJDIR)/$(DEBUG) +OBJDIRSED_DEBUG = $(OBJDIR)\/$(DEBUG) OUTDIR_DEBUG = $(OUTDIR)/$(DEBUG) OUT_DEBUG = $(OUTDIR_DEBUG)/$(BINARY) OBJS_DEBUG = $(addprefix $(OBJDIR_DEBUG)/, $(OBJS)) @@ -53,6 +55,7 @@ LIBDIR_RELEASE = -L$(CASA_LIB_RELEASE) LIB_RELEASE = $(LIB) LDFLAGS_RELEASE = $(LDFLAGS) -s OBJDIR_RELEASE = $(OBJDIR)/$(RELEASE) +OBJDIRSED_RELEASE = $(OBJDIR)\/$(RELEASE) OUTDIR_RELEASE = $(OUTDIR)/$(RELEASE) OUT_RELEASE = $(OUTDIR_RELEASE)/$(BINARY) OBJS_RELEASE = $(addprefix $(OBJDIR_RELEASE)/, $(OBJS)) @@ -190,5 +193,12 @@ $(OBJDIR_RELEASE)/%.o: %.cpp # dependency include deps -deps: - $(CXX) -MM *.cpp */*.cpp > deps +deps: $(CPPSWITHDIR) + @tput bold; + @echo -n "Rebuilding dependencies ... "; + $(CXX) -MM *.cpp */*.cpp > rawdeps + cat rawdeps | sed -e "s/\(.*\)\.o/$(OBJDIRSED_DEBUG)\/\1\.o/" > deps + cat rawdeps | sed -e "s/\(.*\)\.o/$(OBJDIRSED_RELEASE)\/\1\.o/" >> deps + @tput setaf 2 + @echo "Done." + @tput sgr0;